Godot 4 Dev Insight: Generic Platformer - Part 06

Опубликовано: 11 Февраль 2026
на канале: bug implementer
243
3

Welcome back friend. I've been waiting for you. Lots of great things are happening today.

It's all about the player. We breathe life and death into our sweet little astronaut. Also joy.

The player will die if they get too close to mr spikes and will be happy if they make it to the end of the level and reach the flag. Otherwise he lives happily ever after.

To do this, we extend the player script and add states, as with mr spikes. Again, we use a simple match statement because anything else at this point would be overkill.

Last but not least we create the DangerZone to be able to kill the player whenever we want.

let's get started

Music:
1. Never Walk Alone (Tomas Skyldeberg Remix) (Instrumental Version) - Blake Everett.wav
2. Out of Reach - Phello.wav
3. Night Stalker - Wave Saver.wav
4. Bonjour - Phello.wav
5. Night Stalker - Wave Saver.wav

Chapters:
00:00:00 Intro
00:00:58 Add Flag Trigger
00:01:52 Update/Add Signals
00:03:07 Implement States Alive and Happy
00:05:16 Implement State Dead
00:10:02 Set Up Communication with Level Template
00:11:32 Dead = Restart At First Level
00:12:22 Add Generic Hazard Scene (Danger Zone)