Playable result only — the source code stays hidden.
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
forloops - AND, OR and NOT in real game rules
- lives, game state and restart logic
What you’ll build, mission by mission
- 1Draw the explorer
Create a player from stored coordinates.
- 2Move in four directions
Transfer keyboard movement to both x and y.
- 3Place the treasure
Add an independent goal object.
- 4Debug the detector
Use the Console panel and fix a broken distance comparison.
- 5Hide it again
Move treasure after a successful find.
- 6Count treasure
Add and display score.
- 7Build a trap field
Reuse arrays, loops, AND and NOT to create several hazards.
- 8Add a guardian
Use OR to combine a moving enemy with the trap field.
- 9Win or lose
Apply game-state logic so danger and movement stop at the ending.
- 10Restart
Group AND/OR conditions and rebuild the full restart pattern.