In this project, students will create a simple story where two giraffes drive their car around the mansion searching for hidden treasures. They can use clones to generate treasure items randomly on the screen, and use messaging to communicate when a treasure is found. The players will move the car using arrow keys, and each time they collect a treasure, a score variable will be updated.
These are the high level steps to create this project. Try to create the project on your own first as much as possible, before checking the detailed solution samples below.
This section provides detailed, step-by-step instructions on how to build the project. There are many ways to create a project, so feel free to explore different approaches. Please note that these instructions are Al-generated, so errors may occur and the coding blocks may not map to Scratch exactly. But it should serve as very valuable references. Stay attentive as you follow along, and enjoy!
First, create a new Scratch project. Add a backdrop that resembles a mansion or a treasure map. Then, add the two giraffe characters and a car sprite. Position the giraffes in the car sprite to make it look like they are driving the car.
Use the arrow keys to move the car around the screen. Attach a 'when flag clicked' block to start the script, and use 'forever' and 'if' blocks to check for arrow key presses. Use 'change x by' and 'change y by' blocks to move the car sprite.
Add a treasure sprite to the project. Use the 'when I start as a clone' block to set the initial position of each treasure clone randomly on the screen. Use 'create clone of' block to generate multiple treasures.
Use the 'sensing' blocks to detect when the car sprite touches a treasure. When a collision is detected, broadcast a message to update the score and delete the clone. Use a variable to keep track of the score.
Create a variable named 'score' to keep track of the treasures collected. Display this variable on the screen so players can see their progress.
It is common to have bugs in the code. Here are some of issues you might run into.
Enroll your child in award-winning online Scratch coding classes led live by experts and designed by professionals from Google, Stanford, and MIT.
The challenge continues: Enjoy even more Scratch tutorials dreamed up by other students or use your imagination to make your own!
Explore your child's grade level to find computer science classes and learning pathways that set your student up for success.