Browse Source

Use new API for 4.0

shane pope 2 years ago
parent
commit
1981fd404f
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

@@ -117,8 +117,8 @@ and randomly choose one of the three animation types:
     public override void _Ready()
     {
         var animSprite2D = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
-        animSprite2D.Playing = true;
-        string[] mobTypes = animSprite2D.Frames.GetAnimationNames();
+        animSprite2D.Play();
+        string[] mobTypes = animSprite2D.SpriteFrames.GetAnimationNames();
         animSprite2D.Animation = mobTypes[GD.Randi() % mobTypes.Length];
     }