1 #ifndef INCLUDED_BADGE_JUMPNRUN_PLAYER_H
2 #define INCLUDED_BADGE_JUMPNRUN_PLAYER_H
5 #include "../ui/display.h"
6 #include "../util/util.h"
9 // Do not collide with JUMPNRUN_MOVEABLE_* flags
10 JUMPNRUN_PLAYER_DEAD
= 128
14 JUMPNRUN_PLAYER_TICKS_PER_FRAME
= 6,
15 JUMPNRUN_PLAYER_FRAMES
= 4
18 typedef struct jumpnrun_player
{
19 jumpnrun_moveable base
;
25 void jumpnrun_player_spawn (jumpnrun_player
*self
, vec2d spawn_pos
, uint8_t lives
);
26 void jumpnrun_player_respawn(jumpnrun_player
*self
, vec2d spawn_pos
);
27 void jumpnrun_player_kill (jumpnrun_player
*self
);
28 void jumpnrun_player_despawn(jumpnrun_player
*self
);
30 void jumpnrun_player_advance_animation(jumpnrun_player
*self
);
32 static inline bool jumpnrun_player_alive(jumpnrun_player
const *self
) {
33 return (self
->base
.flags
& (JUMPNRUN_PLAYER_DEAD
| JUMPNRUN_MOVEABLE_DYING
)) == 0;