Просмотр исходного кода

only reset enemy attack

if a player attacks an enemy, the enemy cannot attack immediately back (the attack timer is reset so the cooldown is activated again)
jblanked 1 год назад
Родитель
Сommit
93d5c5a932
1 измененных файлов с 0 добавлено и 1 удалено
  1. 0 1
      game/enemy.c

+ 0 - 1
game/enemy.c

@@ -242,7 +242,6 @@ static void enemy_collision(Entity *self, Entity *other, GameManager *manager, v
 
                 // Reset enemy's elapsed attack timer
                 enemy_context->elapsed_attack_timer = 0.0f;
-                game_context->player_context->elapsed_attack_timer = 0.0f; // Reset player's attack timer to block player attack
 
                 // Decrease player health by enemy strength
                 game_context->player_context->health -= enemy_context->strength;