In this article, I will explain How to Create Moving Balloons Project in Scratch 3.0. Basically, the application demonstrates how to control the motion of a sprite using various types of block commands. Also, you can view this project here.
The Steps Describing How to Create Moving Balloons Project in Scratch 3.0
At first, we need to select a backdrop, that you can do as follows. In fact, you can find the backdrop icon at the bottom right corner of the editor.
After that, we need to determine what types of sprites should be used in the project. Therefore, we click on the sprite icon which is also available at the bottom right corner of the editor nearby to the backdrop icon. So, we have selected the balloon sprite.
In order to have three more similar balloons, we need to right-click the ballon sprite and select the Duplicate option. It will create a duplicate sprite in the project as shown below.
For the purpose of changing the color of a balloon, click the corresponding sprite and then select the Costume option to manipulate the appearance of the sprite.
Now that, we have four balloons of different colours, we need to create a script for each. So, click on the first balloon sprite and create its scripts using block commands.
As can be seen, the code starts executing when the user clicks on the green flag. Further, the balloon glides to a random value of x and y coordinates on the stage for 0.1 seconds and waits for a small duration, As shown in the following script blocks, this action will repeat forever.
However, the second sprite performs more actions of the movement. As can be seen in the following sprite blocks, it will go to the first balloon and then it will go to a random x and y location. This sequence of actions repeats a random number of times from 1 to 100. Further, the sprite will go to the third balloon. But it will glide for a random duration. The whole sequence repeats forever.
Likewise, the third balloon sprite performs actions similar to the first one. However, it will go to a random location instead of gliding. The following script blocks demonstrate the actions of the third balloon.
Similarly, the fourth balloon sprite performs actions similar to the second one. However, it goes to each of the balloons first and then it turns to an angle of a random degree before moving further. The following script blocks demonstrate the actions of the fourth ballon sprite.