Data Sheet

ADVENTURES IN RASPBERRY PIBC4
Bonus chapter.indd 4 Trim size: 7.375 in × 9.1875 in October 24, 2017 7:20 PM
Scratch Command Quick Reference Table
Command Description
Control Blocks
broadcast x
Sends a message to all the sprites and the stage
which can be used to synchronize scripts across
multiple sprites and the stage.
forever
Repeatedly iterates actions within set.
forever if
Checks whether a condition is true, over and over.
If the condition is true the program runs the blocks
inside.
if...else
If the condition is true, the program runs the blocks
inside the if section. If not, it runs the blocks inside
the else section.
repeat x
Sets number of times for action to repeat.
stop all
Stops all scripts for all sprites.
wait x secs
Sets time before executing next command.
when
clicked
Begins script when green ag icon is clicked.
when I receive x
Begins script when a set broadcast message is
heard.
When x key pressed
Begins script when designated key is pressed.
Motion Blocks
change x by _
Changes sprite’s position on the stage x axis by a
specied amount.
change y by _
Changes sprite’s position on the stage y axis by a
specied amount.
go to x:_ y:_
Moves sprite to set x and y coordinates on the
stage.
if on edge, bounce
Turns sprite in the opposite direction if it touches
the edge of the stage.
move x steps
Moves sprite forward or backwards x number of
steps.
point in direction x
Points sprite in direction x.
point towards x
Points sprite towards another sprite or a mouse
cursor.
set x to _
Sets sprite’s position on the stage x axis to a
designated place.
set y to _
Sets sprite’s position on the stage y axis to a
designated place.
turn (clockwise) x degrees
Rotates sprite clockwise x degrees.
turn (anti‐clockwise) x
degrees
Rotates sprite anti-clockwise x degrees.
Chapter 3