Create Your First Godot 4 Game
Lesson 8: Handling player death
Create Your First Godot 4 Game
- Lesson 1: Getting started with Godot 4 2:53
- Lesson 2: Overview of the Godot interface 18:24
- Lesson 3: Setting up the level 11:09
- Lesson 4: Creating the player 22:42
- Lesson 5: Spawning the platforms 8:09
- Lesson 6: Creating a collectible 18:49
- Lesson 7: Creating an enemy 10:46
- Lesson 8: Handling player death
- Lesson 9: Creating the player projectile 13:05
- Lesson 10: Adding the final touches 6:54
- Lesson 11: Exporting your game and wrapping up 2:37
Video Notes
Our player has to meet their end at some point. In this lesson, we’ll handle the player dying.
Corrections:
There’s a small bug in the video where you can still shoot while the Player is dying. Luckily, there is an easy fix. You can change this line:
if event.is_action_pressed("fire") and ammo > 0:
to:
if event.is_action_pressed("fire") and ammo > 0 and active == true:
AdamDee
Nov. 21, 2022 at 12:21 p.m.Instead of making a new node for ground, can’t we just use the PlayArea node and have it signal when player body exits?
amit
Nov. 21, 2022 at 3:26 p.m.Yes, I think that would work and it would be simpler too. Just make sure you set the
CollisionShape
’s mask for thePlayArea
to collide with the Player as well. Good find!