add enemy death animation

This commit is contained in:
2025-10-22 12:30:46 +01:00
parent f9a218159c
commit 4338abab62
8 changed files with 240 additions and 42 deletions

11
scripts/hit_box.gd Normal file
View File

@@ -0,0 +1,11 @@
extends Area2D
@export var animation_player: AnimationPlayer
@export var animation_name: String
@export var animated_sprite: AnimatedSprite2D
@export var animated_sprite_name: String
func _on_body_entered(_body: Node2D) -> void:
animated_sprite.play(animated_sprite_name)
animation_player.play(animation_name)

1
scripts/hit_box.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://bdxihdbuhwdbr

View File

@@ -25,7 +25,3 @@ func _physics_process(delta: float) -> void:
position.x += direction * speed * delta
move_and_slide()
func _on_hit_box_killed() -> void:
queue_free()