fix: move get_damage logic from player to the enemy;
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user