Start by making a copy of the starter template so you can add your own code.
- Click this link to create a remix of the template: Remix Template
Build a Treasure Hunting Game in Sprite Lab
Start by making a copy of the starter template so you can add your own code.
Configure the opening screen to display the title and instruct the player to press space to begin.
This function marks the game as started, hides the title screen and score display, and sets the score to 0.
The map provides a grid background and places a compass sprite in the corner.
Spawn a treasure coin at a random location on the board and set its size.
Spawn the purple bunny hero sprite, adjust its size, and enable arrow key movement.
Spawn an orange one-eyed monster sprite and give it wandering behavior.
Listen for the space key event and call all setup functions if game started is false.
If the coin touches the compass when spawned, relocate it to a new random location.
Play a sound, move the coin, increase the score, and make the hero say the updated score.
When touching the compass, the compass tells the player the X and Y positions of the hidden treasure.
End the game state, play a game over sound, clear sprites, show the game over screen, and display the final score.
Detect when the monster enemy touches the bunny hero and trigger the gameOver function.