Tested with: Godot 4.7.2 · Estimated time: 25 minutes
Result
Clicking the crystal adds ten points to the score label.
Your task
Emit collected(points) before the collectible calls queue_free().
Why it matters
The collectible announces what happened without knowing which system will update the score.
Independent challenge
Add a second collectible worth 25 points without changing the main score handler.
Learning objectives
- Declare a signal with a typed payload.
- Emit an event before the source node is removed.
- Keep the collectible independent from the score system.
Interactive Godot Lab
The lab works immediately in browser practice mode. When the isolated runner is connected, the same workspace also performs engine-authoritative Godot checks.
Native Godot project files
Download the starter project · Download the completed reference project