Spiel beendbar gemacht.
[hackover2013-badge-firmware.git] / badge / jumpnrun / moveable.h
index 7b680d2..786b5df 100644 (file)
@@ -7,7 +7,13 @@
 enum {
   // Do not collide with JUMPNRUN_ENEMY_* and JUMPNRUN_PLAYER_* flags.
   JUMPNRUN_MOVEABLE_TOUCHING_GROUND = 1,
-  JUMPNRUN_MOVEABLE_MIRRORED        = 2
+  JUMPNRUN_MOVEABLE_MIRRORED        = 2,
+  JUMPNRUN_MOVEABLE_DYING           = 4
+};
+
+enum {
+  JUMPNRUN_SPLOSION_FRAMES          =  4,
+  JUMPNRUN_SPLOSION_TICKS_PER_FRAME = 15
 };
 
 typedef struct jumpnrun_moveable {
@@ -23,5 +29,8 @@ typedef struct jumpnrun_moveable {
 
 static inline bool jumpnrun_moveable_touching_ground(jumpnrun_moveable const *self) { return self->flags & JUMPNRUN_MOVEABLE_TOUCHING_GROUND; }
 static inline bool jumpnrun_moveable_mirrored       (jumpnrun_moveable const *self) { return self->flags & JUMPNRUN_MOVEABLE_MIRRORED       ; }
+static inline bool jumpnrun_moveable_dying          (jumpnrun_moveable const *self) { return self->flags & JUMPNRUN_MOVEABLE_DYING          ; }
+
+static inline bool jumpnrun_moveable_finished_dying (jumpnrun_moveable const *self) { return jumpnrun_moveable_dying(self) && self->tick_minor >= JUMPNRUN_SPLOSION_FRAMES * JUMPNRUN_SPLOSION_TICKS_PER_FRAME; }
 
 #endif
This page took 0.036683 seconds and 4 git commands to generate.