|
@@ -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
|
|
|
---------------
|
|
|
|
|
@@ -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.
|
|
|
|