arrays are dynamic now, fixed bugs, more code cleanups
[supertux.git] / src / player.h
1 //
2 // Interface: player/tux
3 //
4 // Description: 
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2003
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #ifndef SUPERTUX_PLAYER_H
14 #define SUPERTUX_PLAYER_H
15
16 #include <SDL.h>
17 #include "bitmask.h"
18 #include "type.h"
19 #include "timer.h"
20 #include "texture.h"
21 #include "collision.h"
22
23 /* Times: */
24
25 #define TUX_SAFE_TIME 16
26 #define TUX_INVINCIBLE_TIME 10000
27 #define TIME_WARNING 20000     /* When to alert player they're low on time! */
28
29 typedef struct player_input_type
30 {
31  int right;
32  int left;
33  int up;
34  int down;
35  int fire;
36  int old_fire;
37 }
38 player_input_type;
39
40 typedef struct player_type 
41 {
42  player_input_type input;
43  int got_coffee;
44  int size;
45  int skidding;
46  int safe;
47  int duck;
48  int dying;
49  int dir;
50  int jumping;
51  int frame_main;
52  int frame;
53  int lives;
54  base_type base;
55  timer_type invincible_timer;
56  timer_type jump_timer;
57 }
58 player_type;
59
60 texture_type tux_life,
61  tux_right[3],  tux_left[3],
62  bigtux_right[3],  bigtux_left[3],
63  bigtux_right_jump,  bigtux_left_jump,
64  ducktux_right,  ducktux_left,
65  skidtux_right,  skidtux_left,
66  firetux_right[3],  firetux_left[3],
67  bigfiretux_right[3],  bigfiretux_left[3],
68  bigfiretux_right_jump,  bigfiretux_left_jump,
69  duckfiretux_right,  duckfiretux_left,
70  skidfiretux_right,  skidfiretux_left,
71  cape_right[2],  cape_left[2],
72  bigcape_right[2],  bigcape_left[2];
73
74 void player_init(player_type* pplayer);
75 void player_level_begin(player_type* pplayer);
76 void player_action(player_type* pplayer);
77 void player_input(player_type* pplayer);
78 void player_grabdistros(player_type *pplayer);
79 void player_draw(player_type* pplayer);
80 void player_collision(player_type* pplayer,void* p_c_object, int c_object);
81 void player_kill(player_type *pplayer, int mode);
82 void player_dying(player_type *pplayer);
83 void player_remove_powerups(player_type *pplayer);
84 void player_keep_in_bounds(player_type *pplayer);
85
86 #endif /*SUPERTUX_PLAYER_H*/