Files
godot-docs-l10n/sphinx/templates/getting_started/first_2d_game/02.player_scene.pot
2025-12-19 15:00:42 +01:00

121 lines
7.3 KiB
Plaintext

# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2014-present Juan Linietsky, Ariel Manzur and the Godot community (CC BY 3.0)
# This file is distributed under the same license as the Godot Engine package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine latest\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:4
msgid "Creating the player scene"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:6
msgid "With the project settings in place, we can start working on the player-controlled character."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:9
msgid "The first scene will define the ``Player`` object. One of the benefits of creating a separate Player scene is that we can test it separately, even before we've created other parts of the game."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:14
msgid "Node structure"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:16
msgid "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 \"Other Node\" button and add an :ref:`Area2D <class_Area2D>` node to the scene."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:23
msgid "When you add the ``Area2D`` node, Godot will display the following **warning icon** next to it in the scene tree:"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:28
msgid "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."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:34
msgid "With ``Area2D`` we can detect objects that overlap or run into the player. Change the node's name to ``Player`` by double-clicking on it. Now that we've set the scene's root node, we can add additional nodes to give it more functionality."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:39
msgid "Before we add any children to the ``Player`` node, we want to make sure we don't accidentally move or resize them by clicking on them. Select the node and click the icon to the right of the lock. Its tooltip says \"Groups the selected node with its children. This causes the parent to be selected when any child node is clicked in 2D and 3D view.\""
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:47
msgid "Save the scene as ``player.tscn``. Click **Scene > Save**, or press :kbd:`Ctrl + S` on Windows/Linux or :kbd:`Cmd + S` on macOS."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:50
msgid "For this project, we will be following the Godot naming conventions."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:52
msgid "**GDScript**: Classes (nodes) use PascalCase, variables and functions use snake_case, and constants use ALL_CAPS (See :ref:`doc_gdscript_styleguide`)."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:56
msgid "**C#**: Classes, export variables and methods use PascalCase, private fields use _camelCase, local variables and parameters use camelCase (See :ref:`doc_c_sharp_styleguide`). Be careful to type the method names precisely when connecting signals."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:63
msgid "Sprite animation"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:65
msgid "Click on the ``Player`` node and add (:kbd:`Ctrl + A` on Windows/Linux or :kbd:`Cmd + A` on macOS) a child node :ref:`AnimatedSprite2D <class_AnimatedSprite2D>`. The ``AnimatedSprite2D`` will handle the appearance and animations for our player. Notice that there is a warning symbol next to the node. An ``AnimatedSprite2D`` requires a :ref:`SpriteFrames <class_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 the ``Animation`` section in the Inspector and click \"[empty]\" -> \"New SpriteFrames\":"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:76
msgid "Click on the ``SpriteFrames`` you just created to open the \"SpriteFrames\" panel:"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:80
msgid "On the left is a list of animations. Click the ``default`` one and rename it to ``walk``. Then click the **Add Animation** button to create a second animation named ``up``."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:84
msgid "Find the player images in the FileSystem dock - they're in the ``art`` folder you unzipped earlier. Drag the two images for each animation, into the **Animation Frames** side of the panel for the corresponding animation:"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:88
msgid "``playerGrey_walk1`` and ``playerGrey_walk2`` for the ``walk`` animation"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:89
msgid "``playerGrey_up1`` and ``playerGrey_up2`` for the ``up`` animation"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:93
msgid "The player images are a bit too large for the game window, so we need to scale them down. Click on the ``AnimatedSprite2D`` node and set the ``Scale`` property to ``(0.5, 0.5)``. You can find it in the Inspector under the ``Node2D`` heading."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:100
msgid "Finally, add a :ref:`CollisionShape2D <class_CollisionShape2D>` as a child of ``Player``. This will determine the player's \"hitbox\", or the bounds of its collision area. For this character, a ``CapsuleShape2D`` node gives the best fit, so next to \"Shape\" in the Inspector, click \"[empty]\" -> \"New CapsuleShape2D\". Using the two size handles, resize the shape to cover the sprite:"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:109
msgid "When you're finished, your ``Player`` scene should look like this:"
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:113
msgid "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."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:116
msgid "Make sure to save the scene again after these changes."
msgstr ""
#: ../../docs/getting_started/first_2d_game/02.player_scene.rst:118
msgid "In the next part, we'll add a script to the player node to move and animate it. Then, we'll set up collision detection to know when the player got hit by something."
msgstr ""