3 // SuperTux - A Jump'n Run
4 // Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef SUPERTUX_PLAYER_H
21 #define SUPERTUX_PLAYER_H
28 #include "collision.h"
34 #define TUX_SAFE_TIME 750
35 #define TUX_INVINCIBLE_TIME 10000
36 #define TIME_WARNING 20000 /* When to alert player they're low on time! */
40 #define DISTROS_LIFEUP 100
45 #define SCORE_DISTRO 25
61 extern PlayerKeymap keymap;
63 struct player_input_type
73 void player_input_init(player_input_type* pplayer_input);
77 extern Surface* tux_life;
78 extern std::vector<Surface*> tux_right;
79 extern std::vector<Surface*> tux_left;
80 extern Surface* smalltux_jump_left;
81 extern Surface* smalltux_jump_right;
82 extern Surface* smalltux_stand_left;
83 extern Surface* smalltux_stand_right;
84 extern Sprite* smalltux_skid_left;
85 extern Sprite* smalltux_skid_right;
86 extern Sprite* smalltux_gameover;
87 extern Sprite* largetux_stand_left;
88 extern Sprite* largetux_stand_right;
90 extern Sprite* smalltux_kick_left;
91 extern Sprite* smalltux_kick_right;
92 extern Sprite* smalltux_grab_left;
93 extern Sprite* smalltux_grab_right;
95 extern Sprite* largetux_kick_left;
96 extern Sprite* largetux_kick_right;
97 extern Sprite* largetux_grab_left;
98 extern Sprite* largetux_grab_right;
100 extern Sprite* bigtux_right;
101 extern Sprite* bigtux_left;
102 extern Sprite* bigtux_right_jump;
103 extern Sprite* bigtux_left_jump;
104 extern Sprite* ducktux_right;
105 extern Sprite* ducktux_left;
106 extern Surface* skidtux_right;
107 extern Surface* skidtux_left;
108 extern Surface* firetux_right[3];
109 extern Surface* firetux_left[3];
110 extern Surface* bigfiretux_right[3];
111 extern Surface* bigfiretux_left[3];
112 extern Surface* bigfiretux_right_jump;
113 extern Surface* bigfiretux_left_jump;
114 extern Surface* duckfiretux_right;
115 extern Surface* duckfiretux_left;
116 extern Surface* skidfiretux_right;
117 extern Surface* skidfiretux_left;
118 extern Surface* cape_right[2];
119 extern Surface* cape_left[2];
120 extern Surface* bigcape_right[2];
121 extern Surface* bigcape_left[2];
126 enum HurtMode { KILL, SHRINK };
128 player_input_type input;
132 bool holding_something;
143 base_type previous_base;
144 Timer invincible_timer;
145 Timer skidding_timer;
152 int key_event(SDLKey key, int state);
154 void action(double frame_ratio);
158 void collision(void* p_c_object, int c_object);
159 void kill(HurtMode mode);
162 void player_remove_powerups();
163 void keep_in_bounds();
168 void handle_horizontal_input();
169 void handle_vertical_input();
170 void remove_powerups();
173 #endif /*SUPERTUX_PLAYER_H*/
175 /* Local Variables: */