Sprunghöhenfoo.
[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 "../util/fixed_point.h"
10 #include "../util/rectangle.h"
11 #include "../ui/sprite.h"
12
13 #include <stdbool.h>
14 #include <stddef.h>
15
16 enum {
17 JUMPNRUN_PLAYING,
18 JUMPNRUN_DEAD,
19 JUMPNRUN_WON,
20 JUMPNRUN_ERROR
21 };
22
23 enum {
24 JUMPNRUN_MAX_SPAWN_MARGIN = BADGE_SPRITE_MAX_WIDTH + 1,
25 JUMPNRUN_MAX_SPAWNED_ENEMIES = 10
26 };
27
28 typedef struct jumpnrun_game_state {
29 vec2d current_pos;
30 vec2d inertia;
31 vec2d inertia_mod;
32 uint8_t status;
33
34 uint8_t tick_minor;
35 uint8_t anim_frame;
36 uint8_t anim_direction;
37
38 int left;
39
40 bool touching_ground;
41 uint8_t jumpable_frames;
42
43 size_t spawned_enemies_counter;
44 size_t spawned_enemies[JUMPNRUN_MAX_SPAWNED_ENEMIES];
45 } jumpnrun_game_state;
46
47 rectangle hacker_rect_current(jumpnrun_game_state const *state);
48
49 void jumpnrun_passive_movement(vec2d *inertia);
50
51 uint8_t jumpnrun_play(char const *lvname);
52
53 #endif
This page took 0.050096 seconds and 5 git commands to generate.