Browse Source

Update tutorial to reflect PathFollow2D changes

Chris Bradfield 7 years ago
parent
commit
e3d4b3b7a1
1 changed files with 3 additions and 2 deletions
  1. 3 2
      learning/step_by_step/your_first_game.rst

+ 3 - 2
learning/step_by_step/your_first_game.rst

@@ -551,8 +551,9 @@ Note that a new instance must be added to the scene using
         # create a Mob instance and add it to the scene
         var mob = Mob.instance()
         add_child(mob)
-        # choose a direction and position
-        var direction = $MobPath/MobSpawnLocation.rotation
+        # set the mob's direction perpendicular to the path direction
+        var direction = $MobPath/MobSpawnLocation.rotation + PI/2
+        # set the mob's position to the random location
         mob.position = $MobPath/MobSpawnLocation.position
         # add some randomness to the direction
         direction += rand_range(-PI/4, PI/4)