Browse Source

Update 04.creating_the_enemy.rst

shane pope 2 years ago
parent
commit
39ff799608
1 changed files with 2 additions and 2 deletions
  1. 2 2
      getting_started/first_2d_game/04.creating_the_enemy.rst

+ 2 - 2
getting_started/first_2d_game/04.creating_the_enemy.rst

@@ -108,8 +108,8 @@ and randomly choose one of the three animation types:
  .. code-tab:: gdscript GDScript
  .. code-tab:: gdscript GDScript
 
 
     func _ready():
     func _ready():
-        $AnimatedSprite2D.playing = true
-        var mob_types = $AnimatedSprite2D.frames.get_animation_names()
+        $AnimatedSprite2D.play()
+        var mob_types = $AnimatedSprite2D.get_sprite_frames().get_animation_names()
         $AnimatedSprite2D.animation = mob_types[randi() % mob_types.size()]
         $AnimatedSprite2D.animation = mob_types[randi() % mob_types.size()]
 
 
  .. code-tab:: csharp
  .. code-tab:: csharp