Page 138 - TGPT_V5.0_C5_Flipbook
P. 138
CREATING A GAME
Let us create a simple game.
Create the given scripts:
Cat sprite
Arrow sprite
Earth sprite
Click on the Green Flag to play the ping pong game using Spacebar key.
Timeline
Operators Blocks are used to do arithmetic and logical calculations.
Variables are the data values for which the value can be changed when the code is being
processed.
The statements that are executed on the basis of decision taken from a choice are called
conditional statements.
The automatic running of a set of instructions more than once is called looping.
The sensing blocks in Scratch sense the input from the keyboard or the mouse at the time
of execution of a script.
We store data in the computer memory so that we can get information from it later. This
data is stored in variables.
Scratch has two conditional blocks: If…then….. and If…then….else block.
The broadcast block is used to send a message from one sprite to other sprites. It allows
different sprites to communicate and trigger actions based on the message.
136 Premium Edition-V

