Files
godot-demo-projects/2d/dodge_the_creeps/Mob.gd
2021-07-11 13:08:01 -04:00

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()