From 4f1e2910de4d4c5f7eb00d4a826c9ca4e335ce4f Mon Sep 17 00:00:00 2001 From: Russell Sanborn Date: Sat, 29 Jun 2024 19:35:38 -0500 Subject: [PATCH 1/2] Update played.gd/tscn filename to Played.gd to match example casing This update aligns with the Dodge The Creeps example git example repo. Reference: https://github.com/godotengine/godot-demo-projects/tree/0ec2fff5bf8baa6162823f6cbca89878384b8fe6/2d/dodge_the_creeps --- getting_started/first_2d_game/03.coding_the_player.rst | 2 +- getting_started/first_2d_game/05.the_main_game_scene.rst | 2 +- getting_started/first_3d_game/02.player_input.rst | 2 +- getting_started/first_3d_game/03.player_movement_code.rst | 2 +- getting_started/first_3d_game/04.mob_scene.rst | 2 +- getting_started/first_3d_game/06.jump_and_squash.rst | 2 +- getting_started/first_3d_game/07.killing_player.rst | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/getting_started/first_2d_game/03.coding_the_player.rst b/getting_started/first_2d_game/03.coding_the_player.rst index 1b88aa4be..a6f7f97b8 100644 --- a/getting_started/first_2d_game/03.coding_the_player.rst +++ b/getting_started/first_2d_game/03.coding_the_player.rst @@ -63,7 +63,7 @@ override the value written in the script. .. image:: img/export_variable.webp -Your ``player.gd`` script should already contain +Your ``Player.gd`` script should already contain a ``_ready()`` and a ``_process()`` function. If you didn't select the default template shown above, create these functions while following the lesson. diff --git a/getting_started/first_2d_game/05.the_main_game_scene.rst b/getting_started/first_2d_game/05.the_main_game_scene.rst index a450ad2f8..aeaa864ce 100644 --- a/getting_started/first_2d_game/05.the_main_game_scene.rst +++ b/getting_started/first_2d_game/05.the_main_game_scene.rst @@ -10,7 +10,7 @@ Create a new scene and add a :ref:`Node ` named ``Main``. be a container for handling game logic. It does not require 2D functionality itself.) Click the **Instance** button (represented by a chain link icon) and select your saved -``player.tscn``. +``Player.tscn``. .. image:: img/instance_scene.webp diff --git a/getting_started/first_3d_game/02.player_input.rst b/getting_started/first_3d_game/02.player_input.rst index 282b722ca..65269471e 100644 --- a/getting_started/first_3d_game/02.player_input.rst +++ b/getting_started/first_3d_game/02.player_input.rst @@ -79,7 +79,7 @@ the eye icon next to the ``Character`` or the ``Pivot`` nodes. |image5| -Save the scene as ``player.tscn`` +Save the scene as ``Player.tscn`` With the nodes ready, we can almost get coding. But first, we need to define some input actions. diff --git a/getting_started/first_3d_game/03.player_movement_code.rst b/getting_started/first_3d_game/03.player_movement_code.rst index 6f4a0d024..6f38febd5 100644 --- a/getting_started/first_3d_game/03.player_movement_code.rst +++ b/getting_started/first_3d_game/03.player_movement_code.rst @@ -367,7 +367,7 @@ Child Scene*. |image2| -In the popup, double-click ``player.tscn``. The character should appear in the +In the popup, double-click ``Player.tscn``. The character should appear in the center of the viewport. Adding a camera diff --git a/getting_started/first_3d_game/04.mob_scene.rst b/getting_started/first_3d_game/04.mob_scene.rst index a96f71d34..c3113c07a 100644 --- a/getting_started/first_3d_game/04.mob_scene.rst +++ b/getting_started/first_3d_game/04.mob_scene.rst @@ -7,7 +7,7 @@ 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. Let's design the monsters themselves in a new scene. The node structure is going -to be similar to the ``player.tscn`` scene. +to be similar to the ``Player.tscn`` scene. Create a scene with, once again, a :ref:`CharacterBody3D ` node as its root. Name it ``Mob``. Add a child node :ref:`Node3D `, name it ``Pivot``. And drag and drop diff --git a/getting_started/first_3d_game/06.jump_and_squash.rst b/getting_started/first_3d_game/06.jump_and_squash.rst index 9a451c9cc..7f329508f 100644 --- a/getting_started/first_3d_game/06.jump_and_squash.rst +++ b/getting_started/first_3d_game/06.jump_and_squash.rst @@ -72,7 +72,7 @@ see a list of named checkboxes. |image4| -Next up are the ``Player`` and the ``Mob``. Open ``player.tscn`` by double-clicking +Next up are the ``Player`` and the ``Mob``. Open ``Player.tscn`` by double-clicking the file in the *FileSystem* dock. Select the *Player* node and set its *Collision -> Mask* to both "enemies" and diff --git a/getting_started/first_3d_game/07.killing_player.rst b/getting_started/first_3d_game/07.killing_player.rst index d1fd101b8..2262d278e 100644 --- a/getting_started/first_3d_game/07.killing_player.rst +++ b/getting_started/first_3d_game/07.killing_player.rst @@ -15,7 +15,7 @@ works well for hitboxes. Hitbox with the Area node ------------------------- -Head back to the ``player.tscn`` scene and add a new child node :ref:`Area3D `. Name it +Head back to the ``Player.tscn`` scene and add a new child node :ref:`Area3D `. Name it ``MobDetector`` Add a :ref:`CollisionShape3D ` node as a child of it. From d095668491f0c071d1f801d3f14aeccf6d4826e9 Mon Sep 17 00:00:00 2001 From: Russell Sanborn Date: Sun, 30 Jun 2024 08:05:53 -0500 Subject: [PATCH 2/2] Update 2D and 3D example file names to snake case --- getting_started/first_2d_game/03.coding_the_player.rst | 2 +- getting_started/first_2d_game/05.the_main_game_scene.rst | 2 +- getting_started/first_3d_game/02.player_input.rst | 2 +- getting_started/first_3d_game/03.player_movement_code.rst | 4 ++-- getting_started/first_3d_game/04.mob_scene.rst | 4 ++-- getting_started/first_3d_game/06.jump_and_squash.rst | 4 ++-- getting_started/first_3d_game/07.killing_player.rst | 6 +++--- getting_started/first_3d_game/08.score_and_replay.rst | 8 ++++---- getting_started/first_3d_game/09.adding_animations.rst | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/getting_started/first_2d_game/03.coding_the_player.rst b/getting_started/first_2d_game/03.coding_the_player.rst index a6f7f97b8..1b88aa4be 100644 --- a/getting_started/first_2d_game/03.coding_the_player.rst +++ b/getting_started/first_2d_game/03.coding_the_player.rst @@ -63,7 +63,7 @@ override the value written in the script. .. image:: img/export_variable.webp -Your ``Player.gd`` script should already contain +Your ``player.gd`` script should already contain a ``_ready()`` and a ``_process()`` function. If you didn't select the default template shown above, create these functions while following the lesson. diff --git a/getting_started/first_2d_game/05.the_main_game_scene.rst b/getting_started/first_2d_game/05.the_main_game_scene.rst index aeaa864ce..a450ad2f8 100644 --- a/getting_started/first_2d_game/05.the_main_game_scene.rst +++ b/getting_started/first_2d_game/05.the_main_game_scene.rst @@ -10,7 +10,7 @@ Create a new scene and add a :ref:`Node ` named ``Main``. be a container for handling game logic. It does not require 2D functionality itself.) Click the **Instance** button (represented by a chain link icon) and select your saved -``Player.tscn``. +``player.tscn``. .. image:: img/instance_scene.webp diff --git a/getting_started/first_3d_game/02.player_input.rst b/getting_started/first_3d_game/02.player_input.rst index 65269471e..282b722ca 100644 --- a/getting_started/first_3d_game/02.player_input.rst +++ b/getting_started/first_3d_game/02.player_input.rst @@ -79,7 +79,7 @@ the eye icon next to the ``Character`` or the ``Pivot`` nodes. |image5| -Save the scene as ``Player.tscn`` +Save the scene as ``player.tscn`` With the nodes ready, we can almost get coding. But first, we need to define some input actions. diff --git a/getting_started/first_3d_game/03.player_movement_code.rst b/getting_started/first_3d_game/03.player_movement_code.rst index 6f38febd5..29d0989b1 100644 --- a/getting_started/first_3d_game/03.player_movement_code.rst +++ b/getting_started/first_3d_game/03.player_movement_code.rst @@ -246,7 +246,7 @@ smooth it out for you. It uses the *velocity* value native to the :ref:`Characte And that's all the code you need to move the character on the floor. -Here is the complete ``Player.gd`` code for reference. +Here is the complete ``player.gd`` code for reference. .. tabs:: .. code-tab:: gdscript GDScript @@ -367,7 +367,7 @@ Child Scene*. |image2| -In the popup, double-click ``Player.tscn``. The character should appear in the +In the popup, double-click ``player.tscn``. The character should appear in the center of the viewport. Adding a camera diff --git a/getting_started/first_3d_game/04.mob_scene.rst b/getting_started/first_3d_game/04.mob_scene.rst index c3113c07a..5cc089a9d 100644 --- a/getting_started/first_3d_game/04.mob_scene.rst +++ b/getting_started/first_3d_game/04.mob_scene.rst @@ -7,7 +7,7 @@ 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. Let's design the monsters themselves in a new scene. The node structure is going -to be similar to the ``Player.tscn`` scene. +to be similar to the ``player.tscn`` scene. Create a scene with, once again, a :ref:`CharacterBody3D ` node as its root. Name it ``Mob``. Add a child node :ref:`Node3D `, name it ``Pivot``. And drag and drop @@ -252,7 +252,7 @@ method. This function destroys the instance it's called on. Our monster is ready to enter the game! In the next part, you will spawn monsters in the game level. -Here is the complete ``Mob.gd`` script for reference. +Here is the complete ``mob.gd`` script for reference. .. tabs:: .. code-tab:: gdscript GDScript diff --git a/getting_started/first_3d_game/06.jump_and_squash.rst b/getting_started/first_3d_game/06.jump_and_squash.rst index 7f329508f..cc2d6c07b 100644 --- a/getting_started/first_3d_game/06.jump_and_squash.rst +++ b/getting_started/first_3d_game/06.jump_and_squash.rst @@ -72,7 +72,7 @@ see a list of named checkboxes. |image4| -Next up are the ``Player`` and the ``Mob``. Open ``Player.tscn`` by double-clicking +Next up are the ``Player`` and the ``Mob``. Open ``player.tscn`` by double-clicking the file in the *FileSystem* dock. Select the *Player* node and set its *Collision -> Mask* to both "enemies" and @@ -318,7 +318,7 @@ such as counting the score multiple times for one kill. We are calling one undefined function, ``mob.squash()``, so we have to add it to the Mob class. -Open the script ``Mob.gd`` by double-clicking on it in the *FileSystem* dock. At +Open the script ``mob.gd`` by double-clicking on it in the *FileSystem* dock. At the top of the script, we want to define a new signal named ``squashed``. And at the bottom, you can add the squash function, where we emit the signal and destroy the mob. diff --git a/getting_started/first_3d_game/07.killing_player.rst b/getting_started/first_3d_game/07.killing_player.rst index 2262d278e..74b22d246 100644 --- a/getting_started/first_3d_game/07.killing_player.rst +++ b/getting_started/first_3d_game/07.killing_player.rst @@ -15,7 +15,7 @@ works well for hitboxes. Hitbox with the Area node ------------------------- -Head back to the ``Player.tscn`` scene and add a new child node :ref:`Area3D `. Name it +Head back to the ``player.tscn`` scene and add a new child node :ref:`Area3D `. Name it ``MobDetector`` Add a :ref:`CollisionShape3D ` node as a child of it. @@ -213,7 +213,7 @@ Starting with ``main.gd``. } } -Next is ``Mob.gd``. +Next is ``mob.gd``. .. tabs:: .. code-tab:: gdscript GDScript @@ -308,7 +308,7 @@ Next is ``Mob.gd``. } } -Finally, the longest script, ``Player.gd``: +Finally, the longest script, ``player.gd``: .. tabs:: .. code-tab:: gdscript GDScript diff --git a/getting_started/first_3d_game/08.score_and_replay.rst b/getting_started/first_3d_game/08.score_and_replay.rst index 0037e6447..7c97ddfec 100644 --- a/getting_started/first_3d_game/08.score_and_replay.rst +++ b/getting_started/first_3d_game/08.score_and_replay.rst @@ -131,7 +131,7 @@ line: This line means that when the mob emits the ``squashed`` signal, the ``ScoreLabel`` node will receive it and call the function ``_on_mob_squashed()``. -Head back to the ``ScoreLabel.gd`` script to define the ``_on_mob_squashed()`` +Head back to the ``score_label.gd`` script to define the ``_on_mob_squashed()`` callback function. There, we increment the score and update the displayed text. @@ -321,18 +321,18 @@ game. |image17| -Save the scene as ``MusicPlayer.tscn``. +Save the scene as ``music_player.tscn``. We have to register it as an autoload. Head to the *Project -> Project Settings…* menu and click on the *Autoload* tab. In the *Path* field, you want to enter the path to your scene. Click the folder -icon to open the file browser and double-click on ``MusicPlayer.tscn``. Then, +icon to open the file browser and double-click on ``music_player.tscn``. Then, click the *Add* button on the right to register the node. |image18| -``MusicPlayer.tscn`` now loads into any scene you open or play. +``music_player.tscn`` now loads into any scene you open or play. So if you run the game now, the music will play automatically in any scene. Before we wrap up this lesson, here's a quick look at how it works under the diff --git a/getting_started/first_3d_game/09.adding_animations.rst b/getting_started/first_3d_game/09.adding_animations.rst index 6f3b602ba..38ae7f8aa 100644 --- a/getting_started/first_3d_game/09.adding_animations.rst +++ b/getting_started/first_3d_game/09.adding_animations.rst @@ -298,8 +298,8 @@ And with that, you finished coding your first complete 3D game. **Congratulations**! In the next part, we'll quickly recap what you learned and give you some links -to keep learning more. But for now, here are the complete ``Player.gd`` and -``Mob.gd`` so you can check your code against them. +to keep learning more. But for now, here are the complete ``player.gd`` and +``mob.gd`` so you can check your code against them. Here's the *Player* script.