This article has links to websites or programs outside of Scratch and Wikipedia. Remember to stay safe while using the internet, as we cannot guarantee the safety of other websites. |
This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective. |
- This article or section documents an outdated version of Scratch (version 2.0). For this article in the current version (version 3.0), see Blocks (3.0). For this article in Scratch 1.4, see Blocks (1.4).
when gf clicked move (10) steps say [Hello!] for (2) secs forever if <<(score:: variables) > [50]> and <touching [mouse-pointer v]?>> then dance for (2) seconds:: custom broadcast [Win v] play sound [Cheer v] until done repeat (100) turn [motor v] on for (2) secs:: extension change [pitch v] by (1) end end end
Blocks are puzzle-piece shapes that are used to create code in Scratch. The blocks connect to each other like a jigsaw puzzle, where each data type (event, command, reported value, reported boolean, or script end) has its own shape and a specially shaped slot for it to be inserted into which prevent syntax errors. Series of connected blocks are called scripts.
In Scratch 2.0, there were twelve categories of blocks: motion, looks, sound, pen, variables, list, events, control, sensing, operators, more blocks, PicoBoard, and LEGO Education WeDo 2.0 (although there were some other categories and blocks in some Scratch modifications). Only ten of these were shown in the Block Palette.
In total, there were eleven Hat Blocks, five C Blocks, thirty-seven Reporter Blocks, thirteen Boolean Blocks, two Cap Blocks and seventy-seven Stack Blocks.
Block Shapes
There were six different block shapes: Hat, Stack, Boolean, Reporter, C and Cap.
Hat blocks
- Main article: Hat Block
Hat blocks were the blocks that started every script. They were shaped with a rounded top and a bump at the bottom — this was so blocks could only be placed below them. There were 11 Hat blocks in the Scratch editor, six of which were in the Events category, one in the control category, and one in the category more blocks (if any custom blocks had been created).
Stack blocks
- Main article: Stack Block
Stack blocks were the blocks that performed the main commands. They were shaped with a notch at the top and a bump on the bottom — this was so blocks could be placed above and below them. There were 77 Stack blocks, making it the most common block shape.
Boolean blocks
- Main article: Boolean Block
Boolean blocks were the conditions — they were either true or false. With a hexagonal shape, there were 13 of these blocks.
Reporter blocks
- Main article: Reporter Block
Reporter blocks were the values. Reporter blocks could hold numbers and strings. Shaped with rounded edges, there were 37 of these blocks — not counting the theoretically infinite amount of Reporter blocks that can be made for each variable and list.
C blocks
- Main article: C Block
C blocks were blocks that take the shape of a "C". Also known as "Wrap blocks",[1] these blocks looped the blocks within the Cs or checked if a condition is true. There were five C blocks, and they could be found in the Control category. C blocks could be bumped at the bottom, or capped.
Cap blocks
- Main article: Cap Block
Cap blocks were the blocks that ended scripts. They were shaped with a notch at the top and a flat bottom — this was so no blocks could be placed below them. There were two Cap blocks which can both be found in the Control category.
List of Blocks
There were 145 blocks in Scratch 2.0.
Motion blocks
- Main article: Motion Blocks
Motion blocks were the blocks that controlled a Sprite's movement. There were 17 motion blocks in Scratch 2.0.
Scratch 2.0 had the following fourteen motion stack blocks:
move () steps
— Moved the sprite forward the amount of steps in the direction the sprite is facing.turn cw () degrees
— Turned the sprite (clockwise) the specified amount.turn ccw () degrees
— Turned the sprite (counter-clockwise) the specified amount.point in direction ( v)
— Pointed the sprite in the direction.point towards [ v]
— Pointed the sprite towards the mouse-pointer or another sprite.go to x: () y: ()
— Moved the sprite to the specified X and Y position.go to [ v]
— Moved the sprite to the mouse-pointer or another sprite.glide () secs to x: () y: ()
— Glided the sprite to the location, taking as long as the specified amount of time.change x by ()
— Changed the sprite's X position by the amount.set x to ()
— Set the sprite's X position to the amount.change y by ()
— Changed the sprite's Y position by the amount.set y to ()
— Set the sprite's Y position to the amount.if on edge, bounce
— If a sprite was touching the edge of the screen, its direction flipped over.set rotation style [ v]
This set the rotation style of a sprite.
Scratch 2.0 had the following three motion reporter blocks:
x position
— The X position of the sprite.y position
— The Y position of the sprite.direction
— The direction of the sprite.
Looks blocks
- Main article: Looks Blocks
Looks blocks were the blocks that control a sprite's look. There were 23 looks blocks in Scratch 2.0. Three of the 19 sprite looks blocks have a counterpart for the stage.
Scratch 2.0 had the following sixteen looks stack blocks:
say () for () secs
— A speech bubble appeared over the sprite and stayed for the specified amount of time.say ()
— A speech bubble appeared over the sprite and would not go away over time.think () for () secs
— A thought bubble appeared over the sprite and stayed for the specified amount of time.think ()
— A thought bubble appeared over the sprite and would not go away over time.show
— Showed the sprite.hide
— Hid the sprite.switch costume to [ v]
/switch backdrop to [ v]
— Changes the sprite's/stage's costume/backdrop to the specified one.switch backdrop to [ v] and wait
— Like the Switch to Backdrop () block, though it waited until all of the hat blocks triggered by this had completed. (Stage only)next costume
/next backdrop
— Changed the sprite's/stage's costume/backdrop to the next one in the costume list.change [ v] effect by ()
— Changed the specified effect by the amount.set [ v] effect to ()
— Set the specified effect to the amount.clear graphic effects
— Cleared all graphic effects on the sprite.change size by ()
— Changed the sprite's size by the amount.set size to ()%
— Set the sprite's size to the amount.go to front
— Put a sprite in the front.go back () layers
— Changed the sprite's layer value by the amount.
Scratch 2.0 had the following three Looks Reporter blocks:
costume #
/backdrop #
— The number of the sprite/stage's current costume/backdrop in the list.backdrop name
— Reported the name of the current backdrop.size
— The sprite's size.
Sound blocks
- Main article: Sound Blocks
Sound blocks were the blocks that controlled sound and MIDI functions. There were 13 sound blocks in Scratch 2.0.
Scratch 2.0 had the following eleven sound stack blocks:
play sound [ v]
— Played a sound without pausing the script.play sound [ v] until done
— Played a sound and pauses the script until it finished.stop all sounds
— Stopped all playing sounds.play drum ( v) for () beats
— Played the specified drum for the amount of beats.rest for () beats
— Paused the script for the amount of time.play note ( v) for () beats
— Played the note for the amount of beats.set instrument to ( v)
— Set the instrument to the specified one.change volume by ()
— Changed the volume by the amount.set volume to () %
— Set the volume to the amount.change tempo by ()
— Changed the tempo by the amount.set tempo to () bpm
— Set the tempo to the amount.
Scratch 2.0 had the following two sound reporter blocks:
Pen blocks
- Main article: Pen Blocks
Pen blocks were the blocks that controlled the pen. There were 11 pen blocks in Scratch 2.0.
Scratch 2.0 had the following eleven pen stack blocks:
clear
— Removed all pen marks put on the screen.stamp
— Penned the sprite's image on the screen, which could be removed using clear.pen down
— Put the sprite's pen down.pen up
— Put the sprite's pen up.set pen color to [#f00]
— Set the pen color to the specified color shown on the picture.change pen color by ()
— Changed the pen color by the amount.set pen color to ()
— Set the pen color to the amount.change pen shade by ()
— Changed the pen shade by the amount.set pen shade to ()
— Set the pen shade to the amount.change pen size by ()
— Changed the pen size by the amount.set pen size to ()
— Set the pen size to the amount.
Data blocks
Variables blocks
- Main article: Variables Blocks
Variables blocks were the blocks that held values and strings. There were 5 variables blocks in Scratch 2.0.
Scratch 2.0 had the following four variables stack blocks:
set [ v] to []
— Set the specified variable to the amount.change [ v] by ()
— Changed the specified variable by the amount.show variable [ v]
— Showed the variable's Stage Monitor.hide variable [ v]
— Hid the variable's Stage Monitor.
Scratch 2.0 had the following variables reporter block:
(variable)
— The variable's value.
List blocks
- Main article: List Blocks
List blocks were the blocks that managed lists. They were stored in the Data category. There were 10 List blocks in Scratch 2.0.
Scratch 2.0 had the following six list stack blocks:
add [] to [ v]
— Added an item to the list (the item goes at the bottom of the list of items) with the specified content in it.delete ( v) of [ v]
— Deleted the item of the list.insert [] at ( v) of [ v]
— Added an item to the list (the item goes where you specify in the list of items) with the specified content in it.replace item ( v) of [ v] with []
— Replaced the item's content with the specified content.show list [ v]
— Showed a list.hide list [ v]
— Hid a list.
Scratch 2.0 had the following 3 list reporter blocks:
(list:: list)
— The list's value.(item ( v) of [ v])
— The item's value.(length of [ v])
— How many items there were in the specified list.
Scratch 2.0 had the following list boolean block:
<[ v] contains ()>
— The condition for checking if an item's content was the specified text.
Events blocks
- Main article: Events Blocks
Events blocks were blocks that controlled events and the triggering of scripts. There were 8 events blocks in Scratch 2.0.
Scratch 2.0 had the following six events hat Blocks:
when green flag clicked
— When the flag was clicked, the script activated.when [ v] key pressed
— When the specified key was pressed, the script activated.when this sprite clicked
— When the sprite was clicked, the script activated.when backdrop switches to [ v]
— When the backdrop switched to the one chosen, the script activated.when [ v] > ()
— When the first value was greater than the second value, the script activated.when I receive [ v]
— When the broadcast was received, the script activated.
Scratch 2.0 had the following two events stack blocks:
broadcast [ v]
— Sent a broadcast throughout the Scratch program, activating when I receive () blocks that were set to that broadcast.broadcast [ v] and wait
— Like the Broadcast () block, but paused the script until all scripts activated by the broadcast were completed.
Control blocks
- Main article: Control Blocks
Control blocks were the blocks that controlled scripts. There are 11 control blocks in Scratch 2.0.
Scratch 2.0 had the following one control hat block:
when I start as a clone
(sprites only) — This hat block was triggered whenever a clone is created, and would only be run by that clone.
Scratch 2.0 had the following three control stack blocks:
wait () secs
— Paused the script for the amount of time.wait until <>
— Paused the script until the condition is true.create clone of [ v]
— Created the specified clone.
Scratch 2.0 had the following five Control C blocks:
repeat ()
— A loop that repeated the specified amount of times.forever
— A loop that would never end.if <> then
— Checked the condition so that if the condition is true, the blocks inside it would activate.if <> then else
— Checked the condition so that if the condition is true, the blocks inside the first C would activate and if the condition is false, the blocks inside the second C would activate.repeat until <>
— A loop that would stop once the condition is true.
Scratch 2.0 had the following two control cap blocks:
stop [ v]
— Stopped the scripts chosen through the drop-down menu. Could also be a stack block when "other scripts in this sprite" is chosen.delete this clone
(sprites only) — Deleted a clone.
Sensing blocks
- Main article: Sensing Blocks
Sensing blocks were the blocks that detected things. There were 20 sensing blocks in Scratch 2.0.
Scratch 2.0 had the following four sensing stack blocks:
ask [] and wait
— An input box appears and the value typed in was stored in the answer variable.reset timer
— Reset the timer.turn video [ v]
— Turned the video on.set video transparency to ()%
— Set the transparency of the video.
Scratch 2.0 had the following five sensing boolean blocks:
touching [ v]?
— The condition for checking if the sprite was touching the mouse-pointer or another sprite.touching color ()?
— The condition for checking if the sprite was touching a specific color.color () is touching ()?
— The condition for checking if a color on the sprite was touching a specific color.key [ v] pressed?
— The condition for checking if the specified key was being pressed.mouse down?
— The condition for checking if the mouse was down.
Scratch 2.0 had the following eleven Sensing Reporter blocks:
distance to [ v]
— The distance from the sprite to the mouse-pointer or another sprite.answer
— The most recent input with the Ask () And Wait block.mouse x
— The mouse-pointer's X position.mouse y
— The mouse-pointer's Y position.loudness
— How loud the noise was that the microphone was sensing.timer
— How much time had passed since the Scratch program was opened or the timer reset.video [ v] on [ v]
— The video motion or direction of video motion on an object.[ v] of [ v]
— The X position, Y position, direction, costume, size or volume of the stage or a sprite.current [ v]
— The specified time unit selected.days since 2000
— The number of days since the year 2000.username
— The username of a user.
Operators blocks
- Main article: Operators Blocks
Operators blocks were the blocks that performed math functions and string handling. There are 17 operators blocks in Scratch 2.0.
Scratch 2.0 had the following six operators boolean blocks:
[] \< []
— The condition for checking if a value was less than the other.[] = []
— The condition for checking if two values were equal.[] > []
— The condition for checking if a value was greater than the other.() and ()
— Joined two conditions.() or ()
— Joined two conditions, but they functioned separately.not ()
— Made the condition checked if it is false, not true.
Scratch 2.0 had the following eleven operators reporter blocks:
() + ()
— The value of the addition.() - ()
— The value of the subtraction.() * ()
— The value of the multiplication.() / ()
— The value of the division.pick random () to ()
— Chose a random number between the two limits.join [] []
— The two values concatenated with each other.letter () of []
— The specified character of the value.length of []
— The length of the value.() mod ()
— The remainder of the division.round ()
— Rounded the value to the nearest whole number.[ v] of ()::operators
— The absolute value (abs), square root (sqrt), sine (sin), cosine (cos), tangent (tan), asine (asin), acosine (acos), atangent (atan), natural logarithm (ln), logarithm (log), exponential function (e^), or base 10 exponential function (10^) of a specified value.
Right-clicking some of the blocks would yield more choices of its type.
More blocks
- Main article: More Blocks
More blocks were user-made custom blocks. There were 2 unique kinds of more blocks in Scratch 2.0. They are known as my blocks in Scratch 3.0.
Scratch 2.0 had the following More Modified Hat block:
define
— Defined a custom block.
Scratch 2.0 had the following More Stack block:
custom block::custom
— A custom block.
PicoBoard blocks
- Main article: PicoBoard Blocks
PicoBoard blocks were used to control and sense data from the PicoBoard.
Scratch 2.0 had the 2 following PicoBoard hat blocks:
Scratch 2.0 had the following PicoBoard boolean block:
Scratch 2.0 had the following PicoBoard reporter block:
LEGO WeDo 1.0 blocks
- Main article: LEGO WeDo 1.0 Extension
LEGO WeDo 1.0 blocks were used to connect the LEGO WeDo Construction Set 1.0 to Scratch. They are accessed via the Add an Extension button.
Scratch 2.0 had the following five LEGO WeDo 1.0 Stack blocks:
turn [ v] on for () secs:: extension
turn [ v] on:: extension
turn [ v] off:: extension
set [ v] power ():: extension
set [ v] direction to [ v]::extension
Scratch 2.0 had the following two LEGO WeDo 1.0 Hat blocks:
Scratch 2.0 had the following two LEGO WeDo 1.0 Reporter blocks:
LEGO WeDo 2.0 blocks
- Main article: LEGO Education WeDo 2.0 Extension
LEGO WeDo 2.0 blocks were used to connect the LEGO WeDo Construction Set 2.0 to Scratch. They are accessed via the Add an Extension button.
Scratch 2.0 had the following seven LEGO WeDo 2.0 Stack blocks:
turn [ v] on for () secs:: extension
turn [ v] on
turn [ v] off
set [ v] power to ()
set [ v] direction to [ v]
set light color to ()
play note ( v) for () seconds
Scratch 2.0 had the following two LEGO WeDo 2.0 Hat blocks:
Scratch 2.0 had the following LEGO WeDo 2.0 boolean block:
Scratch 2.0 had the following two LEGO WeDo 2.0 reporter blocks:
Scratch Block Plugin
- Main article: Block Plugin
The Scratch Block Plugin allowed blocks and scripts to be used in the Scratch Discussion Forums and Scratch Wiki, as well as other sites with the included JavaScript.
They looked like this:
when green flag clicked go to x: (0) y: (0) // center the sprite for the first stamp stamp forever go to x: (pick random (-240) to (240)) y: (0) stamp wait (0.2) secs change [color v] effect by (pick random (5) to (14))
The version that includes all blocks from Scratch 2.0 was made by blob8108.
Editing the Block Colors
- Main article: Edit Block Colors
In the online Scratch 2.0 editor, by shift-clicking the Edit menu an option called "Edit block colors" appeared. By selecting this, a menu would appear with 3 HSL sliders and tools for modifying the block colors of a specific block category.
In Other Programming Languages
Scratch modifications contained many new blocks that were not present in Scratch. MIT, where Scratch is made, had also created other languages using blocks such as the MIT App Inventor. Stencyl is a highly-professional language that features an entire block interface for programming real-time apps and online games. Scratch Jr also has blocks which are even more friendly for younger children to understand.
See Also
References
- ↑ TimothyLawyer. (2013-11-26). "C (wrap)" post:193855