Sprites in Repo geworfen (damit nichts verlorengeht)
[hackover2013-badge-firmware.git] / badge / jumpnrun / items.h
1 #ifndef INCLUDED_JUMPNRUN_ITEMS_H
2 #define INCLUDED_JUMPNRUN_ITEMS_H
3
4 #include "../ui/sprite.h"
5 #include "../util/rectangle.h"
6
7 struct jumpnrun_game_state;
8
9 typedef struct jumpnrun_item_type {
10 badge_sprite sprite;
11 void (*on_collect)(struct jumpnrun_game_state *state);
12 } jumpnrun_item_type;
13
14 typedef struct jumpnrun_item {
15 vec2d pos;
16 jumpnrun_item_type const *type;
17 } jumpnrun_item;
18
19 static inline rectangle rect_from_item(jumpnrun_item const *item) {
20 rectangle r = { item->pos, { FIXED_POINT(item->type->sprite.width, 0), FIXED_POINT(item->type->sprite.height, 0) } };
21 return r;
22 }
23
24 /************************************/
25
26 enum {
27 JUMPNRUN_ITEM_TYPE_DOCUMENT,
28
29 JUMPNRUN_ITEM_TYPE_COUNT
30 };
31
32 extern jumpnrun_item_type const jumpnrun_item_type_data[JUMPNRUN_ITEM_TYPE_COUNT];
33
34 #endif
This page took 0.058367 seconds and 5 git commands to generate.