In this project, the Wizard must navigate through different rooms of the haunted mansion while dodging ghost clones. The player uses arrow keys to move the Wizard around the screen and must avoid touching any ghosts. When the Wizard collects a special item in each room, he can send a message to create a new ghost clone in a random position, making it more challenging. The goal is to survive for a certain amount of time or reach the exit before getting caught by the ghosts.
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!
Start by creating a Wizard sprite. You can either draw your own or choose one from the Scratch library. Next, add scripts to allow the Wizard to move using the arrow keys. Use the 'when green flag clicked' block to initialize the Wizard's position and use 'when key pressed' blocks to move the Wizard up, down, left, and right.
Design a backdrop that looks like a room in a haunted mansion. You can draw spooky elements like cobwebs and old furniture. Then, create a ghost sprite. Use the 'when I receive' block to create clones of the ghost at random positions. Use a 'forever' loop to make the ghosts move around the room.
Create a special item sprite that the Wizard can collect. When the Wizard touches this item, it should disappear, and a message should be sent to create a new ghost clone. Use the 'broadcast' block to send this message and the 'when I receive' block to handle the ghost creation.
Create variables to track the time the Wizard has survived and whether the game is over. Use a 'forever' loop to check if the Wizard touches a ghost. If so, end the game. Also, set a timer to determine if the Wizard survives long enough to win. Use 'if' statements to check these conditions.
Create an exit sprite that the Wizard must reach to win the game. Position it in a challenging location. Use a 'when touching' block to detect when the Wizard reaches the exit and display a victory message.
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.