- change subimage loading syntax to be more usefull, ie. now its (images "somefile...
[supertux.git] / src / defines.h
1 //  $Id$
2 // 
3 //  SuperTux
4 //  Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
5 //  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; either version 2
10 //  of the License, or (at your option) any later version.
11 //
12 //  This program is distributed in the hope that it will be useful,
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 //  GNU General Public License for more details.
16 // 
17 //  You should have received a copy of the GNU General Public License
18 //  along with this program; if not, write to the Free Software
19 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 //  02111-1307, USA.
21
22 #ifndef SUPERTUX_DEFINES_H
23 #define SUPERTUX_DEFINES_H 1
24
25 #include <config.h>
26
27 /* Version: */
28
29 #ifndef VERSION
30         #define VERSION "0.1.1"
31 #endif
32
33 /* Frames per second: */
34
35 #define FPS (1000 / 25)
36
37 enum Direction { LEFT = 0, RIGHT = 1 };
38
39 /* Direction (keyboard/joystick) states: */
40
41 #define UP 0
42 #define DOWN 1
43
44 /* Joystick menu delay */
45 #define JOYSTICK_MENU_DELAY 500
46
47 /* Dying types: */
48
49 /* ---- NO 0 */
50 enum DyingType {
51   DYING_NOT = 0,
52   DYING_SQUISHED = 1,
53   DYING_FALLING = 2
54 };
55
56 /* Screen-related stuff */
57 // +1 is needed because when tiles are wrapping around the screen there
58 //  are two partial tiles on the screen
59 #define VISIBLE_TILES_X (25 +1)
60 #define VISIBLE_TILES_Y (19 +1)
61
62 /* Sizes: */
63
64 #define SMALL 0
65 #define BIG 1
66
67 /* Speed constraints: */
68
69 #define MAX_WALK_XM 2.3
70 #define MAX_RUN_XM 3.2
71 #define MAX_YM 20.0
72 #define MAX_JUMP_TIME 375
73 #define MAX_LIVES 99
74
75 #define WALK_SPEED 1.0
76 #define RUN_SPEED 1.5
77 #define JUMP_SPEED 1.2
78
79 /* gameplay related defines */
80
81 #define START_LIVES 4
82
83 #define MAX_FIRE_BULLETS 2
84 #define MAX_ICE_BULLETS  1
85 #define FROZEN_TIME 3000
86
87 #define YM_FOR_JUMP 6.0
88 #define WALK_ACCELERATION_X 0.03
89 #define RUN_ACCELERATION_X 0.04
90 #define KILL_BOUNCE_YM 8.0
91
92 #define SKID_XM 2.0
93 #define SKID_TIME 200
94
95 /* Size constraints: */
96
97 #define X_OFFSCREEN_DISTANCE (screen->w/2)
98 #define Y_OFFSCREEN_DISTANCE (screen->h/2)
99
100 #define LEVEL_WIDTH 375
101
102 /* Timing constants (in ms): */
103
104 #define KICKING_TIME 200
105
106 /* Scrolling text speed */
107
108 #define SCROLL_SPEED_CREDITS 2.0
109 #define SCROLL_SPEED_MESSAGE 1.0
110
111 /* Debugging */
112
113 #ifdef DEBUG
114         #define DEBUG_MSG( msg ) { \
115         printf( msg ); printf("\n"); \
116         }
117         #else
118        #define DEBUG_MSG( msg ) {}
119 #endif
120
121 #define UNUSED_ARG(a) do {/* null */} while (&a == 0)
122
123 #endif /*SUPERTUX_DEFINES_H*/
124