Sinnvolleres Spawn- und Bewegungsverhalten.
[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 };
14
15 typedef struct jumpnrun_game_state {
16 jumpnrun_player player;
17 int screen_left;
18 uint8_t flags;
19 jumpnrun_shot shots[JUMPNRUN_MAX_SHOTS];
20 } jumpnrun_game_state;
21
22 static inline int jumpnrun_screen_left (jumpnrun_game_state const *state) { return state->screen_left; }
23 static inline int jumpnrun_screen_right(jumpnrun_game_state const *state) { return jumpnrun_screen_left(state) + BADGE_DISPLAY_WIDTH; }
24
25 void jumpnrun_game_state_init (jumpnrun_game_state *state, jumpnrun_level const *lv);
26 void jumpnrun_game_state_respawn(jumpnrun_game_state *state, jumpnrun_level const *lv);
27
28 void jumpnrun_shot_spawn(jumpnrun_shot *shot, jumpnrun_game_state const *state);
29
30 #endif
This page took 0.054208 seconds and 5 git commands to generate.