Page 63 - 2501_KVS_C-5
P. 63
Gowri: See the coding on the sprite “spaceship” in Fig. (6.4) where “Key pressed?” block is used
and then chose the options “left arrow”, “right arrow”, “up arrow” and “down arrow” one by one
in different “if... Then...” block. The coding on the sprite “missile” is shown in Fig. (6.5) where
“Key pressed?” block is used in “if... Then...” block and then choose “space key” option.
Fig. 6.4 Fig. 6.5
Activity 6.4
Add two persons as sprites in your Project, facing each other and move
towards each other 5 Steps when space key is pressed.
Write the script for creating a clone of itself when sprite is clicked and
delete its clones when down arrow is pressed.
Aryan: Oh wow! I have understood now, but please tell me how to calculate the
score in the project and how life of the “spaceship” will be decreased, each time
when it hits by the planet.
Gowri: Yes, dear, we can do that, with the help of variables.
Scratch 61

