Mob.gd 258 B

12345678910
  1. extends RigidBody2D
  2. func _ready():
  3. $AnimatedSprite2D.play()
  4. var mob_types = Array($AnimatedSprite2D.sprite_frames.get_animation_names())
  5. $AnimatedSprite2D.animation = mob_types.pick_random()
  6. func _on_VisibilityNotifier2D_screen_exited():
  7. queue_free()