|
The subject of this article or section has changed dramatically and requires updating. Please keep in mind that some of the information or images may not be accurate or relevant to the current version of Scratch, the Scratch website, or the article subject. (July 2019) Specifically: Outdated by Blocks need repositioning, extensions need adding release.
|
Default Values are the default arguments values in blocks when shown in the block palette. Every block with an insert has default values, even if they are blank.
If a reporter block is put into an insert in Scratch 3.0 and taken out of it again, it will return to the previous value. If the reporter block was, however, dragged in using a previous version of Scratch, and is removed in 3.0, the value will revert to 10 (for a numeric insert), or a blank string (in a string insert).
Default values help to make Scratch more intuitive: The default value of a block is generally a common value that should not have to change for simple cases. By giving an example the default value delivers an explanation added to the name of the block. So it motivates starters to explore unknown blocks.
For example, the change () by () block has a default value of 1 for its second argument. This way it functions as a score keeper, timer, or counter. They can also serve to show how the block functions. For example, the Join block has the default values "apple " and "banana". When a user sets a variable to the block to see the output, they see "apple banana", which explains the function of the block (concatenation) instantly.
A boolean insert's default value is false, even though they do not show their value. This can be tested by simply running this script (notice the empty Boolean insert, where we make the block use the default value):
when gf clicked
if <> then
say [True]
else
say [False] //The sprite would say this. Try it!
end
List of Default Values
Block
|
Default Values
|
move () steps
|
10
|
turn cw () degrees and turn ccw () degrees
|
15
|
go to ( v)
|
random position
|
go to x: () y: ()
|
x position, y position
|
glide () secs to ( v)
|
1, random position
|
glide () secs to x: () y: ()
|
1, x position, y position
|
point in direction ( )
|
90
|
point towards [ v]
|
mouse-pointer
|
change x by () and change y by ()
|
10
|
set x to ()
|
x position
|
set y to ()
|
y position
|
set rotation style [ v]
|
left-right
|
when [ v] key pressed
|
space
|
when backdrop switches to [ v]
|
The first backdrop in order
|
when [ v] > ()
|
Loudness, 10
|
when I receive [ v] , broadcast ( v) , and broadcast ( v) and wait
|
The first message alphabetically
|
say [] for () seconds
|
"Hello!", 2
|
say []
|
"Hello!"
|
think [] for () seconds
|
"Hmm...", 2
|
think []
|
"Hmm..."
|
switch costume to ( v)
|
The last costume in order
|
switch backdrop to ( v) and switch backdrop to ( v) and wait
|
The last backdrop in order
|
change size by ()
|
10
|
set size to ()%
|
100
|
change [ v] effect by ()
|
color, 25
|
set [ v] effect to ()
|
color, 0
|
go to [ v] layer
|
front
|
go [ v] () layers
|
forward, 1
|
costume [ v] and backdrop [ v]
|
number
|
wait () seconds
|
1
|
repeat ()
|
10
|
Empty Boolean inputs
|
false
|
stop [ v]
|
all
|
create clone of [ v] in a sprite
|
myself
|
create clone of [ v] in the Stage
|
The first sprite in the sprite pane
|
play sound [ v] until done and start sound [ v]
|
The last sound in the Sound List
|
rest for () beats
|
0.25
|
play note ( v) for () beats
|
60, 0.25
|
play drum ( v) for () beats
|
(1) Snare Drum, 0.25
|
set instrument to ( v)
|
(1) Piano
|
change volume by ()
|
-10
|
set volume to () %
|
100
|
change tempo by ()
|
20
|
set tempo to () bpm
|
60
|
change [ v] effect by () :: sound
|
pitch, 10
|
set [ v] effect to () :: sound
|
pitch, 100
|
<touching ( v)?>
|
mouse-pointer
|
Color inputs
|
A random color, refreshed when a user switches to the Stage in the Sprite Pane
|
(distance to ( v))
|
mouse-pointer
|
ask [] and wait
|
"What's your name?"
|
<key ( v) pressed?>
|
space
|
set drag mode [ v]
|
draggable
|
(video [ v] on [ v]) in a sprite or the Stage
|
motion, sprite
|
([ v] of ( v))
|
backdrop #, Stage
|
current [ v]
|
year
|
turn video [ v]
|
on
|
set video transparency to () %
|
50
|
change pen [ v] by ()
|
color, 10
|
set pen [ v] to ()
|
color, 50
|
change pen size by ()
|
1
|
set pen size to ()
|
1
|
(() + ()) , (() - ()) , (() * ()) , (() / ()) , and (() mod ())
|
"", ""
|
(pick random () to ())
|
1, 10
|
<[] < []> , <[] = []> , and <[] > []>
|
"", 50
|
(join [] [])
|
"apple ", "banana"
|
(letter () of [])
|
1, "apple"
|
(length of ())
|
"apple"
|
() contains ()?
|
"apple", "a"
|
(round ())
|
""
|
([ v] of ()::operators)
|
abs, ""
|
set [ v] to []
|
The first variable alphabetically, 0
|
change [ v] by ()
|
The first variable alphabetically, 1
|
show variable [ v] and hide variable [ v]
|
The first variable alphabetically
|
add [] to [ v] and item # of () in [ v]
|
"thing", the first list alphabetically
|
delete () of [ v] and (item () of [ v])
|
1, the first list alphabetically
|
delete all of [ v] , length of [ v] , show list [ v] , and hide list [ v]
|
The first list alphabetically
|
insert [] at () of [ v]
|
"thing", 1, the first list alphabetically
|
replace item () of [ v] with []
|
1, the first list alphabetically, "thing"
|
<[ v] contains []?>
|
The first list alphabetically, "thing"
|
turn [ v] on for () seconds
|
motor, 1
|
turn [ v] on and turn [ v] off
|
motor
|
set [ v] power to ()
|
motor, 100
|
set [ v] direction to [ v]
|
motor, this way
|
when distance [ v] ()
|
<, 50
|
when tilt [ v] ()
|
=, 1
|
when [ v]
|
Button pressed
|
when [ v] [ v] ()
|
slider, >, 50
|
<sensor [ v]?>
|
Button pressed
|
([ v] sensor value)
|
Slider
|
See Also