Files
godot-docs-l10n/sphinx/templates/getting_started/first_3d_game/07.killing_player.pot
2025-12-19 15:00:42 +01:00

177 lines
7.7 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_3d_game/07.killing_player.rst:4
msgid "Killing the player"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:6
msgid "We can kill enemies by jumping on them, but the player still can't die. Let's fix this."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:9
msgid "We want to detect being hit by an enemy differently from squashing them. We want the player to die when they're moving on the floor, but not if they're in the air. We could use vector math to distinguish the two kinds of collisions. Instead, though, we will use an :ref:`Area3D <class_Area3D>` node, which works well for hitboxes."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:16
msgid "Hitbox with the Area node"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:18
msgid "Head back to the ``player.tscn`` scene and add a new child node :ref:`Area3D <class_Area3D>`. Name it ``MobDetector`` Add a :ref:`CollisionShape3D <class_CollisionShape3D>` node as a child of it."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:22
msgid "|image0|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:514
msgid "image0"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:24
msgid "In the *Inspector*, assign a cylinder shape to it."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:26
msgid "|image1|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:515
msgid "image1"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:28
msgid "Here is a trick you can use to make the collisions only happen when the player is on the ground or close to it. You can reduce the cylinder's height and move it up to the top of the character. This way, when the player jumps, the shape will be too high up for the enemies to collide with it."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:34
msgid "|image2|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:516
msgid "image2"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:36
msgid "You also want the cylinder to be wider than the sphere. This way, the player gets hit before colliding and being pushed on top of the monster's collision box."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:40
msgid "The wider the cylinder, the more easily the player will get killed."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:42
msgid "Next, select the ``MobDetector`` node again, and in the *Inspector*, turn **off** its *Monitorable* property. This makes it so other physics nodes cannot detect the area. The complementary *Monitoring* property allows it to detect collisions. Then, remove the *Collision -> Layer* and set the mask to the \"enemies\" layer."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:48
msgid "|image3|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:517
msgid "image3"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:50
msgid "When areas detect a collision, they emit signals. We're going to connect one to the ``Player`` node. Select ``MobDetector`` and go to *Inspector*'s *Node* tab, double-click the ``body_entered`` signal and connect it to the ``Player``"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:54
msgid "|image4|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:518
msgid "image4"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:56
msgid "The *MobDetector* will emit ``body_entered`` when a :ref:`CharacterBody3D <class_CharacterBody3D>` or a :ref:`RigidBody3D <class_RigidBody3D>` node enters it. As it only masks the \"enemies\" physics layers, it will only detect the ``Mob`` nodes."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:60
msgid "Code-wise, we're going to do two things: emit a signal we'll later use to end the game and destroy the player. We can wrap these operations in a ``die()`` function that helps us put a descriptive label on the code."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:104
msgid "Ending the game"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:106
msgid "We can use the ``Player``\\ 's ``hit`` signal to end the game. All we need to do is connect it to the ``Main`` node and stop the ``MobTimer`` in reaction."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:110
msgid "Open ``main.tscn``, select the ``Player`` node, and in the *Node* dock, connect its ``hit`` signal to the ``Main`` node."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:113
msgid "|image5|"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:519
msgid "image5"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:115
msgid "Get the timer, and stop it, in the ``_on_player_hit()`` function."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:131
msgid "If you try the game now, the monsters will stop spawning when you die, and the remaining ones will leave the screen."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:134
msgid "Notice also that the game no longer crashes or displays an error when the player dies. Because we are stopping the MobTimer, it no longer triggers the ``_on_mob_timer_timeout()`` function."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:137
msgid "Also note that the enemy colliding with the player and dying depends on the size and position of the ``Player`` and the ``Mob``\\ 's collision shapes. You may need to move them and resize them to achieve a tight game feel."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:141
msgid "You can pat yourself on the back: you prototyped a complete 3D game, even if it's still a bit rough."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:144
msgid "From there, we'll add a score, the option to retry the game, and you'll see how you can make the game feel much more alive with minimalistic animations."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:149
msgid "Code checkpoint"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:151
msgid "Here are the complete scripts for the ``Main``, ``Mob``, and ``Player`` nodes, for reference. You can use them to compare and check your code."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:154
msgid "Starting with ``main.gd``."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:216
msgid "Next is ``mob.gd``."
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:311
msgid "Finally, the longest script, ``player.gd``:"
msgstr ""
#: ../../docs/getting_started/first_3d_game/07.killing_player.rst:512
msgid "See you in the next lesson to add the score and the retry option."
msgstr ""