소스 검색

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 년 전
부모
커밋
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;