Fiero Code

Code Blocks Cheat Sheet

What each Code Blocks command does, grouped the same way the blocks appear in the editor.

Parentheses mark the slot where a coder types a number, picks a menu option, or drops another block.

Motion Blocks

Move () Steps
Moves the sprite forward the given number of steps in the direction it's facing.
Turn () Degrees (clockwise/counterclockwise)
Rotates the sprite by the given degrees.
Go to X: () Y: ()
Instantly moves the sprite to the given coordinates.
Glide () Secs to X: () Y: ()
Smoothly moves the sprite to coordinates in the specified time.
Point in Direction ()
Rotates the sprite to face a specific direction.
Point Towards ()
Turns the sprite to face another sprite or the mouse pointer.
Change X by () / Change Y by ()
Moves the sprite relative to its current position.
Set X to () / Set Y to ()
Moves the sprite to an absolute position on the stage.
If on Edge, Bounce
Makes the sprite bounce back when it hits the stage's edge.
Set Rotation Style ()
Controls whether the sprite rotates, flips, or doesn't rotate.
X Position / Y Position / Direction
Reports the sprite's position or facing direction.

Looks Blocks

Say () for () Seconds / Say ()
Displays a speech bubble above the sprite.
Think () for () Seconds / Think ()
Shows a thought bubble above the sprite.
Switch Costume to ()
Changes the sprite's costume.
Next Costume
Moves to the next costume in the list.
Switch Backdrop to ()
Changes the stage backdrop.
Change Size by () / Set Size to ()%
Resizes the sprite.
Show / Hide
Makes the sprite visible or invisible.
Go to Front/Back Layer
Moves the sprite's drawing order.
Change () Effect by () / Set () Effect to ()
Adds graphic effects like color, ghost, pixel, etc.
Size / Costume # / Backdrop # / Backdrop Name
Reports the sprite's appearance information.

Sound Blocks

Play Sound () Until Done / Start Sound ()
Plays a sound.
Stop All Sounds
Stops all playing sounds.
Change/Set Volume by ()
Adjusts playback volume.
Volume
Reports current volume level.

Events Blocks

When Green Flag Clicked
Runs script when the project starts.
When () Key Pressed
Runs script when a specific key is pressed.
When This Sprite Clicked
Runs script when sprite is clicked.
When Backdrop Switches to ()
Runs script when backdrop changes.
When () > ()
Runs script when a value (like timer) becomes greater than a number.
Broadcast () / Broadcast () and Wait
Sends a message to trigger scripts across sprites.

Control Blocks

Wait () Seconds
Pauses script.
Repeat ()
Loops instructions a set number of times.
Forever
Runs instructions in a never-ending loop.
If () Then / If () Then Else
Runs code if condition is true.
Wait Until ()
Pauses until condition is true.
Repeat Until ()
Loops until condition is true.
Stop (all/this script/other scripts in sprite)
Stops scripts.
Create Clone of () / Delete This Clone
Makes and removes clones of sprites.
When I Start as a Clone
Runs script when a new clone is created.

Sensing Blocks

Touching ()? / Touching Color ()?
Detects if sprite is touching something.
Color () is Touching ()?
Detects color overlap.
Ask () and Wait / Answer
Prompts the user for input.
Key () Pressed? / Mouse Down? / Mouse X / Mouse Y
Detects input from mouse/keyboard.
Loudness / Timer / Reset Timer
Detects microphone loudness or measures time.
Current ()
Reports date and time info.
Days Since 2000
Reports how many days have passed since Jan 1, 2000.
Username
Reports the player's Scratch username (when logged in).

Operators Blocks

() + () / () - () / () × () / () ÷ ()
Basic math operations.
Pick Random () to ()
Generates a random number.
() < () / () = () / () > ()
Compares two values.
() and () / () or () / not ()
Logic operators.
Join () ()
Combines text together.
Letter () of ()
Reports a specific character from text.
Length of ()
Reports length of text.
() Contains ()?
Checks if text contains something.
() Mod () / Round ()
Reports remainder or rounded value.
Abs / Floor / Ceiling / sqrt / sin / cos / tan / asin / acos / atan / ln / log / e^ / 10^
Math functions.

Variables Blocks

Set [variable] to ()
Sets variable value.
Change [variable] by ()
Increases or decreases variable.
Show Variable / Hide Variable
Displays or hides variable monitor on stage.
[Variable]
Reports the variable's current value.

My Blocks (Custom)

Define ()
Creates a custom block (function).
[Custom block name]
Runs the custom block's instructions.

These blocks are part of Fiero Code.