X-Git-Url: http://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/51243f56fd37dd5b24cbd15e22c8a48bdc4ee41f..81be30fb6f37d0f9633d5883445f3ebc57989a53:/badge/jumpnrun/jumpnrun.h diff --git a/badge/jumpnrun/jumpnrun.h b/badge/jumpnrun/jumpnrun.h index 0ce9ad6..fc386c7 100644 --- a/badge/jumpnrun/jumpnrun.h +++ b/badge/jumpnrun/jumpnrun.h @@ -24,14 +24,25 @@ enum { JUMPNRUN_MAX_SPAWNED_ENEMIES = 10 }; +typedef struct jumpnrun_shot { + rectangle current_box; + vec2d inertia; + uint8_t tick; +} jumpnrun_shot; + +static inline bool jumpnrun_shot_spawned(jumpnrun_shot const *shot) { return fixed_point_ne(shot->inertia.x, FIXED_INT(0)); } + +enum { + JUMPNRUN_MAX_SHOTS = 2 +}; + typedef struct jumpnrun_game_state { jumpnrun_moveable player; uint8_t status; int left; - size_t spawned_enemies_counter; - size_t spawned_enemies[JUMPNRUN_MAX_SPAWNED_ENEMIES]; + jumpnrun_shot shots[JUMPNRUN_MAX_SHOTS]; } jumpnrun_game_state; rectangle hacker_rect_current(jumpnrun_game_state const *state);