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
42 struct player_keymap_type
51 struct player_input_type
61 void player_input_init(player_input_type* pplayer_input);
63 extern Surface* tux_life;
64 extern std::vector<Surface*> tux_right;
65 extern std::vector<Surface*> tux_left;
66 extern Surface* smalltux_jump_left;
67 extern Surface* smalltux_jump_right;
68 extern Surface* smalltux_stand_left;
69 extern Surface* smalltux_stand_right;
70 extern Surface* bigtux_right[3];
71 extern Surface* bigtux_left[3];
72 extern Surface* bigtux_right_jump;
73 extern Surface* bigtux_left_jump;
74 extern Surface* ducktux_right;
75 extern Surface* ducktux_left;
76 extern Surface* skidtux_right;
77 extern Surface* skidtux_left;
78 extern Surface* firetux_right[3];
79 extern Surface* firetux_left[3];
80 extern Surface* bigfiretux_right[3];
81 extern Surface* bigfiretux_left[3];
82 extern Surface* bigfiretux_right_jump;
83 extern Surface* bigfiretux_left_jump;
84 extern Surface* duckfiretux_right;
85 extern Surface* duckfiretux_left;
86 extern Surface* skidfiretux_right;
87 extern Surface* skidfiretux_left;
88 extern Surface* cape_right[2];
89 extern Surface* cape_left[2];
90 extern Surface* bigcape_right[2];
91 extern Surface* bigcape_left[2];
96 player_keymap_type keymap;
101 player_input_type input;
113 base_type previous_base;
114 Timer invincible_timer;
115 Timer skidding_timer;
122 int key_event(SDLKey key, int state);
124 void action(double frame_ratio);
128 void collision(void* p_c_object, int c_object);
132 void player_remove_powerups();
133 void keep_in_bounds();
138 void handle_horizontal_input();
139 void handle_vertical_input();
140 void remove_powerups();
143 #endif /*SUPERTUX_PLAYER_H*/