Skip to content

Commit

Permalink
Merge pull request godotengine#9029 from skyace65/DodgeCreeps
Browse files Browse the repository at this point in the history
Fix and update Dodge the Creeps Issues
  • Loading branch information
mhilbrunner authored Mar 2, 2024
2 parents 53d7d8b + 266e266 commit 86c20b2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
14 changes: 14 additions & 0 deletions getting_started/first_3d_game/05.spawning_mobs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,20 @@ what the *PathFollow* node's ``progress_ratio`` expects:
The path we have set is around the camera's viewport, so any random value between 0 and 1
is a random position alongside the edges of the viewport!

Note that if you remove the ``Player`` from the main scene, the following line

.. tabs::
.. code-tab:: gdscript GDScript

var player_position = $Player.position

.. code-tab:: csharp

Vector3 playerPosition = GetNode<Player>("Player").Position;


gives an error because there is no $Player!

Here is the complete ``main.gd`` script so far, for reference.

.. tabs::
Expand Down
23 changes: 4 additions & 19 deletions getting_started/first_3d_game/07.killing_player.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,25 +100,6 @@ a ``die()`` function that helps us put a descriptive label on the code.
Die();
}

Try the game again by pressing :kbd:`F5`. If everything is set up correctly,
the character should die when an enemy runs into the collider. Note that without a ``Player``, the following line

.. tabs::
.. code-tab:: gdscript GDScript

var player_position = $Player.position

.. code-tab:: csharp

Vector3 playerPosition = GetNode<Player>("Player").Position;


gives an error because there is no $Player!

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.

Ending the game
---------------

Expand Down Expand Up @@ -153,6 +134,10 @@ and the remaining ones will leave the screen.
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.

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.

You can pat yourself in the back: you prototyped a complete 3D game,
even if it's still a bit rough.

Expand Down
5 changes: 3 additions & 2 deletions getting_started/first_3d_game/09.adding_animations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ time in seconds.
We want the animation to start playback automatically at the start of the game.
Also, it should loop.

To do so, you can click the button with an "A>" icon in the animation toolbar
To do so, you can click the autoplay button (|Autoplay|) in the animation toolbar
and the looping arrows, respectively.

|image5|
Expand Down Expand Up @@ -271,7 +271,7 @@ should see the message "Global library will be created." Leave the text field bl
click OK. Click the *Paste* icon (clipboard) and it should appear in the window. Click OK
to close the window.

Next, make sure that the button with an "A>" icon (Autoplay on Load) and the looping
Next, make sure that the autoplay button (|Autoplay|) and the looping
arrows (Animation looping) are also turned on in the animation editor in the bottom panel.
That's it; all monsters will now play the float animation.

Expand Down Expand Up @@ -639,3 +639,4 @@ And the *Mob*'s script.
.. |animation_final_keyframes| image:: img/09.adding_animations/animation_final_keyframes.webp
.. |second_keys_both| image:: img/09.adding_animations/second_keys_both.webp
.. |timeline_05_click| image:: img/09.adding_animations/timeline_05_click.webp
.. |Autoplay| image:: img/09.adding_animations/
Binary file not shown.
Binary file not shown.

0 comments on commit 86c20b2

Please sign in to comment.