Textdateiankuckdingviech.
[hackover2013-badge-firmware.git] / badge / jumpnrun / game_state.h
1 #ifndef INCLUDED_BADGE_JUMPNRUN_GAME_STATE_H
2 #define INCLUDED_BADGE_JUMPNRUN_GAME_STATE_H
3
4 #include "player.h"
5 #include "levels.h"
6 #include "shots.h"
7 #include "../ui/display.h"
8
9 enum {
10 JUMPNRUN_MAX_SHOTS = 2,
11
12 JUMPNRUN_STATE_WON = 1,
13 JUMPNRUN_STATE_TICKS_PER_FRAME = 3
14 };
15
16 typedef struct jumpnrun_game_state {
17 jumpnrun_player player;
18 int screen_left;
19 uint8_t flags;
20 uint8_t tick;
21 jumpnrun_shot shots[JUMPNRUN_MAX_SHOTS];
22 } jumpnrun_game_state;
23
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; }
26
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);
29
30 void jumpnrun_shot_spawn(jumpnrun_shot *shot, jumpnrun_game_state const *state);
31
32 #endif
This page took 0.047707 seconds and 5 git commands to generate.