update, the location of themes has changed. You can also find a initial save & load...
[supertux.git] / src / gameloop.h
1 /*
2   gameloop.h
3   
4   Super Tux - Game Loop!
5   
6   by Bill Kendrick
7   bill@newbreedsoftware.com
8   http://www.newbreedsoftware.com/supertux/
9   
10   April 11, 2000 - December 28, 2003
11 */
12
13 #if !defined( SUPERTUX_GAMELOOP_H )
14 #define SUPERTUX_GAMELOOP_H 1
15
16         #include "sound.h"
17
18         /* Direction (keyboard/joystick) states: */
19
20         #define UP 0
21         #define DOWN 1
22
23
24         /* Directions: */
25
26         #define LEFT 0
27         #define RIGHT 1
28
29
30         /* Sizes: */
31
32         #define SMALL 0
33         #define BIG 1
34
35
36         /* Bounciness of distros: */
37
38         #define NO_BOUNCE 0
39         #define BOUNCE 1
40
41
42         /* One-ups... */
43
44         #define DISTROS_LIFEUP 100
45
46
47         /* When to alert player they're low on time! */
48
49         #define TIME_WARNING 50
50
51
52         /* Dying types: */
53
54         /* ---- NO 0 */
55         #define SQUISHED 1
56         #define FALLING 2
57
58
59         /* Enemy modes: */
60
61         #define NORMAL 0
62         #define FLAT 1
63         #define KICK 2
64
65
66         /* Hurt modes: */
67
68         #define KILL 0
69         #define SHRINK 1
70
71
72         /* Upgrade types: */
73
74         enum {
75           UPGRADE_MINTS,
76           UPGRADE_COFFEE,
77           UPGRADE_HERRING
78         };
79
80
81         /* Bad guy kinds: */
82
83         enum {
84           BAD_BSOD,
85           BAD_LAPTOP,
86           BAD_MONEY
87         };
88
89
90         /* Speed constraints: */
91
92         #define MAX_WALK_XM 16
93         #define MAX_RUN_XM 24
94         #define MAX_YM 24
95         #define MAX_JUMP_COUNT 3
96         #define MAX_LIVES 4
97
98         #define WALK_SPEED 2
99         #define RUN_SPEED 4
100         #define JUMP_SPEED 8
101         #define BULLET_STARTING_YM 8
102         #define BULLET_XM 16
103
104         #define GRAVITY 2
105         #define YM_FOR_JUMP 40
106         #define KILL_BOUNCE_YM 8
107
108         #define SKID_XM 8
109         #define SKID_TIME 8
110
111
112         #define BOUNCY_BRICK_MAX_OFFSET 8
113         #define BOUNCY_BRICK_SPEED 4
114
115
116         /* Times: */
117
118         #define TUX_SAFE_TIME 16
119         #define TUX_INVINCIBLE_TIME 200
120
121         /* Size constraints: */
122
123         #define OFFSCREEN_DISTANCE 256
124
125         #define LEVEL_WIDTH 375
126
127
128         /* Array sizes: */
129
130         #define NUM_BOUNCY_DISTROS 8
131         #define NUM_BROKEN_BRICKS 32
132         #define NUM_BOUNCY_BRICKS 4
133         #define NUM_BAD_GUYS 128
134         #define NUM_FLOATING_SCORES 6
135         #define NUM_UPGRADES 2
136         #define NUM_BULLETS 3
137
138
139         /* Scores: */
140
141         #define SCORE_BRICK 5
142         #define SCORE_DISTRO 25
143
144         /* Function prototypes: */
145
146         int gameloop(void);
147         void savegame(void);
148         void loadgame(char* filename);
149         
150 #endif
151