Page 83 - TP-Play_V-2.0_Book-5
P. 83
Reporter Blocks
3 3
Reporter blocks can hold values, which consist of numbers or strings. If
you ask, “What is 3 + 3 ?”, it will answer “6”. They have rounded edges.
6
C Blocks
As the name suggests C blocks are C shaped. They are also repeat 10
known as Wrap blocks. These are loop blocks to check if a
condition is true in the blocks within the loop. The C blocks are
present in the Control blocks category.
CAP Blocks
The blocks that end scripts are known as CAP blocks. They have a
delete this clone
notch at the top and a flat bottom. They are usually the last blocks
in the script. They are also present in the Control blocks category.
SENSING BLOCKS
Sensing blocks in Scratch sense the input from the keyboard or the mouse at the
time of execution of a script. Some of the sensing blocks and their functions are
given below:
ask What’s your name? and wait block prompts the user to type the input using the
keyboard. It waits for the user input. No other block runs at that time.
touching mouse-pointer ? block checks if the sprite touches the mouse-pointer,
another sprite or the edge. If the answer is true, then it executes the blocks given
after it in the condition. If false, then it executes other blocks as per the given
condition.
touching ? block checks if the sprite is touching the color chosen in the block.
If true, then it executes a set of blocks, else executes another set of blocks.
color is touching ? The block checks if the first chosen color is touching the
second chosen color. If true, then it executes a set of blocks, else executes
another set of blocks.
key space pressed? block checks if the chosen key is pressed by the user. If true,
then it executes a set of blocks, else executes another set of blocks.
Let us create a small script to understand the working of sensing blocks.
Sensing an Input
To add sensing blocks to the script, follow the given steps:
Step 1 Click on the Sensing block category in Tabs.
Creating a Game in Scratch 83

