Blocks and script stacks
A stack block performs an action. A hat block starts a script. A control block can contain other blocks. Thinking in those shapes is easier than thinking about syntax.
11 minreading time
Beginnerdifficulty
MODU docssource
SCHX nativeruntime
SCHX / FEATURE LAYER
A block is one instruction
A stack block performs an action. A hat block starts a script. A control block can contain other blocks. Thinking in those shapes is easier than thinking about syntax.
blockswhen green flag clicked
move steps
repeat timesSCHX / FEATURE LAYER
Stacks run in order
For ordinary stack blocks, Blocks Studio reads from the top toward the bottom. A wait pauses that script; another event stack can still exist independently.
SCHX / FEATURE LAYER
Nested control blocks
Repeat, Forever, If and If/Else have space for child blocks. Those children belong to the control structure instead of the outer stack.
blocksrepeat times
forever
if left operator right
if left operator right elseSCHX / FEATURE LAYER
Keep scripts readable
Use multiple event stacks for separate jobs instead of creating one gigantic script that controls the whole game.
- One script for input.
- One script for animation.
- One script for score/game state.
SCHX / FEATURE LAYER