Page 62 - PlusGPT_V2.1_C1_Flipbook
P. 62
CREATING A GAME
Let us create a fidget spinner that spins when touched with the mouse pointer. The first step to create
a fidget spinner is to draw a fidget spinner.
Now create the given script for the fidget spinner to spin.
When you click on the green flag bring the mouse pointer on the fidget spinner sprite, it starts spinning.
Let’s Back-up
The blocks in Scratch are in different shapes. They can be divided into six types of shapes.
Hat blocks always come at the top of a script as they start a script.
Stack blocks perform the main commands.
Boolean blocks are condition blocks which return the values “true” or “false” or the
numbers “0” or “1”
Reporter blocks can hold values, which consist of numbers or strings.
C blocks are loop blocks which check if a condition is true in the blocks within the loop.
The blocks that end scripts are known as CAP blocks.
The sensing blocks in Scratch sense the input from the keyboard or the mouse at the time of
execution of a script.
In scratch, a program is called a Script.
We store data in the computer memory so that we can get information from it later. This
data is stored in variables.
A variable that stores numbers is called a numeric variable.
A variable that stores letters in the form of strings or characters, is called string variable.
Scratch has two conditional blocks: If…then….. and If…then….else block.
You can create games in Scratch by painting a new sprite and a new backdrop.
60 Premium Edition-VI

