Kram auch eingecheckt.
[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 <badge/util/fixed_point.h>
10 #include <badge/util/rectangle.h>
11 #include <badge/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 uint8_t status;
32
33 uint8_t tick_minor;
34 uint8_t anim_frame;
35 uint8_t anim_direction;
36
37 int left;
38
39 bool touching_ground;
40 uint8_t jumpable_frames;
41
42 size_t spawned_enemies_counter;
43 size_t spawned_enemies[JUMPNRUN_MAX_SPAWNED_ENEMIES];
44 } jumpnrun_game_state;
45
46 rectangle hacker_rect_current(jumpnrun_game_state const *state);
47
48
49 void jumpnrun_passive_movement(vec2d *inertia);
50
51 uint8_t jumpnrun_play(char const *lvname);
52
53 #endif
This page took 0.047524 seconds and 5 git commands to generate.