Hi everyone! It’s Zia here, and today I’m going to show you how to make collectible items in Scratch. If you have a game or a project, you might want the player to walk around and collect objects. This tutorial will teach you how to do just that. Let’s get started!
First, let’s pick a main character for your project. Hover over the “Choose a Sprite” button and click to select your character. You can choose anyone you like. Maybe I’ll pick Ben. Next, let’s choose a background. How about a forest? You can pick any background you want.
Now, let’s add an item for your character to collect. Choose any item you like. I’ll pick a star. Let’s make it so that when you click on the item, it plays a sound. Go to the sound category and drag out the “start sound” block. This will play a sound whenever the Sprite is clicked. To do this, go to the events category and drag out the “when this Sprite clicked” block. Now, every time you click on the Sprite, it plays a sound.
Next, let’s make the star disappear when you click on it to collect it. Go to the looks category, and scroll down to find the “show” and “hide” blocks. Drag these out. The “hide” block makes a Sprite disappear, and the “show” block makes it appear. We can set it up so that when the Sprite is clicked, it starts the sound and then hides. To make it reappear when you restart the game, use the “when green flag clicked” block to show the star again.
Now, let’s make it so that instead of clicking on the item, your character collects it by walking up to it. First, let’s make your character move with the arrow keys. Go to the motion category and find the “change X by 10” block. This block makes your character move right. If you change X by negative 10, the character moves left. Use the “when right arrow key pressed” block to move right and the “when left arrow key pressed” block to move left.
For moving up and down, use the “change Y by 10” block to move up. Use the “when up arrow key pressed” block to move up and the “when down arrow key pressed” block to move down by changing Y by negative 10.
Great! Now your character can move with the arrow keys. Let’s make it so that when the character runs into the item, the item gets collected. Click on the star, and use the “when green flag clicked” block to make the star wait until the Ben Sprite touches it. Use the “touching” block to detect when the Ben Sprite runs into the star. After that, make it play the sound, collect, and hide. You can remove the “when this Sprite clicked” block since we won’t use it anymore.
Let’s make the star go to a random position every time the game starts. Click the green flag to test it out. Now, every time the star appears in a different spot, and you can always collect it. That’s what I wanted to show you today. I hope you have fun making items. See you next time, and happy coding!
Create Your Own Collectible Game: Use Scratch to create a simple game where your character collects different items. Choose a new character and background, and add at least three different collectible items. Experiment with different sounds and effects for each item. Share your game with a friend and see if they can collect all the items!
Observation Challenge: Look around your home or school and find objects that could be collectible items in a game. Think about what sound they might make when collected. Draw a picture of your game scene with these items and describe how your character would collect them.
Story Time: Write a short story about your character’s adventure in collecting items. What challenges do they face? How do they feel when they collect an item? Share your story with your class and discuss how it could be turned into a Scratch game.
Sure! Here’s a sanitized version of the YouTube transcript:
—
Hi everyone, it’s Zia here. Today I wanted to show you how to make collectible items in Scratch. You might have a game or a project, and you want the player to be able to walk around and collect objects. This tutorial will show you exactly how to do that. Let’s get started!
First, let’s pick a main character for your project. You can hover over the button that says “Choose a Sprite” and click to choose. You can pick any main character you’d like. Maybe I’ll pick Ben, and I’ll also choose a background—perhaps the forest. You can pick anything you want.
Now, let’s add an item that this character can collect. You can choose any item you’d like. Maybe I’ll pick the star. Let’s start by making it so that when you click on the item, it plays a sound. Go to the sound category and drag out the block that says “start sound.” This will play a sound. You can make the Sprite do this every time it’s clicked on by going to the events category and dragging out the block that says “when this Sprite clicked.” Now, every time I click on the Sprite, it plays a sound.
Next, let’s make it so that when I click on the star to collect it, it disappears. Go to the looks category, and if you scroll down, you’ll find the blocks “show” and “hide.” Drag these out; the “hide” block will make a Sprite disappear, and the “show” block will make it appear. We can make it so that when this Sprite is clicked, it starts the sound and then hides, disappearing when you collect it. To make it show up again, we can say that when the green flag is clicked, it shows.
Okay, nice! The star reappears when we restart the game. Now, let’s make it so that instead of clicking on the item to collect it, the item gets collected when the main character walks up to it, and then the item disappears.
First, let’s make it so that this main character can move when we press the arrow keys. To make a character move, go to the motion category, and if you scroll down, you’ll find the block “change X by 10,” which will make a character go to the right. If you change X by negative 10, the character goes to the left. We can make it so that when the right arrow key is pressed, the character moves right, and when the left arrow key is pressed, the character moves left.
We can do something similar for moving up and down. Go back to the motion category, drag out the block “change Y by 10,” which will make a character go up. We can make that happen when the up arrow key is pressed, and you can change Y by negative 10 when the down arrow key is pressed.
Great! Now we have a character who can move with the arrow keys. Let’s make it so that when the character runs into the item, the item gets collected. Click on the star, and when the green flag is clicked, let’s make the star wait until the Ben Sprite runs into it. You can use the block that says “touching” to detect that. After the Ben Sprite runs into the star, we can make it play the sound, collect, and hide. We can now remove the “when this Sprite clicked” block since we’re not going to use that anymore.
Let’s try that out. The Ben Sprite runs into the star, and then it gets collected because the star waits until the Ben Sprite runs into it. Once that happens, it does all of this. Oh, and let’s also make it so that the star goes to a random position every time the game starts. Click the green flag and test that out.
Now, every time the star goes somewhere different, and you can always collect it. Anyway, that’s what I wanted to show you today. I hope you have fun making items. I’ll see you next time, and happy coding!
—
This version maintains the instructional content while ensuring clarity and professionalism.