TH-Kibidanshaku/entity/mob/mob_enemy.gd
2024-01-03 13:40:31 +09:00

22 lines
570 B
GDScript

extends Area2D
# Called when the node enters the scene tree for the first time.
func _ready():
var mob_types = $AnimatedSprite2D.sprite_frames.get_animation_names()
#$AnimatedSprite2D.play(mob_types[randi() % mob_types.size()])
$AnimatedSprite2D.play("mobA")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_body_entered(body):
$CollisionShape2D.set_deferred("disabled", true)
var playerSprite = $AnimatedSprite2D
playerSprite.play("death")
await playerSprite.animation_finished
queue_free()