create a new level structure, that makes the code more maintenable. Move level.*...
[neverball] / ball / game.h
1 #ifndef GAME_H
2 #define GAME_H
3
4 #include <stdio.h>
5
6 #include "level.h"
7
8 /*---------------------------------------------------------------------------*/
9
10 #define AUD_MENU   1
11 #define AUD_START  2
12 #define AUD_READY  3
13 #define AUD_SET    4
14 #define AUD_GO     5
15 #define AUD_BALL   6
16 #define AUD_BUMP   7
17 #define AUD_COIN   8
18 #define AUD_TICK   9
19 #define AUD_TOCK   10
20 #define AUD_SWITCH 11
21 #define AUD_JUMP   12
22 #define AUD_GOAL   13
23 #define AUD_SCORE  14
24 #define AUD_FALL   15
25 #define AUD_TIME   16
26 #define AUD_OVER   17
27 #define AUD_COUNT  18
28
29 /*---------------------------------------------------------------------------*/
30
31 #define MAX_DT      0.01666666         /* Maximum physics update cycle       */
32 #define MAX_DN      16                 /* Maximum subdivisions of dt         */
33 #define RESPONSE    0.05f              /* Input smoothing time               */
34
35 #define ANGLE_BOUND 22.f               /* Angle limit of floor tilting       */
36 #define NO_AA       1                  /* Disable Angle Acceleration         */
37
38
39 #define GAME_NONE 0
40 #define GAME_TIME 1
41 #define GAME_GOAL 2
42 #define GAME_FALL 3
43
44 /*---------------------------------------------------------------------------*/
45
46 int   game_init(const struct level *, int, int);
47 void  game_free(void);
48
49 int   curr_clock(void);
50 int   curr_coins(void);
51 int   curr_goal(void);
52 char *curr_intro(void);
53
54 void  game_draw(int, float);
55 int   game_step(const float[3], float, int);
56
57 void  game_set_pos(int, int);
58 void  game_set_x  (int);
59 void  game_set_z  (int);
60 void  game_set_rot(float);
61 void  game_set_fly(float);
62
63 void  game_look(float, float);
64
65 void  game_kill_fade(void);
66 void  game_step_fade(float);
67 void  game_fade(float);
68
69 int   put_game_state(FILE *);
70 int   get_game_state(FILE *);
71
72 /*---------------------------------------------------------------------------*/
73
74 #endif