St. Patrick's Scratch Lesson:
Build a Charm Game!
I have a really special lesson for you today! It will walk you and your students through building a charm game in Scratch - just in time for St. Patrick's Day!
In this game, we have charms in 3 different shapes dropping down from the sky. As the shapes appear, your job is to quickly draw each shape in order to sort it into the right pot. If you’re successful at sorting the charm, it will get absorbed into the pot, and your score will increase by ‘1’. Otherwise, once the charm reaches the level of the pots, the game will end!
An Intro to the Game of Charms
The short video below covers how we expect this game to work. I always start with this type of introduction when teaching my students how to create a new game in Scratch. Feel free to play the introduction below for your own students. I recommend stopping the video and using the arrow keys to progress through it. That works best for me as it allows me to speak and move at my own pace, while I'm running it.
The Starter Project
Click the button below and enter your email address to have the starter project sent to you. The email you'll receive will contain instructions for how to upload the starter project onto your Scratch account. If you're planning on teaching this game, I suggest sharing the project at this point, and then adding it to your Scratch class studio and having your students remix it from there. If you don't have a class studio, you can just share the project's url with your students. As long as you remember to click that 'Share' button inside your own copy of the starter project, your students will be able to remix it into their own Scratch accounts.
Step 1: Sketching the Charms
We're going to start by programming the computer to be able to use the mouse to draw on the screen. To do this, we’ll first need to tell our ‘Artist’ sprite to always follow the mouse, and then we’ll use the ‘pen down’ block from the ‘Pen’ extension to make our ‘Artist’ sprite continuously draw as it moves! Because our ‘Artist’ sprite is hidden, as it follows the mouse, moves, and draws, it's going to look like we're drawing with the mouse, but really we’ll be using our invisible ‘Artist’ sprite to draw!
Step 2: Dropping the Charms
Now that we're able to draw on the screen, it's time to start dropping those charms! In this step, we will explore the concept of cloning as we generate multiple instances of our 'Charms' sprite, and cause them to continuously descend from the sky. We will begin by randomly selecting one of the three shapes and placing a charm of that shape at a randomized location on the top of the stage. Next, we will program this charm to descend until it reaches the height at the top of the pots, and upon reaching this point, play a sound and end the game. Lastly, we will implement cloning to replicate the above behavior, creating one clone every second throughout the entire duration of the game.
Step 3: Sorting the Charms
Now that we have the ability to draw on the screen, and we have charms in different shapes descending from the sky, it's time to sort these charms into the appropriate pots as soon as a charm's shape is drawn on the screen! We can determine that the player is finished drawing a shape when the mouse is no longer pressed. At this stage, we will check if the shape that was just drawn matches any of the dropping clones. When a match is found, we will smoothly glide the clone over to the corresponding pot, allowing it to drop in.
Step 4: Catching the Charms
In this final step of our development, we'll assess the current state of the game. To accomplish this, we will implement a check when a clone reaches the height at the top of the pots to verify if it has reached the correct pot. If the clone has reached the appropriate pot, we will absorb it into the pot, play a sound, and increase the score. However, if the clone has not reached the correct pot, we will display an enlarged version of the clone, play a sound, and end the game.
And that concludes the St. Patrick's Day Scratch Lesson! I genuinely hope you derive as much joy from teaching it as my son and I experienced while creating it. As always, I value any feedback you may have, and if you decide to teach this lesson, I would love to hear how it went!
So, if you haven't already, please consider joining our incredible community of educators on Facebook. The group is filled with inspiring ideas and supportive teachers, and I'm confident you'll find it extremely valuable!
I hope you find yourself blessed this St. Patrick's day!