Blocks are puzzle-piece shapes that are used to create code in Scratch. The blocks connect to each other vertically like a jigsaw puzzle, where each data type (hat block, stack block, reporter block, boolean block, or cap block) has its own shape and a specially shaped slot for it to be inserted into, which prevents syntax errors. Series of connected blocks are called scripts.
Blocks by Category
The block palette is under the Code tab. It consists of different palettes such as Motion, Sound, and Control. Each palette has different blocks that perform functions specified by the palette name. E.g., the blocks in the Motion palette will control the motion of the sprite and the blocks in the Control palette will control the working of the script depending on specific conditions.
Below is the list of palettes and the functions their blocks perform:
Block Category | Color | Function |
---|---|---|
Motion Block | Medium Blue | To control sprite's movement |
Looks Block | Violet | To control sprite's appearance |
Sound Block | Light Purple | To play sound. Explore Sounds tab to record, upload a music or edit sounds. |
Control Block | Burnt Orange | To control the flow of script (using conditions) |
Event Block | Occur Yellow | To sense events, which trigger scripts to run. These are essential for every project |
Sensing Block | Light Blue | To detect different factors of a project |
Operator Block | Light Green | To do math calculations and handle strings |
Variables Block (Data Block) | Orange | To hold values and string in variables and display them on the screen |
My Blocks | Light Pink | To make custom blocks |
Block by Shape
There are six different types of blocks classified on the basis of their shapes:
Block Type | Shape | Function |
---|---|---|
Hat Block | ![]() | These blocks start every script. Because of the shape you can only place blocks below it. |
Stack Block | ![]() | These blocks perform main commands. Blocks can be placed above and below them. |
C Block | ![]() | Blocks placed inside the C block are executed in loop (again and again). |
Cap Block | ![]() | These block end scripts. No block can be placed below these blocks. |
Boolean Block | ![]() | These block output only ‘True’ or ‘False’. These are identified by hexagonal shape. |
Reporter Block | ![]() | These block outputs values, both number and strings (collection of characters). They are rounded at edges. |