From 4f70dc1ebdd3a18481223cd318bbfe0d6b97ec9a Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 4 Jan 2025 00:00:02 +0100 Subject: [PATCH] Mention the expected file name for the player scene in Your first 2D game --- .../first_2d_game/02.player_scene.rst | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/getting_started/first_2d_game/02.player_scene.rst b/getting_started/first_2d_game/02.player_scene.rst index 37f4e7d75..eb979810a 100644 --- a/getting_started/first_2d_game/02.player_scene.rst +++ b/getting_started/first_2d_game/02.player_scene.rst @@ -15,20 +15,20 @@ Node structure To begin, we need to choose a root node for the player object. As a general rule, a scene's root node should reflect the object's desired functionality - -what the object *is*. In the upper-left corner, in the "Scene" tab, click the +what the object *is*. In the upper-left corner, in the "Scene" tab, click the "Other Node" button and add an :ref:`Area2D ` node to the scene. .. image:: img/add_node.webp -When you add the ``Area2D`` node, Godot will display the following **warning icon** +When you add the ``Area2D`` node, Godot will display the following **warning icon** next to it in the scene tree: .. image:: img/no_shape_warning.webp -This warning tells us that the ``Area2D`` node requires a shape to detect collisions or overlaps. -We can **ignore the warning temporarily** because we will first set up the player's visuals -(using an animated sprite). Once the visuals are ready, we will add a collision shape as a child -node. This will allow us to accurately size and position the shape based on the sprite’s appearance. +This warning tells us that the ``Area2D`` node requires a shape to detect collisions or overlaps. +We can **ignore the warning temporarily** because we will first set up the player's visuals +(using an animated sprite). Once the visuals are ready, we will add a collision shape as a child +node. This will allow us to accurately size and position the shape based on the sprite's appearance. With ``Area2D`` we can detect objects that overlap or run into the player. @@ -44,8 +44,8 @@ node is clicked in 2D and 3D view." .. image:: img/lock_children.webp -Save the scene. Click Scene -> Save, or press :kbd:`Ctrl + S` on Windows/Linux -or :kbd:`Cmd + S` on macOS. +Save the scene as ``player.tscn``. Click **Scene > Save**, or press :kbd:`Ctrl + S` +on Windows/Linux or :kbd:`Cmd + S` on macOS. .. note:: For this project, we will be following the Godot naming conventions. @@ -68,7 +68,7 @@ Click on the ``Player`` node and add (:kbd:`Ctrl + A` on Windows/Linux or appearance and animations for our player. Notice that there is a warning symbol next to the node. An ``AnimatedSprite2D`` requires a :ref:`SpriteFrames ` resource, which is a list of the animations it can -display. Make sure ``AnimatedSprite2D`` is selected and then find the ``Sprite Frames`` property under +display. Make sure ``AnimatedSprite2D`` is selected and then find the ``Sprite Frames`` property under the ``Animation`` section in the Inspector and click "[empty]" -> "New SpriteFrames": .. image:: img/new_spriteframes.webp @@ -110,7 +110,7 @@ When you're finished, your ``Player`` scene should look like this: .. image:: img/player_scene_nodes.webp -Once this is done, the warning on the ``Area2D`` node will disappear, as it now has +Once this is done, the warning on the ``Area2D`` node will disappear, as it now has a shape assigned and can interact with other objects. Make sure to save the scene again after these changes.