Scratch: Hide and Seek (Ghost Hunt)

Time: 30–45 minutes

What You’ll Need:

  • A computer or laptop

  • Internet access

  • A free Scratch account


Project Overview

Get ready for a game of reflexes! This is a "Whack-a-Mole" style game where a spooky Ghost (or a mischievous Goblin) pops up in random spots. You only have one second to click it before it vanishes again. You’ll learn how to use Randomness and Ghost Effects to make the game unpredictable and fun!

Instructions

1. Pick Your "Hider" and Scene

  • Go to Scratch and click Create.

  • Delete the default cat sprite.

  • Click Choose a Sprite and select the Ghost or Goblin.

  • Click Choose a Backdrop and pick a spooky location, like "Woods" or "Castle."

2. Create the Scoreboard

  • Go to the orange Variables category.

  • Click Make a Variable.

  • Name it Score and click OK.

3. Code the Hide and Seek Logic

We need to tell the Ghost to wait for a random amount of time, move to a new spot, and then show itself.

  • Select your Ghost sprite and add this script:

    • when green flag clicked

    • set [Score] to 0

    • forever:

      • hide

      • wait (pick random (1) to (3)) seconds (This makes the wait time different every time!)

      • go to [random position]

      • show

      • wait (1) seconds (This is the only time the player can click it!)

4. Catching the Ghost (Scoring)

Now, let's make the Ghost react when it gets caught.

  • In the same sprite area, add this second script:

    • when this sprite clicked

    • change [Score] by 1

    • play sound [Space Ripple] until done (or any spooky sound)

    • hide (The ghost "runs away" once you find it!)

5. Add a Visual "Ghost" Effect

To make the ghost look more transparent and spooky:

  • In the when green flag clicked script, right before the forever loop, add:

    • set [ghost] effect to (30)

    • (You can find this block under the Looks category).


Testing Your Game

  1. Click the Green Flag.

  2. Wait for the ghost to appear. It might take 1 second, or it might take 3!

  3. Try to click it as fast as you can.

  4. Check if your Score goes up every time you successfully click the ghost.


Challenge Extension

  • Speed Up: As your score gets higher, make the wait (1) seconds block shorter so the ghost disappears faster!

  • Shrinking Ghost: Every time you catch the ghost, use change size by (-5) to make it smaller and harder to click.

  • The Golden Ghost: Create a second sprite that is gold. Make it appear very rarely, but give the player 5 points if they catch it!


Previous
Previous

Build A Catapult!

Next
Next

Scratch Music Maker