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 TUX_INVINCIBLE_TIME_WARNING 2000
37 #define TIME_WARNING 20000 /* When to alert player they're low on time! */
41 #define DISTROS_LIFEUP 100
46 #define SCORE_DISTRO 25
62 extern PlayerKeymap keymap;
64 struct player_input_type
75 void player_input_init(player_input_type* pplayer_input);
79 extern Surface* tux_life;
81 extern Sprite* smalltux_gameover;
82 extern Sprite* smalltux_star;
83 extern Sprite* largetux_star;
103 extern PlayerSprite smalltux;
104 extern PlayerSprite largetux;
105 extern PlayerSprite firetux;
107 class Player : public GameObject
110 enum HurtMode { KILL, SHRINK };
112 player_input_type input;
116 bool holding_something;
126 base_type previous_base;
127 Timer invincible_timer;
128 Timer skidding_timer;
136 int key_event(SDLKey key, int state);
138 void action(double frame_ratio);
142 void collision(void* p_c_object, int c_object);
143 void kill(HurtMode mode);
146 void player_remove_powerups();
152 std::string type() { return "Player";};
155 void handle_horizontal_input();
156 void handle_vertical_input();
157 void remove_powerups();
160 #endif /*SUPERTUX_PLAYER_H*/
162 /* Local Variables: */