Browse Source

Merge pull request #984 from TwistedTwigleg/your_first_game_enhancements

Changed a few things in your_first_game
Chris Bradfield 7 years ago
parent
commit
86d8bbe6cf
1 changed files with 11 additions and 1 deletions
  1. 11 1
      learning/step_by_step/your_first_game.rst

+ 11 - 1
learning/step_by_step/your_first_game.rst

@@ -79,7 +79,7 @@ are not selectable."
 
 
 .. image:: img/lock_children.png
 .. image:: img/lock_children.png
 
 
-Save the scene (click Scene -> Save, or press ``Meta-s``).
+Save the scene (click Scene -> Save, or press ``Control+S`` on Windows/Linux or ``Command+S`` on Mac).
 
 
 .. note:: In this project, we will be following the Godot Engine naming
 .. note:: In this project, we will be following the Godot Engine naming
           conventions. Classes (Nodes) use ``CapWords``, variables and
           conventions. Classes (Nodes) use ``CapWords``, variables and
@@ -225,6 +225,12 @@ more fast diagonal movement.
 We also check whether the player is moving so we can start or stop the
 We also check whether the player is moving so we can start or stop the
 AnimatedSprite animation.
 AnimatedSprite animation.
 
 
+.. tip:: ``$`` returns the node at the relative path from this node, or returns ``null`` if the node is not found.
+         Since AnimatedSprite is a child of the current node, we can just use ``$AnimatedSprite``.
+         
+         ``$`` is the short hand for ``get_node()``.
+         So in the code above, ``$AnimatedSprite.play()`` is the same as ``get_node("AnimatedSprite").play()``.
+
 Now that we have a movement direction, we can update the player's position
 Now that we have a movement direction, we can update the player's position
 and use ``clamp()`` to prevent it from leaving the screen:
 and use ``clamp()`` to prevent it from leaving the screen:
 
 
@@ -240,6 +246,10 @@ and use ``clamp()`` to prevent it from leaving the screen:
 Click "Play the Edited Scene. (F6)" and confirm you can move the player
 Click "Play the Edited Scene. (F6)" and confirm you can move the player
 around the screen in all directions.
 around the screen in all directions.
 
 
+.. warning:: If you get an error in the "Debugger" panel that refers to a "null instance",
+             this likely means you spelled the node name wrong. Node names are case sensitive
+             and ``$NodeName`` or ``get_node("NodeName")`` must match the name you see in the scene tree.
+
 Choosing Animations
 Choosing Animations
 ~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~