fix: move get_damage logic from player to the enemy;

This commit is contained in:
2026-09-25 07:51:51 +02:00
parent 3a7f3c7ec3
commit 87fe48ef74
2 changed files with 9 additions and 9 deletions
+8 -1
View File
@@ -31,7 +31,14 @@ func animate_slime():
$AnimatedSprite2D.play("move_up")
func take_damage():
pass
HP -= 1
var flash_red_color: Color = Color(20, 0, 0)
modulate = flash_red_color
await get_tree().create_timer(0.2).timeout
var original_color: Color = Color(1, 1, 1)
modulate = original_color
if (HP <= 0):
queue_free()
func _on_player_detect_area_body_entered(body):
if body is Player: