-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDefines.h
More file actions
118 lines (85 loc) · 2.27 KB
/
Defines.h
File metadata and controls
118 lines (85 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*******************************************************************************
CommanderTux
Penguin In Space
Released under the GNU Public License
2005 by André Schnabel (thefrogs@web.de)
*******************************************************************************/
// Defines.h
// Contains most #define stuff and all filenames
#ifndef DEFINES_H
#define DEFINES_H
#define VERSION 0.300000
#define VERSION_C "3rd Alpha (0.3)"
#define DATA_PREFIX "data"
// Player images in the worldmap
#define NUM_W_P_IMAGES 8
#define NUM_LEVELS 4
#define NUM_TILES 24
#define NUM_ENEMIES 6
#define NUM_SONGS 2
// Disable stuff
//#define NO_SOUND
// Debugging macros
// use gcc -D ... to change these values without touching the sources
#define SHOW_DEBUG 1
#if SHOW_DEBUG == 1
#define DEBUG( msg ) printf( "CTux_Msg: " ); printf( msg ); printf( "\n" );
#define SHOW_VERSION() printf( "CTux_Msg: " ); \
printf( "Version: %f", VERSION );\
printf( "\n" );
#else
#define DEBUG( msg )
#define SHOW_VERSION()
#endif
// Screen resolutions
#define SCR_W 640
#define SCR_H 480
#define EDIT_W 1024
#define EDIT_H 768
// Pseudo physics
#define PLAYER_FALL_SPEED 8
// Changing these values would prevent you from loading level files created by
// older versions of the game!!!
#define LVL_W_MAX 256 // array: 0-255
#define LVL_H_MAX 64 // array: 0-63
#define TILE_H 30
#define TILE_W 30
#define TILE_EMPTY 255
struct Position {
int x, y;
Position()
{ x=y=0; }
};
enum Direction {
// Horizontal
DIR_LEFT,
DIR_RIGHT,
// Vertical
DIR_UP,
DIR_DOWN
};
// Player
// This is interesting for cheaters...
#define NUM_LIVES 4
#define WALK_SPEED 7
#define JUMP_POWER 6
#define JUMP_INCREASE_MAX 15
#define JUMP_INCREASE_POWER 5
#define PLAYER_RECT_X 240
#define PLAYER_RECT_Y 80
#define PLAYER_RECT_W 160
#define PLAYER_RECT_H 160
#define SCROLL_SPEED WALK_SPEED
#define OVER 0
#define FLIP_TIME 150 // msec...
// Gravity
struct Gravity_Event {
Uint32 s_time;
bool active;
Gravity_Event()
{
s_time = 0;
active = false;
}
};
#endif