Full playable demo

Play the full demo

Play the completed game first. Reopen it whenever you need to check the target behaviour, but the demo never reveals the source code.

Playable result only — the source code stays hidden.

Mission 00 5 min

Mission 0: See What You’re Building

Play Bug Smasher before coding. This quest changes the input model: instead of steering with the keyboard, the player aims and clicks.

New ideas

  • mouse events and mouse coordinates
  • click hit-testing
  • elapsed time with millis()
  • combining several conditions

The hints still teach new syntax, but familiar score/state/restart work is less prescriptive.

Build roadmap

What you’ll build, mission by mission

  1. 1
    Draw the bug

    Create a target with a clear centre point.

  2. 2
    React to a click

    Learn `mousePressed()`, `mouseX` and `mouseY`.

  3. 3
    Hit the bug

    Decide whether a click landed inside the target.

  4. 4
    Score hits

    Count successful clicks.

  5. 5
    Count misses

    Use `else` for the opposite outcome.

  6. 6
    Add a timer

    Build a 20-second countdown with `millis()`.

  7. 7
    End the round

    Combine win and loss conditions.

  8. 8
    Restart

    Reset a timed game correctly.

  9. 9
    Make it scurry

    Use time to move the bug automatically.

Mission demoMeet the Bug

Finished result only — the answer code stays hidden.