How to Make a Shop in Scratch – Part 2 | Tutorial

Alphabets Sounds Video

share us on:

In this lesson, Zenia guides us through enhancing a shop in Scratch by adding new features such as a “Speed Boost” item that alters gameplay, items that can be purchased multiple times (like cabbages), and exclusive items that can only be bought once. Additionally, she demonstrates how to improve the shop interface by making buttons interactive based on the player’s coin balance and adding visual effects when the mouse hovers over them. This part builds on the foundational code from the previous lesson, allowing for a more dynamic shopping experience in the game.

How to Make a Shop in Scratch – Part 2

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!

Starting with the Basics

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.

Adding a Speed Boost

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:

  • Right-click on the button sprite and select “duplicate” to make a new button.
  • Name the new item “Speed Boost” and set its cost to five coins.
  • Change the variable for coins to decrease by five when the player buys the speed boost.
  • Create a new variable called “botSpeedBoost” and set it to true when purchased. Initially, set it to false.

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:

  • When the right arrow is pressed, change X by 30 if the speed boost is active, otherwise by 15.
  • Do the same for the left arrow, changing X by -30 or -15.

Buying Multiple Items

Next, let’s create an item that players can buy multiple times, like cabbages:

  • Duplicate the button again and set the cabbage cost to one coin.
  • Create a variable called “cabbages” to track how many cabbages the player buys.
  • Increase the “cabbages” variable by one each time a cabbage is purchased.
  • Reset the “cabbages” variable to zero when the game restarts.

Single Purchase Items

Now, let’s make an item that can only be bought once, like the speed boost:

  • After purchasing the speed boost, hide the button.
  • If the shop is reopened, check if “botSpeedBoost” is true. If it is, keep the button hidden.

Enhancing the Shop Interface

Finally, let’s make the shop buttons more interactive:

  • If the player doesn’t have enough coins, set the button’s ghost effect to 40 to make it look faded.
  • If they have enough coins, set the ghost effect to zero.
  • Make the buttons glow by setting the brightness effect to 15 when the mouse is over them, and reset it to zero otherwise.

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!

  1. What new insights did you gain about creating interactive features in Scratch from this article?
  2. How do you think the addition of a “Speed Boost” can enhance the gameplay experience for players?
  3. Reflect on the process of duplicating sprites and modifying them. How does this technique contribute to efficient game development in Scratch?
  4. What challenges might arise when implementing items that can be purchased multiple times, and how would you address them?
  5. Consider the concept of single purchase items. How does this feature impact the player’s strategy and decision-making in the game?
  6. How does enhancing the shop interface with visual effects, like ghost and brightness, improve user interaction and engagement?
  7. In what ways do you think these shop features could be expanded or improved in future iterations of the game?
  8. Reflect on your own experiences with game development. How might the techniques discussed in this article influence your future projects?
  1. Create Your Own Shop Item

    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.

  2. Speed Boost Race

    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.

  3. Multiple Purchases Challenge

    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!

  4. Single Purchase Strategy

    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.

  5. Shop Interface Design

    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.

ScratchA 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.

ShopA 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.

CoinsVirtual 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.

SpeedThe 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.

BoostAn 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.

CabbageA 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.

VariableA 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.

ButtonAn 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.

PlayerA person or character that participates in a game or program. – Example sentence: The player moved through the levels by solving puzzles.

MovementThe 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.

All Video Lessons

Login your account

Please login your account to get started.

Don't have an account?

Register your account

Please sign up your account to get started.

Already have an account?