X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/987c3c8b0cac8854e8802dfbd8e7192739e51b57..e89a0502f47865e816e0ba85b86b1377bc352915:/badge/jumpnrun/jumpnrun.h diff --git a/badge/jumpnrun/jumpnrun.h b/badge/jumpnrun/jumpnrun.h index 899eebc..7890889 100644 --- a/badge/jumpnrun/jumpnrun.h +++ b/badge/jumpnrun/jumpnrun.h @@ -4,6 +4,7 @@ #include "enemies.h" #include "items.h" #include "levels.h" +#include "shots.h" #include "tiles.h" #include "../ui/sprite.h" @@ -14,8 +15,8 @@ enum { JUMPNRUN_PLAYING, - JUMPNRUN_DEAD, JUMPNRUN_WON, + JUMPNRUN_LOST, JUMPNRUN_ERROR }; @@ -24,34 +25,12 @@ enum { JUMPNRUN_MAX_SPAWNED_ENEMIES = 10 }; -typedef struct jumpnrun_shot { - rectangle old_box; - 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)); } -static inline void jumpnrun_shot_despawn(jumpnrun_shot *shot) { shot->inertia.x = FIXED_INT(0); } - -enum { - JUMPNRUN_MAX_SHOTS = 2 -}; - -typedef struct jumpnrun_game_state { - jumpnrun_moveable player; - - uint8_t status; - int left; - uint8_t lives; - uint8_t keys; - - jumpnrun_shot shots[JUMPNRUN_MAX_SHOTS]; -} jumpnrun_game_state; - -vec2d hacker_extents(void); +vec2d jumpnrun_player_extents(void); +void jumpnrun_apply_gravity(vec2d *inertia); void jumpnrun_passive_movement(vec2d *inertia); +badge_sprite const *jumpnrun_hacker_symbol(void); -uint8_t jumpnrun_play(char const *lvname); +uint8_t jumpnrun_play_level(char const *lvname); +void jumpnrun_play(void); #endif