Page 78 - Digicode_AI_class_4
P. 78
Block Name Shape Function
Cap Block This block stops the script from functioning. It is
Notch at the top shaped in such a way that no other block can be
and flat bottom placed below it.
Scratch blocks are divided into different categories based on their functions. In most of
these blocks, you can change the value in the block to suit your script. Let us learn about
these blocks in detail.
Motion blocks
Motion blocks are used to control the movement of a Sprite. They are blue in colour. Some
motion blocks need values for coordinates and directions.
Coordinates Y
Coordinates are numbers that represent the
3
exact location in the form of (X,Y) coordinates, (2,2)
2
X is the sprite’s horizontal position. The
(-2,1) 1
Y-coordinate is a sprite’s vertical position.
X
X and Y coordinates when written together -3 -2 -1 (0,0) 1 2 3
indicate the exact location or position of the -1
-2
sprite on the stage.
-3
While writing coordinates, the X-coordinate
always comes first, and the coordinates are
separated by a comma. For example, an X- coordinate of 2 and a Y-coordinate of 2 would
look like this: (2, 2). In the very centre of the Stage is a point marked (0, 0), which is called
the origin.
In the same way, Scratch determines the positions on its screen. Positions are known as
pixels in Scratch. The ‘X’ and ‘Y’ positions in Scratch are used to determine the location of
a sprite (object) on the stage.
76 DigiCode AI-IV

