1 #ifndef INCLUDED_BADGE2013_JUMPNRUN_H
2 #define INCLUDED_BADGE2013_JUMPNRUN_H
9 #include "../ui/sprite.h"
10 #include "../util/util.h"
23 JUMPNRUN_MAX_SPAWN_MARGIN
= BADGE_SPRITE_MAX_WIDTH
+ 1,
24 JUMPNRUN_MAX_SPAWNED_ENEMIES
= 10
27 typedef struct jumpnrun_shot
{
29 rectangle current_box
;
34 static inline bool jumpnrun_shot_spawned(jumpnrun_shot
const *shot
) { return fixed_point_ne(shot
->inertia
.x
, FIXED_INT(0)); }
35 static inline void jumpnrun_shot_despawn(jumpnrun_shot
*shot
) { shot
->inertia
.x
= FIXED_INT(0); }
38 JUMPNRUN_MAX_SHOTS
= 2
41 typedef struct jumpnrun_game_state
{
42 jumpnrun_moveable player
;
47 jumpnrun_shot shots
[JUMPNRUN_MAX_SHOTS
];
48 } jumpnrun_game_state
;
50 rectangle
hacker_rect_current(jumpnrun_game_state
const *state
);
52 void jumpnrun_passive_movement(vec2d
*inertia
);
54 uint8_t jumpnrun_play(char const *lvname
);