2 // Interface: player/tux
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2003
9 // Copyright: See COPYING file that comes with this distribution
13 #ifndef SUPERTUX_PLAYER_H
14 #define SUPERTUX_PLAYER_H
21 #include "collision.h"
27 #define TUX_SAFE_TIME 750
28 #define TUX_INVINCIBLE_TIME 10000
29 #define TIME_WARNING 20000 /* When to alert player they're low on time! */
33 #define DISTROS_LIFEUP 100
38 #define SCORE_DISTRO 25
40 struct player_keymap_type
49 struct player_input_type
59 void player_input_init(player_input_type* pplayer_input);
61 typedef struct player_type
63 player_input_type input;
64 player_keymap_type keymap;
78 base_type previous_base;
79 timer_type invincible_timer;
80 timer_type skidding_timer;
81 timer_type safe_timer;
82 timer_type frame_timer;
88 extern texture_type tux_life,
89 tux_right[3], tux_left[3],
90 bigtux_right[3], bigtux_left[3],
91 bigtux_right_jump, bigtux_left_jump,
92 ducktux_right, ducktux_left,
93 skidtux_right, skidtux_left,
94 firetux_right[3], firetux_left[3],
95 bigfiretux_right[3], bigfiretux_left[3],
96 bigfiretux_right_jump, bigfiretux_left_jump,
97 duckfiretux_right, duckfiretux_left,
98 skidfiretux_right, skidfiretux_left,
99 cape_right[2], cape_left[2],
100 bigcape_right[2], bigcape_left[2];
102 void player_init(player_type* pplayer);
103 int player_key_event(player_type* pplayer, SDLKey key, int state);
104 void player_level_begin(player_type* pplayer);
105 void player_action(player_type* pplayer);
106 void player_input(player_type* pplayer);
107 void player_grabdistros(player_type *pplayer);
108 void player_draw(player_type* pplayer);
109 void player_collision(player_type* pplayer,void* p_c_object, int c_object);
110 void player_kill(player_type *pplayer, int mode);
111 void player_dying(player_type *pplayer);
112 void player_remove_powerups(player_type *pplayer);
113 void player_keep_in_bounds(player_type *pplayer);
114 bool player_on_ground(player_type *pplayer);
115 bool player_under_solid(player_type *pplayer);
117 #endif /*SUPERTUX_PLAYER_H*/