Files
godot-demo-projects/2d/dodge_the_creeps/mob.gd
Russell Sanborn 7d42ae3c9a Rename Dodge The Creeps files to snake case (#1084)
This follows the style guide:

- https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html#style-guide

For reference, a documentation PR exists to update references to the
demo.
2024-07-15 00:36:11 +02:00

11 lines
258 B
GDScript

extends RigidBody2D
func _ready():
$AnimatedSprite2D.play()
var mob_types = Array($AnimatedSprite2D.sprite_frames.get_animation_names())
$AnimatedSprite2D.animation = mob_types.pick_random()
func _on_VisibilityNotifier2D_screen_exited():
queue_free()