Today, we are going to create a fun and interactive game called 'Balloon Pop'. In this game, you will see colorful balloons floating around the screen. Your task is to pop these balloons by clicking on them.
The fun part is, the balloons will keep appearing in random positions and they will move around, just like real balloons flying in the sky! This will test your speed and accuracy. So, are you ready to create your own balloon popping game? Let's get started!
Go to the Scratch website and create a new project and delete the cat sprite.
Go to the Scratch website using the link below and click on the 'Create' link in the blue bar at the top.
By default, each new project starts with the cat sprite already added. To delete the cat click on the x in the blue circle beside the cat in the sprite list.
Open up the sprite library and add in the Balloon1 sprite.
To add a sprite from the sprite library follow these steps:
You can use search box or the filter links (Animals, People, Fantasy etc) to locate your sprite.
In this game, we will be making lots of copies of the balloon sprite so we can try and pop them! These copies are called clones. Just like in a cartoon, where a character can make copies of themselves, in Scratch we can make a sprite make copies of itself. This is what the create clone of myself
block does. It tells the balloon sprite to make a copy of itself.
First, let's hide the original balloon sprite and set its size to 50%. To do this, add this code to the balloon sprite.
when green flag clicked
set size to (50) %
hide
Next, we want to keep creating clones every few seconds. To do this, we have to add a forever block
to the previous code.
when green flag clicked
set size to (50) %
hide
forever // add new code under here
end
Inside the forever block, we can add the wait
and the create clone
blocks. These will handle the creation of clones every few seconds.
when green flag clicked
set size to (50) %
hide
forever
wait(5) seconds
create clone of (myself v)
hide
block and although there is a new balloon created every 5 seconds, we can't see them yet because we are creating copies of a hidden balloon!Now, let's make the balloon copies show up on the screen. They will appear in different places each time.
First, we need to use a special block called when I start as a clone
. This block tells Scratch what to do when a new balloon copy is made.
We also need to use the show
block. This block makes the balloon copy appear on the screen. It's like magic!
Finally, we use the go to [random position]
block. This block tells the balloon copy to go to a different place on the screen each time it appears.
Add this code to the balloon sprite:
when I start as a clone
go to [random position v]
show