cc296c3e006aa6ae466450bf77669e27d58ad710
[hackover2013-badge-firmware.git] / badge / jumpnrun / items.c
1 #include "items.h"
2 #include "jumpnrun.h"
3
4 static void on_collect_win(jumpnrun_item *self,
5 jumpnrun_game_state *state,
6 jumpnrun_level *lv) {
7 (void) lv;
8 self->flags |= JUMPNRUN_ITEM_COLLECTED;
9 state->status = JUMPNRUN_WON;
10 }
11
12 static void on_collect_checkpoint(jumpnrun_item *self,
13 jumpnrun_game_state *state,
14 jumpnrun_level *lv) {
15 (void) state;
16 self->flags |= JUMPNRUN_ITEM_COLLECTED;
17 lv->start_pos = (vec2d) { self->pos.x,
18 fixed_point_sub(fixed_point_add(self->pos.y, FIXED_INT(self->type->sprite.height)), hacker_extents().y)
19 };
20 }
21
22 jumpnrun_item_type const jumpnrun_item_type_data[JUMPNRUN_ITEM_TYPE_COUNT] = {
23 { { 6, 7, (uint8_t const *) "\x7c\x61\xb5\x1a\xfc\x03" }, on_collect_win },
24 { { 9, 12, (uint8_t const *) "\xff\x1f\x04\x49\x10\x05\x49\x50\x04\x51\x10\x04\x7f" }, on_collect_checkpoint }
25 };
This page took 0.039502 seconds and 3 git commands to generate.