pandemonium_demo_projects/2d/dodge_the_creeps/Mob.gd

11 lines
260 B
GDScript

extends RigidBody2D
func _ready():
$AnimatedSprite.playing = true
var mob_types = $AnimatedSprite.frames.get_animation_names()
$AnimatedSprite.animation = mob_types[randi() % mob_types.size()]
func _on_VisibilityNotifier2D_screen_exited():
queue_free()