< Scratch File Format (2.0)

The following is a list of block selectors and their corresponding blocks. Block selectors are used in the Scratch File Format (2.0).

Only blocks which can be loaded in the most recent version of Scratch 2.0 are listed.

Motion Blocks

Block Selector
move () steps forward:
turn cw () degrees turnRight:
turn ccw () degrees turnLeft:
point in direction ( v) heading:
point towards [ v] pointTowards:
go to x: () y: () gotoX:y:
go to [ v] gotoSpriteOrMouse:
glide () secs to x: () y: () glideSecs:toX:y:elapsed:from:
change x by () changeXposBy:
set x to () xpos:
change y by () changeYposBy:
set y to () ypos:
if on edge, bounce bounceOffEdge
set rotation style [ v] setRotationStyle
(x position) xpos
(y position) ypos
(direction) heading

Events Blocks

Block Opcode
when gf clicked whenGreenFlag
when [ v] key pressed whenKeyPressed
when this sprite clicked whenClicked
when backdrop switches to [ v] whenSceneStarts
when [ v] > () whenSensorGreaterThan
when I receive [ v] whenIReceive
broadcast [ v] broadcast:
broadcast [ v] and wait doBroadcastAndWait

Looks Blocks

Block Opcode
say [] for () seconds say:duration:elapsed:from:
say [] say:
think [] for () seconds think:duration:elapsed:from:
think [] think:
show show
hide hide
switch costume to [ v] lookLike:
next costume nextCostume
switch backdrop to [ v] startScene
switch backdrop to [ v] and wait startSceneAndWait
next backdrop nextScene
change [ v] effect by () changeGraphicEffect:by:
set [ v] effect to () setGraphicEffect:to:
clear graphic effects filterReset
change size by () changeSizeBy:
set size to ()% setSizeTo:
go to front comeToFront
go back () layers goBackByLayers:
costume # costumeIndex
backdrop name sceneName
backdrop # backgroundIndex
size scale

Control Blocks

Block Opcode
wait () secs wait:elapsed:from:
repeat () doRepeat
forever doForever
if <> then doIf
if <> then
else
doIfElse
wait until <> doWaitUntil
repeat until <> doUntil
stop [ v] stopScripts
when I start as a clone whenCloned
create clone of [ v] createCloneOf
delete this clone deleteClone

Sound Blocks

Block Opcode
play sound [ v] playSound:
play sound [ v] until done doPlaySoundAndWait
stop all sounds stopAllSounds
play drum ( v) for () beats playDrum
rest for () beats rest:elapsed:from:
play note ( v) for () beats noteOn:duration:elapsed:from:
set instrument to ( v) instrument:
change volume by () changeVolumeBy:
set volume to ()% setVolumeTo:
volume volume
change tempo by () changeTempoBy:
set tempo to () bpm setTempoTo:
tempo tempo

Sensing Blocks

Block Opcode
<touching [ v]?> touching:
<touching color [#000000]?> touchingColor:
color [#000000] is touching [#000000]? color:sees:
distance to [ v] distanceTo:
ask [] and wait doAsk
answer answer
<key [ v] pressed?> keyPressed:
<mouse down?> mousePressed
(mouse x) mouseX
(mouse y) mouseY
(loudness) soundLevel
video [ v] on [ v] senseVideoMotion
turn video [ v] setVideoState
set video transparency to ()% setVideoTransparency
(timer) timer
reset timer timerReset
[ v] of [ v] getAttribute:of:
current [ v] timeAndDate
(days since 2000) timestamp
(username) getUserName

Pen Extension

Block Opcode
clear clearPenTrails
stamp stampCostume
pen down putPenDown
pen up putPenUp
set pen color to [#FF0000] penColor:
change pen color by () changePenHueBy:
set pen color to () setPenHueTo:
change pen shade by () changePenShadeBy:
set pen shade to () setPenShadeTo:
change pen size by () changePenSizeBy:
set pen size to () penSize:

Operators Blocks

Block Opcode
() + () +
() - () -
() * () *
() / () /
pick random () to () randomFrom:to:
[] \< [] <
[] = [] =
[] > [] >
<> and <> &
<> or <> |
not <> not
join [] [] concatenate:with:
letter () of [] letter:of:
length of [] stringLength:
() mod () %
round () rounded
[ v] of ():: operators computeFunction:of:

Variables Blocks

Variables Blocks (subcategory)

Block Opcode
(:: variables) readVariable
set [ v] to [] setVar:to:
change [ v] by () changeVar:by:
show variable [ v] showVariable:
hide variable [ v] hideVariable:

List Blocks

Block Opcode
(:: list) append:toList:
add [] to [ v] contentsOfList:
delete ( v) of [ v] deleteLine:ofList:
insert [] at ( v) of [ v] insert:at:ofList:
replace item ( v) of [ v] with [] setLine:ofList:to:
item ( v) of [ v] getLine:ofList:
length of [ v] lineCountOfList:
[ v] contains []? list:contains:
show list [ v] showList:
hide list [ v] hideList:

My Blocks

Block Opcode
define procDef
:: custom call
(:: custom), <:: custom> getParam

Obsolete Blocks

Block Opcode
play drum () for () beats:: obsolete drum:duration:elapsed:from:
set instrument to ():: obsolete midiInstrument:
<loud?:: obsolete> isLoud
(noop:: obsolete) COUNT
clear counter:: obsolete CLR_COUNT
incr counter:: obsolete INCR_COUNT
for each [ v] in [] {
}:: obsolete
doForLoop
while <> {
}:: obsolete
doWhile
all at once {
}:: obsolete
warpSpeed
scroll right ():: obsolete scrollRight
scroll up ():: obsolete scrollUp
align scene [ v]:: obsolete scrollAlign
(x scroll:: obsolete) xScroll
(y scroll:: obsolete) yScroll
hide all sprites:: obsolete hideAll
(user id:: obsolete) getUserId
Cookies help us deliver our services. By using our services, you agree to our use of cookies.