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)
|
||||
Reference in New Issue
Block a user