Vorarbeit f. Schüsse/Würfe. Animation steht, TODO: Gegner darauf reagieren
[hackover2013-badge-firmware.git] / badge / jumpnrun / jumpnrun.h
index e8c2c05..fc386c7 100644 (file)
@@ -6,9 +6,8 @@
 #include "levels.h"
 #include "tiles.h"
 
-#include "../util/fixed_point.h"
-#include "../util/rectangle.h"
 #include "../ui/sprite.h"
+#include "../util/util.h"
 
 #include <stdbool.h>
 #include <stddef.h>
@@ -25,28 +24,29 @@ enum {
   JUMPNRUN_MAX_SPAWNED_ENEMIES = 10
 };
 
-typedef struct jumpnrun_game_state {
-  vec2d   current_pos;
-  vec2d   inertia;
-  vec2d   inertia_mod;
-  uint8_t status;
+typedef struct jumpnrun_shot {
+  rectangle current_box;
+  vec2d     inertia;
+  uint8_t   tick;
+} jumpnrun_shot;
 
-  uint8_t tick_minor;
-  uint8_t anim_frame;
-  uint8_t anim_direction;
+static inline bool jumpnrun_shot_spawned(jumpnrun_shot const *shot) { return fixed_point_ne(shot->inertia.x, FIXED_INT(0)); }
 
-  int     left;
+enum {
+  JUMPNRUN_MAX_SHOTS = 2
+};
 
-  bool    touching_ground;
-  uint8_t jumpable_frames;
+typedef struct jumpnrun_game_state {
+  jumpnrun_moveable player;
 
-  size_t  spawned_enemies_counter;
-  size_t  spawned_enemies[JUMPNRUN_MAX_SPAWNED_ENEMIES];
+  uint8_t status;
+  int     left;
+
+  jumpnrun_shot shots[JUMPNRUN_MAX_SHOTS];
 } jumpnrun_game_state;
 
 rectangle hacker_rect_current(jumpnrun_game_state const *state);
 
-
 void jumpnrun_passive_movement(vec2d *inertia);
 
 uint8_t jumpnrun_play(char const *lvname);
This page took 0.027001 seconds and 4 git commands to generate.