Hey everyone, it’s Zenia here! Today, I’m excited to show you how to add some cool features to your shop in Scratch. In this part, we’ll learn how to add game upgrades, items that players can buy multiple times, and special items that can only be unlocked once. Let’s dive in!
We’ll start with the code from part one. If you haven’t seen that yet, I recommend checking it out. So far, we have a shop where players can buy a red shirt for their character.
Now, let’s add an item that changes the gameplay, not just how the character looks. We’ll create a “Speed Boost” that makes the character move faster. Here’s how:
To make the speed boost work, use an if-else block to check if “botSpeedBoost” is true. If it is, change the character’s movement speed:
Next, let’s create an item that players can buy multiple times, like cabbages:
Now, let’s make an item that can only be bought once, like the speed boost:
Finally, let’s make the shop buttons more interactive:
And that’s it for part two of making a shop in Scratch! If you have any questions, feel free to ask. See you next time, and happy scratching!
Imagine a new item you would like to add to your Scratch shop. Design a button for it and decide how much it will cost. Write down what the item does and how it affects the game. Then, try to code it into your Scratch project using the steps from the article as a guide.
Use the Speed Boost feature you learned about to create a mini-race game. Set up a simple track and see how quickly you can reach the finish line with and without the speed boost. Compare your times and think about how the speed boost changes the game experience.
Design a challenge where you need to collect a certain number of cabbages to win. Use the multiple purchase feature to buy cabbages and track how many you have. Set a goal and see how quickly you can reach it!
Think about a strategy for using single purchase items like the speed boost. When is the best time to buy it? How does it help you in the game? Write a short paragraph explaining your strategy and then test it out in your Scratch project.
Experiment with the shop interface by changing the appearance of the buttons. Try different ghost and brightness effects to see how they affect the look and feel of your shop. Share your design with a classmate and discuss which effects you like best and why.
Sure! Here’s a sanitized version of the transcript:
—
Hey everyone, it’s Zenia here! Today, I want to show you part two of how to make a shop in Scratch. In this part, I’ll demonstrate how to add game upgrades to the shop, how to add items that the player can buy multiple of, and how to create items that the player can only unlock once. So, let’s get started!
I’ll begin with the code from part one. If you haven’t watched that video, I definitely recommend it. Basically, we have a shop that we can open, and there’s a red shirt that we can buy for the player.
Now, let me show you how to add an item that affects gameplay, not just the character’s appearance. For example, I will create a speed boost. To do this, I’ll right-click on the button sprite and click duplicate, which creates a new button I can edit. Here, you can name your item; I’ll call it “Speed Boost” and set the cost to five coins.
Next, we need to change any instance of the price to reflect the cost of the speed boost. I’ll set the variable for coins to decrease by five when the player buys the speed boost. Instead of setting the red shirt variable to true, I will create a new variable called “botSpeedBoost” and set that to true. When the game starts, I will also set “botSpeedBoost” to false, indicating that the player hasn’t bought it yet.
Now, let’s make it so that once the player buys the speed boost, it affects the game. Similar to the red shirt, we can use an if-else block to change the character’s behavior based on whether they have purchased the speed boost. I’ll drag out an if-else block and check if “botSpeedBoost” equals true.
Now we need to decide how the speed boost will affect the character. When the right arrow is pressed, it currently changes the X position by 15. If the player has bought the speed boost, we can change X by 30 instead. This will allow the player to move faster if they have the speed boost.
Let’s also implement this for the left direction. If “botSpeedBoost” equals true, I will change X by -30; otherwise, it will change by -15. Now, the player can move faster in both directions if they have the speed boost.
Next, let me show you how to create an item that the player can buy multiple times. For example, I want the player to be able to buy cabbages. I’ll duplicate the button again and set the cabbage cost to one coin. Instead of setting a variable to true when the player buys a cabbage, I will create a variable called “cabbages” to keep track of how many cabbages the player has bought. When the player buys a cabbage, I will change the “cabbages” variable by one.
Now, the player can buy as many cabbages as they want until they run out of money. When the game restarts, I will reset the “cabbages” variable to zero.
Finally, I want to show you how to add an item to the shop that the player can only buy once. For instance, the speed boost should only be available for purchase once. After the player buys the speed boost, I will hide the button. If the player closes and reopens the shop, the speed boost button should not appear again if they have already purchased it.
To achieve this, I will use an if-else block to check if “botSpeedBoost” is true. If it is, we hide the button; if not, we show it. Now, the speed boost button will hide once it has been purchased.
Additionally, I want to show you how to make the buttons glow when hovered over and how to gray them out if the player doesn’t have enough coins. If the player has fewer coins than the item’s cost, I will set the ghost effect to 40, making it look faded. If they have enough coins, I will set the ghost effect to zero.
To make the buttons glow, I will set the brightness effect to 15 when the mouse pointer is touching the button, and reset it to zero otherwise. The glowing effect will only occur if the player has enough coins to buy the item.
That’s what I wanted to show you for part two of how to make a shop in Scratch! If you have any questions, feel free to let me know. I’ll see you next time, and happy scratching!
—
This version maintains the original content while removing any informal language and ensuring clarity.
Scratch – A programming language that lets you create your own interactive stories, games, and animations. – Example sentence: In Scratch, you can drag and drop blocks to create a fun game.
Shop – A place in a game or app where you can buy items or upgrades using virtual currency. – Example sentence: I went to the shop in the game to buy a new outfit for my character.
Coins – Virtual currency used in games to purchase items or unlock features. – Example sentence: I collected 100 coins to buy a new power-up in the game.
Speed – The rate at which something moves or operates, often used in games to describe how fast a character or object can go. – Example sentence: I increased the speed of my car in the racing game to win the race.
Boost – An increase in power or speed, often used in games to enhance performance temporarily. – Example sentence: I used a speed boost to pass all the other players in the race.
Cabbage – A type of vegetable, sometimes used in coding projects as a fun or random element. – Example sentence: In my coding project, I made a game where the character collects cabbages for points.
Variable – A storage location in programming that holds a value which can change. – Example sentence: I used a variable to keep track of the player’s score in the game.
Button – An interactive element in a program or game that can be clicked to perform an action. – Example sentence: I added a start button to my game so players can begin playing.
Player – A person or character that participates in a game or program. – Example sentence: The player moved through the levels by solving puzzles.
Movement – The action of changing position or location, often controlled by the player in a game. – Example sentence: I programmed the movement of my character to jump over obstacles.