add enemy death animation
This commit is contained in:
11
scripts/hit_box.gd
Normal file
11
scripts/hit_box.gd
Normal 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
1
scripts/hit_box.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bdxihdbuhwdbr
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user