⚡ G-Warp

Tutorial 2: Make a clicker game

You will make: a score that goes up every time someone clicks a sprite, with a sound for feedback. The main blocks are when flag clicked, set [Score] to (0), when this sprite clicked, change [Score] by (1) and start sound [pop].

Step 1 — Create the score

  1. Select the sprite you want players to click.
  2. Open Variables and choose Make a Variable. Name it Score and choose all sprites if the dialog asks where it should be available.
  3. Keep the Score monitor visible on the Stage so you can watch it change.

Step 2 — Reset at the start

Snap these blocks together in one script:

when flag clicked
set [Score v] to (0)

Use the Variables block set [Score] to (0). This resets the game each time you start a new round.

Step 3 — Add one point and play a sound

Make a second script on the same sprite:

when this sprite clicked
change [Score v] by (1)
start sound [pop v]

Choose change [Score] by (1) from Variables and start sound [pop] from Sound. Pick a short sound from the sound dropdown. If pop is not available, add a sound to this sprite in Sounds first, then select it in the block.

Step 4 — Test the game

  1. Click Green Flag/Start. Score should begin at 0.
  2. Click the sprite on the Stage several times. Score should increase by exactly 1 per click and the sound should play.
  3. Press Stop, then start again. Confirm Score resets to 0.

Gotchas: the click event belongs to the sprite that owns the script. If nothing happens, check that the clicked sprite is selected and that the blocks are connected under the correct hat. Keep the sound block inside the click script so it plays only when clicked.

← All tutorials · Block categories · Sounds guide