Arena Survivor: Part 4: Level Up
Build a HUD with CanvasLayer, track score with signals, add health bars, tween-based visual feedback, and game-over flow.
No login required.
Real Deaths
Part 2 just deletes enemies on collision. Let's make enemy death a proper system: declare a signal, emit it, and drop an XP gem.
Death signals decouple systems. The enemy doesn't need to know about XP. It just broadcasts "I died" and other systems react. If you've seen the Observer pattern before, this is it.
Loading game...
Click the game window to interact with it
What You'll Build
You will build a heads-up display that shows the player's score and health. The HUD sits on a CanvasLayer so it stays fixed on screen while the game world scrolls. Score updates are driven by signals, health decreases on enemy contact, and tweens animate UI changes. A game-over screen appears when health reaches zero.
Learning Goals
- ✓CanvasLayer for screen-space UI that does not scroll with the world
- ✓Custom signals for decoupled communication between nodes
- ✓Label and ProgressBar nodes for HUD display
- ✓@export variables for tuning values in the inspector
- ✓create_tween() for smooth visual feedback on damage and score changes
GDScript Concepts in This Part
Tips
- ✨Use @export on speed, health, and damage values so you can tweak balance in the Godot inspector without changing code.
- ✨Create tweens with create_tween() instead of manually interpolating — they handle timing, easing, and cleanup automatically.
- ✨Keep UI logic in a separate HUD script; connect game events via signals to keep the code decoupled.