Files
godot-demo-projects/2d/dodge_the_creeps/Mob.gd
2023-01-23 18:24:56 +01:00

12 lines
261 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()