Note

Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.

Why Join?

  • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.

  • Learn & Share: Exchange tips and tutorials to enhance your skills.

  • Exclusive Previews: Get early access to new product announcements and sneak peeks.

  • Special Discounts: Enjoy exclusive discounts on our newest products.

  • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions.

👉 Ready to explore and create with us? Click [here] and join today!

Clicker Game¶

Description¶

Today we will play a game of poking balloons.

Click the green flag to start.

Or click Clicker Game, and then learn online tutorial on the Scratch official website.

Required Components¶

  • A Screen

  • Scratch 3 (either online or offline)

You Will Learn¶

  • Pick random number.

  • Change the position, size and color of the sprite.

  • Make a variable.

Lesson Guide¶

Let the balloons appear randomly.¶

First, add Balloon1 sprite and Colorful City backdrop.

../../_images/clicker_game1.png

Set the balloon to a random position.

../../_images/clicker_game2.png

Let it change the color and size randomly.

../../_images/clicker_game3.png

Now, run the green flag and you can see the balloons randomly change in the stage area.

Click on the balloon to add score.¶

Now, we need to establish a scoring mechanism. Whenever the balloon is clicked, the score will increase by one.

Create a variable (it can help us keep track of and store the score). In Variables, select 「Make a Variable」 and named score.

../../_images/clicker_game4.png

We will see it in the upper left corner of the stage.

../../_images/clicker_game5.png

When the balloon is clicked, the score is increased by one. When you click the green flag (the game starts), the score will be reset to zero.

../../_images/clicker_game6.png

Now, click the green flag above the stage area to start the game, and click the balloon to increase your score!

Challenge¶

I believe that you will be smart enough to program and implement this game soon. Next, we will add some challenges to enrich our game content.

  • When the balloon is clicked, the sound effect of “POP” is emitted.

  • Let the Pufferfish sprite appear randomly on the stage as well, if you click on it, you will lose score!