diff options
-rw-r--r-- | config.h | 1 | ||||
-rw-r--r-- | player.c | 2 | ||||
-rw-r--r-- | world.c | 5 | ||||
-rw-r--r-- | world.h | 2 |
4 files changed, 9 insertions, 1 deletions
@@ -41,6 +41,7 @@ #define player_slash_damage 1 #define player_health 8 #define player_special_hits 4 +#define player_hurt_freeze 4 #define enemy_inv_frames 8 #define enemy_demon_move_force 32 @@ -171,6 +171,8 @@ void update_player_hurt(Player* p, World* w) { p->vx -= dz->vx; p->vy -= dz->vy; p->inv = enemy_inv_frames; + w->freeze = player_hurt_freeze; + return; } } } @@ -6,6 +6,7 @@ void init_world(World* w) { w->enemy_count = 0; w->deathzone_count = 0; w->frame = 0; + w->freeze = 0; init_player(&w->player); } @@ -54,6 +55,10 @@ Deathzone* inst_deathzone( void update_world(World* w, const App* a) { int i; + if (w->freeze) { + w->freeze--; + return; + } for (i = w->deathzone_count - 1; i >= 0; i--) if (update_deathzone(&w->deathzones[i])) w->deathzones[i] = w->deathzones[--w->deathzone_count]; @@ -18,7 +18,7 @@ typedef struct World { int deathzone_count; Player player; Map map; - int frame; + int frame, freeze; } World; void init_world(World* w); |