Vorarbeit f. Schüsse/Würfe. Animation steht, TODO: Gegner darauf reagieren
[hackover2013-badge-firmware.git] / badge / jumpnrun / jumpnrun.h
1 #ifndef INCLUDED_BADGE2013_JUMPNRUN_H
2 #define INCLUDED_BADGE2013_JUMPNRUN_H
3
4 #include "enemies.h"
5 #include "items.h"
6 #include "levels.h"
7 #include "tiles.h"
8
9 #include "../ui/sprite.h"
10 #include "../util/util.h"
11
12 #include <stdbool.h>
13 #include <stddef.h>
14
15 enum {
16 JUMPNRUN_PLAYING,
17 JUMPNRUN_DEAD,
18 JUMPNRUN_WON,
19 JUMPNRUN_ERROR
20 };
21
22 enum {
23 JUMPNRUN_MAX_SPAWN_MARGIN = BADGE_SPRITE_MAX_WIDTH + 1,
24 JUMPNRUN_MAX_SPAWNED_ENEMIES = 10
25 };
26
27 typedef struct jumpnrun_shot {
28 rectangle current_box;
29 vec2d inertia;
30 uint8_t tick;
31 } jumpnrun_shot;
32
33 static inline bool jumpnrun_shot_spawned(jumpnrun_shot const *shot) { return fixed_point_ne(shot->inertia.x, FIXED_INT(0)); }
34
35 enum {
36 JUMPNRUN_MAX_SHOTS = 2
37 };
38
39 typedef struct jumpnrun_game_state {
40 jumpnrun_moveable player;
41
42 uint8_t status;
43 int left;
44
45 jumpnrun_shot shots[JUMPNRUN_MAX_SHOTS];
46 } jumpnrun_game_state;
47
48 rectangle hacker_rect_current(jumpnrun_game_state const *state);
49
50 void jumpnrun_passive_movement(vec2d *inertia);
51
52 uint8_t jumpnrun_play(char const *lvname);
53
54 #endif
This page took 0.045745 seconds and 5 git commands to generate.