100% found this document useful (1 vote)
1K views4 pages

Motion Blocks

The document provides an overview of Scratch coding blocks, which are puzzle-piece shapes used to create scripts without syntax errors. It categorizes blocks into types such as Command, Hat, C, Boolean, and Reporter blocks, detailing their functions and examples. Additionally, it describes various categories of blocks including Motion, Looks, Sound, Event, and Control blocks, each with specific functionalities for controlling sprite behavior and interactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views4 pages

Motion Blocks

The document provides an overview of Scratch coding blocks, which are puzzle-piece shapes used to create scripts without syntax errors. It categorizes blocks into types such as Command, Hat, C, Boolean, and Reporter blocks, detailing their functions and examples. Additionally, it describes various categories of blocks including Motion, Looks, Sound, Event, and Control blocks, each with specific functionalities for controlling sprite behavior and interactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

SCRATCH CODING BLOCKS

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 block type has its own shape and its own slot shape
for it to be inserted into, which prevents syntax errors. Series of connected blocks are called scripts.
Types of Blocks in Scratch
TYPE IMAGE FUNCTION
 Command blocks have notches at the top and
Command bumps on the bottom.
Blocks  They are also known as Stack blocks.
 There are 62 Stack blocks.
 These blocks are called “hats” blocks. Hat blocks are
the blocks that start every script. They are shaped
Blocks which with a rounded top and a bump at the bottom so
link events with you can only place blocks below them.
the running of  There are eight Hat blocks in the Scratch editor, six
the program of which are in the Events category, one in
the Control category, and one in the category My
Blocks (if one has created one custom block).
These sets of blocks are known as C blocks. They are
Blocks which blocks that take the shape of "C's". Also known as
control the "Wrap blocks", these blocks loop the blocks within the
running of the Cs or check if a condition is true. There are five C
program blocks, and they can be found in the Control category. C
blocks can be bumped at the bottom, or capped.
Boolean blocks are conditions — they are either true
or false. Think of them as "yes-no" questions. For
example, if you asked a computer "does 2 + 2 = 4?", it
would either tell you "True" or "False". With a
hexagonal shape, there are 14 of these blocks.
Blocks which
Reporter blocks are the values. Reporter blocks can
report a certain
hold numbers and strings. It is like asking a friend, for
value (function
example, "What is 2 + 2?", and they would answer "4".
blocks)
It can also report a variable. For example, "What is your
age?" and they may answer: "15". Shaped with
rounded edges, there are 34 of these blocks — not
counting the theoretically infinite amount of Reporter
blocks that can be made for each variable and list.

BLOCK CATEGORIES
A. MOTION BLOCKS - Code blocks that control sprite placement, direction, rotation, and
movement.
1. Move (10) steps: This block moves the sprite forward in the direction it is facing by a specified
number of steps. Positive values move the sprite forward, while negative values move it
backward.
2. Turn right (15) degrees: As mentioned earlier, this block rotates the sprite clockwise by a
specified angle.
3. Turn left (15) degrees: Similarly, this block rotates the sprite counterclockwise by a specified
angle.
4. Point in direction (90): This block sets the direction the sprite is facing to an exact angle. For
example, "Point in direction (90)" would make the sprite face to the right.
5. Point towards (Sprite): This block makes the sprite point towards another sprite on the stage.
It adjusts the sprite's direction to face the target sprite.
6. Go to (x: 0, y: 0): This block instantly moves the sprite to a specific position on the stage,
specified by the x and y coordinates.
7. Glide (1) secs to (x: 100, y: 100): As discussed earlier, this block smoothly moves the sprite to a
specific position on the stage over a specified duration of time.
8. Change x by (10): This block changes the sprite's horizontal position (x-coordinate) by a
specified amount. Positive values move the sprite right, while negative values move it left.
9. Set x to (0): This block sets the sprite's horizontal position (x-coordinate) to a specific value.
10. Change y by (10): Similarly, this block changes the sprite's vertical position (y-coordinate) by a
specified amount. Positive values move the sprite up, while negative values move it down.
11. Set y to (0): This block sets the sprite's vertical position (y-coordinate) to a specific value.
12. If on edge, bounce: This block checks if the sprite is touching the edge of the stage. If it is, the
sprite will bounce off the edge instead of moving further.
13. Glide (1) secs to (random position): This block smoothly moves the sprite to a randomly
selected position on the stage over a duration of 1 second. This creates a smooth transition
from the current position to the new one.
14. Go to (random position): This block instantly moves the sprite to a randomly selected position
on the stage. Unlike the "glide" block, there's no smooth transition here; the sprite
immediately appears at the new position.
15. Set rotation style (left-right): This block sets the rotation style of the sprite. In this case, "left-
right" means the sprite will only be able to face left or right. When the sprite moves vertically, it
won't rotate to match the direction of movement. This is useful for certain types of games or
animations where you want sprites to face a specific direction regardless of movement.
B- LOOKS BLOCKS - Blocks used to control the appearance and visual effects of sprites.
1. Say "Hello!" for (2) seconds: This block displays a speech bubble with the specified text
("Hello!") above the sprite for a duration of 2 seconds. It's useful for adding dialogue or text-
based interactions in a project.
2. Say (Hello!): This block displays a speech bubble with the specified text ("Hello!") above the
sprite. Unlike the "Say for (2) seconds" block, this block does not have a duration and will
disappear after a short moment.
3. Think "Hmm..." for (2) seconds: Similar to the "say" block, this block displays a thought bubble
with the specified text ("Hmm...") above the sprite for a duration of 2 seconds. It's often used
to show internal thoughts or considerations by a character.
4. Think (Hmm...): Similar to the "Say" block, this block displays a thought bubble with the
specified text ("Hmm...") above the sprite. Like the "Say" block, it also does not have a
duration.
5. Switch costume to "Costume1": This block changes the appearance of the sprite to a different
costume named "Costume1." Sprites in Scratch can have multiple costumes, allowing them to
change appearance dynamically during a project.
6. Next costume: This block switches the sprite's costume to the next one in its costume list. It's
useful for creating animations or cycling through different visual states of a sprite.
7. Switch backdrop to "Backdrop1": This block changes the background of the stage to a different
backdrop named "Backdrop1." Backdrops in Scratch allow you to set the scene or environment
for your project.
8. Next backdrop: block in Scratch is a control block that switches the stage to the next backdrop
in the backdrop list. This block is particularly useful for creating projects with multiple scenes or
for creating animations with changing backgrounds. When executed, it cycles the stage through
its backdrop list, transitioning from the current backdrop to the next one in the sequence.
9. Change size by (10): This block adjusts the size of the sprite by increasing or decreasing its size
by the specified amount. Positive values make the sprite larger, while negative values make it
smaller.
10. Set size to (100%): This block sets the size of the sprite to a specific percentage of its original
size. For example, "Set size to (50%)" would shrink the sprite to half its original size, while "Set
size to (200%)" would double its size.
11. Change colour effect by (25): This block adjusts the colour effect applied to the sprite by
increasing or decreasing it by the specified amount. Colour effects include brightness, ghost
effect (transparency), and fisheye distortion.
12. Set colour effect to (0): This block sets the colour effect applied to the sprite to a specific value.
For example, "Set colour effect to (0)" removes any applied colour effects, returning the sprite
to its default appearance.
13. Clear graphic effects: This block removes all graphic effects applied to the sprite, resetting it to
its default appearance.
14. Show: This block makes the sprite visible on the stage. If the sprite was previously hidden using
the "hide" block, this block will undo that action.
15. Hide: This block makes the sprite invisible on the stage. It's commonly used to hide sprites
when they are not needed, such as during transitions or when they are not active in the scene.
16. Go to (front) layer: Brings your sprite to the foreground, layering it on top of others.
17. Go (forward) (1) layers: This is used to control the layering or stacking order of sprites on the
stage. It allows you to move a sprite forward or backward by a specified number of layers.
C- SOUND BLOCKS – Blocks used to incorporate audio into your projects. They let you play sounds,
control
1) Play sound "pop" until done: This block plays a sound named "pop" continuously until it
finishes playing.
2) Start sound (meow): A sound block used to initiate the playback of a sound named "meow"
in your project. When this block is executed, it triggers the playback of the specified sound
once.
3) Stop all sounds: This block stops all currently playing sounds in the project.
4) Set volume to (100)%: This block sets the volume level of all sounds in the project to a
specific percentage.
5) Change volume by (10): This block adjusts the volume level of all sounds in the project by a
specified amount.
6) Clear sound effects: Clears any filters or effects applied to sounds.
7) Change () Effect by (10): This block allows you to modify various sound effects applied to
sounds being played.
8) Set (pitch) effect to (100): A sound effect block used to directly set the pitch of currently
playing sounds in the project to a specific value.
9) Volume: This block reports the current volume level of all sounds in the project.
D- EVENT BLOCKS:
1) When Green Flag Clicked: This block is used to start the execution of the program. When
the green flag in the Scratch stage is clicked, all the code blocks attached to this event block
will be executed.
2) When this Sprite Clicked: This block triggers when the sprite (character or object) is clicked
by the user.
3) When [ ] Key Pressed: This block allows you to specify actions that occur when a certain key
on the keyboard is pressed.
4) When Backdrop Switches to [backdrop 1]: This block is used to trigger code when the stage
background changes to a specific backdrop.
5) When [loudness] > [10]: This block is a conditional trigger that activates when the loudness
level detected by the microphone exceeds a specified threshold, in this case, 10.
6) When I Receive Message: This block is used for inter-sprite communication. It triggers when
a sprite receives a message broadcasted by another sprite.
7) Broadcast [message 1]: This is used for communication between sprites within your project.
This block acts like a transmitter, sending a specific message (in this case, "message 1") to all
the sprites and the backdrop in your project.
8) Broadcast [message 1] and wait: This block is useful when you want the current sprite to
wait for other sprites to respond or perform certain actions before continuing its own script
execution.
E- CONTROL BLOCKS
1) Wait [1] seconds: Pauses the program for a specified number of seconds.
2) Repeat [10]: This block makes a section of code run a specific number of times you choose.
3) Forever: This block makes a section of code run indefinitely, essentially creating a
continuous loop until the program is stopped.
4) If [condition] then: This block checks if a condition is true (like "if touching sprite"). If it's
true, the code within the block runs.
5) If [condition] Then Else: Checks a condition, and if it's true, executes one set of blocks;
otherwise, executes another set of blocks.

You might also like