BLOCK TYPES IN SCRATCH
When the Scratch editor is
opened, ten color-coded block
categories in the middle of the
editor workspace will appear.
Clicking each category will
show the blocks that are under
each of these.
Motion blocks dictate how a sprite should move. There are 17
Motion blocks in the current version of Scratch (2.0). Motion blocks
are colored medium blue.
Looks blocks control a sprite’s appearance. In Scratch 2.0, there are
22 Looks blocks; of the 22, 14 are dedicated to sprites while 4 are
strictly for the Stage.
The 13 Sound blocks are colored magenta and are used to
control sound functions.
Pen blocks are colored dark green and control the Pen functions,
which are commonly used to generate geometric patterns in
Scratch.
There are two kinds of Data blocks in Scratch:
Variable blocks are colored orange and are used to hold
values and strings in variables.
List blocks are colored dark red, and are used to work with
lists. All in all, there are 15 Data blocks.
Events blocks let the Scratch editor sense if an event has
happened, as well as trigger scripts to run.
Control blocks are gold in color and provide control to scripts.
Included in the Control blocks category are the Control C
blocks, which allow Looping and If/Then/Else arguments.
Sensing blocks are used to detect different factors of a project.
Examples of the variables that Sensing blocks are used for are the
position of a sprite or the mouse pointer or the loudness of sound.
The 20 Sensing blocks in Scratch are colored light blue.
Scratch’s Operators blocks handle strings like Boolean inputs,
and are also used to script math equations. There are 17 Operators
blocks, and these are color-coded green.
Custom blocks, accessible through the More blocks category, let
you create a code block with its own unique functionality. Several
of these blocks can be combined to create the code that makes up
a single custom block, which can then be reused to simplify a
block stack.
BLOCK SHAPES
COMMAND BLOCKS
Command blocks, also called Stack blocks,
have the most common type of block shape in
Scratch. A command block has a notch on top
of the block, and a node at the bottom that joins
with other blocks. Command blocks do not
belong to only one category.
TRIGGER BLOCKS
Trigger blocks tell the Scratch editor that you
are about to start creating a script and that you
are indicating the action that will start the chain
of events that follow.
Trigger blocks are placed on top of a stack of
blocks and have a domed upper side instead of
the notch found in Command blocks; for these
reasons, they are also called Hat blocks. You
won’t be able
to place any block over Hat blocks.
FUNCTION BLOCKS
Function blocks are a special class of Scratch block
which are used to change how some Stack blocks
behave. Unlike Command blocks or Hat blocks,
Function blocks do not go on top of other blocks.
Instead, they slot into spaces found on particular
kinds of blocks to work. Function blocks are found at
the bottom of the block categories.
Reporter blocks are blocks that contain
values. These blocks use values that can be
anything from variables, numbers, and
even strings. Because they contain values,
reporter blocks need to be joined with
other blocks for these to work. They cannot
be placed on top of other blocks, unlike
Stack blocks.
A Boolean block is a
Function block that carries a
condition instead of a value.
Like the Boolean elements
used in flowcharts, these
blocks need to answer if a
condition is TRUE or
FALSE.
CONTROL BLOCKS
C Blocks, are so named because of the opening on one side that allows
users to put blocks in, making them look like the letter C.
Cap blocks are the other kind of Control block in Scratch.
These are used to stop a script or a project from running.
CODING IN SCRATCH
DELETING BLOCKS
1. click and drag the block to be deleted to another part of
the Scripts tab; note that all of the blocks under it will
likewise go along with it.
2. Deleting the block with the other blocks attached to it
will delete all of the blocks,
3. Click and drag on the blocks which are to be kept. With
the block to be deleted now isolated,
4. right-click on it and then select Delete, after which the
other blocks can be placed back where they should be.
• The Set Rotation Style block
keeps the sprite facing only left
or right, depending on the mouse
pointer.
• The Point in direction block
keeps the sprite vertical.
• The “if on edge, bounce” block
keeps the sprite from going past
the edges of the Stage.
CUSTOM CODE BLOCKS
To define a Custom block, select the More
blocks category from the Palette, then click on
Make a Block.
Give a name for your block in the box that
appears next, then click OK.
Pen down and Pen up blocks are used to
draw lines, while the Repeat blocks
instruct the sprite to move four times to
draw
the sides of the square.
Drag a copy of the Size operator to the slot
in the Move () block for Scratch to know
that it needs to make the square the same
size as the number.
Add a Hat block, then click on the More
blocks category.
Thank you