game: add enemy on-hit animation

This commit is contained in:
2025-08-19 19:43:38 +02:00
parent 5207f2a26c
commit 5e16c877d1
2 changed files with 32 additions and 2 deletions

View File

@@ -42,6 +42,7 @@ func take_damage(value: float, is_crit: bool = false):
var dm = preload("res://scenes/damage_numbers.tscn").instantiate()
dm.damage_taken = value
dm.critical_damage = is_crit
animation_player.play("take_damage")
add_child(dm)
if health <= 0:
die()