This project sets the Knight in a haunted mansion where ghosts are trying to invade. The Knight can shoot magical energy to defend against the ghosts. Players will control the Knight's movements, switch between different costumes for different magic attacks, and repeat actions to defeat enemies, focusing on sound effects when ghosts are defeated and simple repeat loops.
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 Knight sprite. You can either draw your own or choose one from the Scratch library. Make sure the Knight has at least two costumes: one for normal stance and one for shooting magic. Use the arrow keys to move the Knight left and right across the screen.
Create a new sprite for the magic energy that the Knight will shoot. When the space key is pressed, the magic sprite should appear at the Knight's position and move upwards. Use a repeat loop to make the magic move continuously until it reaches the top of the screen.
Create a ghost sprite that will move from the top of the screen to the bottom. Use a repeat loop to make the ghost move continuously. When the ghost reaches the bottom, it should reappear at the top at a random x position.
Use a conditional statement to check if the magic sprite is touching a ghost. If it is, play a sound effect and make the ghost disappear. You can use the "delete this clone" block to remove the ghost.
Switch the Knight's costume back to normal after shooting. Add sound effects for shooting and when a ghost is hit. Use the "play sound" block to add these effects.
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.