Selaa lähdekoodia

Fix GD.RandRange C# call in the "Your First Game" example (#3923)

Co-authored-by: Hugo Locurcio <[email protected]>
arkadye 5 vuotta sitten
vanhempi
commit
cf563274e4
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      getting_started/step_by_step/your_first_game.rst

+ 2 - 2
getting_started/step_by_step/your_first_game.rst

@@ -897,11 +897,11 @@ Note that a new instance must be added to the scene using ``add_child()``.
         mobInstance.Position = mobSpawnLocation.Position;
         mobInstance.Position = mobSpawnLocation.Position;
 
 
         // Add some randomness to the direction.
         // Add some randomness to the direction.
-        direction += RandRange(-Mathf.Pi / 4, Mathf.Pi / 4);
+        direction += GD.RandRange(-Mathf.Pi / 4, Mathf.Pi / 4);
         mobInstance.Rotation = direction;
         mobInstance.Rotation = direction;
 
 
         // Choose the velocity.
         // Choose the velocity.
-        mobInstance.LinearVelocity = new Vector2(RandRange(150f, 250f), 0).Rotated(direction);
+        mobInstance.LinearVelocity = new Vector2(GD.RandRange(150f, 250f), 0).Rotated(direction);
     }
     }
 
 
 .. important:: Why ``PI``? In functions requiring angles, GDScript uses *radians*,
 .. important:: Why ``PI``? In functions requiring angles, GDScript uses *radians*,