1 #ifndef INCLUDED_BADGE_JUMPNRUN_GAME_STATE_H
2 #define INCLUDED_BADGE_JUMPNRUN_GAME_STATE_H
7 #include "../ui/display.h"
10 JUMPNRUN_MAX_SHOTS
= 2,
12 JUMPNRUN_STATE_WON
= 1,
13 JUMPNRUN_STATE_TICKS_PER_FRAME
= 3
16 typedef struct jumpnrun_game_state
{
17 jumpnrun_player player
;
21 jumpnrun_shot shots
[JUMPNRUN_MAX_SHOTS
];
22 } jumpnrun_game_state
;
24 static inline int jumpnrun_screen_left (jumpnrun_game_state
const *state
) { return state
->screen_left
; }
25 static inline int jumpnrun_screen_right(jumpnrun_game_state
const *state
) { return jumpnrun_screen_left(state
) + BADGE_DISPLAY_WIDTH
; }
27 void jumpnrun_game_state_init (jumpnrun_game_state
*state
, jumpnrun_level
const *lv
);
28 void jumpnrun_game_state_respawn(jumpnrun_game_state
*state
, jumpnrun_level
const *lv
);
30 void jumpnrun_shot_spawn(jumpnrun_shot
*shot
, jumpnrun_game_state
const *state
);