Schrift fest in Firmware eingebacken, damit die auch funktioniert, wenn auf dem
[hackover2013-badge-firmware.git] / badge / jumpnrun / shots.h
1 #ifndef INCLUDED_BADGE_JUMPNRUN_SHOTS_H
2 #define INCLUDED_BADGE_JUMPNRUN_SHOTS_H
3
4 #include "../ui/display.h"
5 #include "../util/util.h"
6 #include <stdbool.h>
7 #include <stdint.h>
8
9 typedef struct jumpnrun_shot {
10 rectangle old_box;
11 rectangle current_box;
12 vec2d inertia;
13 uint8_t tick;
14 } jumpnrun_shot;
15
16 enum {
17 JUMPNRUN_SHOT_EXTENT = 3,
18 JUMPNRUN_SHOT_TICKS_PER_FRAME = 36,
19 JUMPNRUN_SHOT_FRAMES = 2
20 };
21
22 static inline bool jumpnrun_shot_spawned(jumpnrun_shot const *shot) { return fixed_point_ne(shot->inertia.x, FIXED_INT(0)); }
23 static inline void jumpnrun_shot_despawn(jumpnrun_shot *shot) { shot->inertia.x = FIXED_INT(0); }
24
25 void jumpnrun_shot_process(jumpnrun_shot *shot);
26
27 #endif
This page took 0.045431 seconds and 5 git commands to generate.