Full playable demo

Play the full demo

Collect five treasures while dodging the red traps and the moving purple guardian. You have three lives, and R starts a fresh round after either ending.

Playable result only — the source code stays hidden.

Mission 00 5 min

Mission 0: See What You’re Building

Play the finished Treasure Collector game first. This quest is about transfer: most of the programming ideas are familiar, but now they work together in a more dangerous game. You will receive less line-by-line direction than before.

What you'll practise

  • four-direction movement
  • distance-based collision
  • debugging with console.log()
  • random positions and score
  • arrays of objects and for loops
  • AND, OR and NOT in real game rules
  • lives, game state and restart logic
Build roadmap

What you’ll build, mission by mission

  1. 1
    Draw the explorer

    Create a player from stored coordinates.

  2. 2
    Move in four directions

    Transfer keyboard movement to both x and y.

  3. 3
    Place the treasure

    Add an independent goal object.

  4. 4
    Debug the detector

    Use the Console panel and fix a broken distance comparison.

  5. 5
    Hide it again

    Move treasure after a successful find.

  6. 6
    Count treasure

    Add and display score.

  7. 7
    Build a trap field

    Reuse arrays, loops, AND and NOT to create several hazards.

  8. 8
    Add a guardian

    Use OR to combine a moving enemy with the trap field.

  9. 9
    Win or lose

    Apply game-state logic so danger and movement stop at the ending.

  10. 10
    Restart

    Group AND/OR conditions and rebuild the full restart pattern.

Mission demoDraw Your Explorer

Finished result only — the answer code stays hidden.