BLINKCADEAI GAME DEVELOPMENT
Sign In
Home Library Guide

Connect Collection to the Score HUD

Complete _on_collectible_collected(): add points to score, refresh the label, and emit score_updated with the new total.

Tested with: Godot 4.7.2 · Estimated time: 35 minutes

Result

Collecting each pulse adds five points, updates the HUD, and announces the new total.

Your task

Complete _on_collectible_collected(points) in game.gd.

Verify

The three pulses should produce scores of 5, 10, and 15.

Independent challenge

When the score reaches 15, show a completion message without tightly coupling the collectible to the HUD.

Learning objectives

  • Update persistent game state from a signal handler.
  • Refresh HUD text from the new state.
  • Emit a second signal after state changes.

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