
In this game, the Knight starts at one side of the beach, and the Dragon randomly moves around the stage. The Knight can use arrow keys to move and press the space bar to swing his sword. Each time the sword touches the Dragon, the score increases by 1. The Dragon makes a funny sound whenever it gets hit and changes its costume to show it is 'hurt' for a moment before resuming its random movement. This project teaches students about simple motion, using conditionals to check for collisions, and playing sounds.



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, choose or create the Knight and Dragon sprites from the Scratch library. Place the Knight on one side of the stage (e.g., left side) and the Dragon randomly on the stage. This sets up the initial scene for the game.
Use the 'when key pressed' blocks to allow the Knight to move left, right, up, and down with the arrow keys. Use the 'when space key pressed' block to make the Knight swing his sword. This can be done by switching to a sword-swinging costume or playing a sword-swinging animation.
Use a 'forever' loop to make the Dragon move randomly. You can use the 'glide' block to make it move to random positions on the stage continuously.
Use an 'if' block to check if the Knight's sword is touching the Dragon. If true, increase the score by 1, play a funny sound, and change the Dragon's costume to show it is hurt for a short time.
Create a variable named 'score' and display it on the screen. Initialize it to 0 at the start of the game. This keeps track of how many times the Knight hits the Dragon.
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.