Files
godot-docs-l10n/sphinx/templates/getting_started/first_3d_game/04.mob_scene.pot
2022-09-09 16:05:06 +02:00

265 lines
12 KiB
Plaintext

# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2014-2022, 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 3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-09-09 16:03+0200\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_3d_game/04.mob_scene.rst:4
msgid "Designing the mob scene"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:6
msgid "In this part, you're going to code the monsters, which we'll call mobs. In the next lesson, we'll spawn them randomly around the playable area."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:9
msgid "Let's design the monsters themselves in a new scene. The node structure is going to be similar to the *Player* scene."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:12
msgid "Create a scene with, once again, a *KinematicBody* node as its root. Name it *Mob*. Add a *Spatial* node as a child of it, name it *Pivot*. And drag and drop the file ``mob.glb`` from the *FileSystem* dock onto the *Pivot* to add the monster's 3D model to the scene. You can rename the newly created *mob* node into *Character*."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:18
msgid "|image0|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:325
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:325
msgid "image0"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:20
msgid "We need a collision shape for our body to work. Right-click on the *Mob* node, the scene's root, and click *Add Child Node*."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:23
msgid "|image1|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:326
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:326
msgid "image1"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:25
msgid "Add a *CollisionShape*."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:27
msgid "|image2|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:327
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:327
msgid "image2"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:29
msgid "In the *Inspector*, assign a *BoxShape* to the *Shape* property."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:31
msgid "|image3|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:328
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:328
msgid "image3"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:33
msgid "We should change its size to fit the 3D model better. You can do so interactively by clicking and dragging on the orange dots."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:36
msgid "The box should touch the floor and be a little thinner than the model. Physics engines work in such a way that if the player's sphere touches even the box's corner, a collision will occur. If the box is a little too big compared to the 3D model, you may die at a distance from the monster, and the game will feel unfair to the players."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:42
msgid "|image4|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:329
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:329
msgid "image4"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:44
msgid "Notice that my box is taller than the monster. It is okay in this game because we're looking at the scene from above and using a fixed perspective. Collision shapes don't have to match the model exactly. It's the way the game feels when you test it that should dictate their form and size."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:50
msgid "Removing monsters off-screen"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:52
msgid "We're going to spawn monsters at regular time intervals in the game level. If we're not careful, their count could increase to infinity, and we don't want that. Each mob instance has both a memory and a processing cost, and we don't want to pay for it when the mob's outside the screen."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:57
msgid "Once a monster leaves the screen, we don't need it anymore, so we can delete it. Godot has a node that detects when objects leave the screen, *VisibilityNotifier*, and we're going to use it to destroy our mobs."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:63
msgid "When you keep instancing an object in games, there's a technique you can use to avoid the cost of creating and destroying instances all the time called pooling. It consists of pre-creating an array of objects and reusing them over and over."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:68
msgid "When working with GDScript, you don't need to worry about this. The main reason to use pools is to avoid freezes with garbage-collected languages like C# or Lua. GDScript uses a different technique to manage memory, reference counting, which doesn't have that caveat. You can learn more about that here :ref:`doc_gdscript_basics_memory_management`."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:74
msgid "Select the *Mob* node and add a *VisibilityNotifier* as a child of it. Another box, pink this time, appears. When this box completely leaves the screen, the node will emit a signal."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:78
msgid "|image5|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:330
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:330
msgid "image5"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:80
msgid "Resize it using the orange dots until it covers the entire 3D model."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:82
msgid "|image6|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:331
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:331
msgid "image6"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:85
msgid "Coding the mob's movement"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:87
msgid "Let's implement the monster's motion. We're going to do this in two steps. First, we'll write a script on the *Mob* that defines a function to initialize the monster. We'll then code the randomized spawn mechanism in the *Main* scene and call the function from there."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:92
msgid "Attach a script to the *Mob*."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:94
msgid "|image7|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:332
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:332
msgid "image7"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:96
msgid "Here's the movement code to start with. We define two properties, ``min_speed`` and ``max_speed``, to define a random speed range. We then define and initialize the ``velocity``."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:137
msgid "Similarly to the player, we move the mob every frame by calling ``KinematicBody``\\ 's ``move_and_slide()`` method. This time, we don't update the ``velocity`` every frame: we want the monster to move at a constant speed and leave the screen, even if it were to hit an obstacle."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:142
msgid "You may see a warning in GDScript that the return value from ``move_and_slide()`` is unused. This is expected. You can simply ignore the warning or, if you want to hide it entirely, add the comment ``# warning-ignore:return_value_discarded`` just above the ``move_and_slide(velocity)`` line. To read more about the GDScript warning system, see :ref:`doc_gdscript_warning_system`."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:149
msgid "We need to define another function to calculate the start velocity. This function will turn the monster towards the player and randomize both its angle of motion and its velocity."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:153
msgid "The function will take a ``start_position``, the mob's spawn position, and the ``player_position`` as its arguments."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:156
msgid "We position the mob at ``start_position`` and turn it towards the player using the ``look_at_from_position()`` method, and randomize the angle by rotating a random amount around the Y axis. Below, ``rand_range()`` outputs a random value between ``-PI / 4`` radians and ``PI / 4`` radians."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:182
msgid "We then calculate a random speed using ``rand_range()`` once again and we use it to calculate the velocity."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:185
msgid "We start by creating a 3D vector pointing forward, multiply it by our ``random_speed``, and finally rotate it using the ``Vector3`` class's ``rotated()`` method."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:217
msgid "Leaving the screen"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:219
msgid "We still have to destroy the mobs when they leave the screen. To do so, we'll connect our *VisibilityNotifier* node's ``screen_exited`` signal to the *Mob*."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:222
msgid "Head back to the 3D viewport by clicking on the *3D* label at the top of the editor. You can also press :kbd:`Ctrl + F2` (:kbd:`Alt + 2` on macOS)."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:225
msgid "|image8|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:333
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:333
msgid "image8"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:227
msgid "Select the *VisibilityNotifier* node and on the right side of the interface, navigate to the *Node* dock. Double-click the *screen_exited()* signal."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:230
msgid "|image9|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:334
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:334
msgid "image9"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:232
msgid "Connect the signal to the *Mob*."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:234
msgid "|image10|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:335
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:335
msgid "image10"
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:236
msgid "This will take you back to the script editor and add a new function for you, ``_on_VisibilityNotifier_screen_exited()``. From it, call the ``queue_free()`` method. This will destroy the mob instance when the *VisibilityNotifier* \\'s box leaves the screen."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:256
msgid "Our monster is ready to enter the game! In the next part, you will spawn monsters in the game level."
msgstr ""
#: ../../docs/getting_started/first_3d_game/04.mob_scene.rst:259
msgid "Here is the complete ``Mob.gd`` script for reference."
msgstr ""
#: ../../docs/<rst_epilog>:0
msgid "Translation status"
msgstr ""