0% found this document useful (0 votes)
99 views17 pages

Scratch

The document discusses different types of blocks in Scratch including events, looks, motion, control, and pen blocks. It provides descriptions and examples of common blocks within each block category to introduce how they work and what they are used for.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views17 pages

Scratch

The document discusses different types of blocks in Scratch including events, looks, motion, control, and pen blocks. It provides descriptions and examples of common blocks within each block category to introduce how they work and what they are used for.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

4.

1 INTRODUCTION TO EVENT BLOCKS

Event Blocks
The events blocks are one of the most frequently used blocks in scratch. Each
category of blocks in scratch is color coded. The events blocks are colored a
burnt orange. They are also called hat blocks. This is because these blocks are
rounded at the top just like a hat. Other blocks can be added below the events
blocks but never above them. The events block are also known as triggers be-
cause they are trigger the events in the program

1. When green flag clicked - this is one of the most


commonly used event block. It is used at the begin-
ning of the script. The block does not run until the
green flag is clicked. Once the green flag is clicked,
the rest of the blocks under it start running.

2. When this sprite clicked - this block triggers the blocks below it when the
sprite is clicked.

4.2 INTRODUCTION TO LOOKS BLOCKS

As evident from its name, the looks blocks are used to change the appearance
of the sprite or other features of the project. The color code of a look block is
purple. Let us see how they work.
1. say ___for ___secs - This block is used to give a speech bubble for the sprite.
The speech bubble appears for as many seconds as we want before the
next command is run..

2. Say__- this is similar to the earlier block. We can use this to input a speech
bubble. To remove the speech bubble, we can add an empty say block.
3. Think __ for __ secs - we can use this block if we want to show words in a
thought bubble. The number of seconds indicates the time that the thought
bubble appears before letting the script to continue.

4. Think ___ - this is block is used to display a thought bubble. To remove the
thought bubble, we can add an empty think block.
5. Show - this is block makes the sprite appear on the
stage area.

6. Hide - this block used to make the sprite disappear.

7. Change size by___- this block changes the size of the sprite by the specified
number.

8. Set size to _____% - this block changes the size of the sprite to the specified
percentage of the its original size.

4.3 INTRODUCTION TO MOTION BLOCKS

Motion blocks
Motion blocks are used to monitor and control the movement of the sprite.
They are color coded medium blue. To understand how the motion block work,
let us take the example of letter S as our sprite.
1. Move ____steps - this is One f the motion blocks in Scratch. Let us input a
value of 10 in this motion block. This sprite will move forward 10 steps in its
present direction. What happens if we enter a negative value? If you enter -
10, the sprite will go in the opposite direction, which Is backwards.
Depending on the place we want our sprite to go, we need to enter that
value in this block. (for example sprite: S)

2. Right turn ___ degrees - it is one of the Motion Blocks in Scratch. If you in
sert this block in your script, the sprite turns to the right by the number of
degrees that you input. For example, input 45 degrees in this block and see
what happpens. The sprite turns to the right at an angle of 455 degrees. Of
you input a negative value, the sprite will turn to the opposite direction,
which is to the left.
3. Left turn ____ degree - this block is just like the previous block except that
the sprite turns to the left.

4. Point in direction____- when you used the move__steps block, did you no-
tice the direction in which the sprite moved? If the sprite moved to the
right, this means the sprite is pointing towards the right or, in other words,
it is at a value of 90. What if we want to change the direction in which the
sprite is moving? We can use this block to change its direction. We could
also input any other number we want.

5. Point towards mouse-pointer - This motion block which allows us to


change the direction of our sprite towards the mouse pointer.
6. Go to x___y ___ - The stage has the following coordinates

If we want our sprite to move to a specific position, we can type in the desired
coordinates and see where our sprite moves to. If we want our sprite to move
somewhere to the top right of the stage, we can input the values of x196 y104.

7. go to mouse pointer - If we want the spite to jump to the position of the


mouse pointer, we can use the “go to mouse-pointer” block.

8. go to random position - if we want the sprite to jump to a random position,


we can use “go to random position” block.
9. Glide__secs to x__ y__- it is one of the motions Blocks in scratch. In this our
sprite to move slowly to the desired position? This motion blocks helps us
to do so. Enter the number of seconds you want the sprite to smoothly
glide over to the new coordinate, and you can see the sprite move. Before
adding this block, make sure to add the go to x y block to see the sprite
glide to the new position

10. change x by ___ - This block allows us to change the x coordinates by a


cer-tain amount. You couls add a value of 10 to see the sprite move to the
right and a value of - 10 to move it to the left.

11. Set x to ___- To move our sprite to a specific point in the horizontal plane,
use this block by entering a specific x coordinate. Giving a positive number
moves the sprite to the right and a negative number moves it to the left.
12. Change y by___- To change they coordinates by a certain amount, add this
block to the script and see the sprite move up or down.

13. Set y to____- By entering a specific y coordinate, we can move our sprite in
the vertical plane. To move it up, add a positive number and a negative
number to move it down.

14. If on edge, bounce - This is a fun block that we can use to make our sprite
bounce when it touches the sides, top or bottom of the stage. To use this
block, we need to add the move _ steps block before it. Once we input a
number in the steps blank, we can see the sprite move forward, touch the
side of the stage and bounce upside down. Try it! The more the number of
steps, the faster it moves to the edge and bounce.
15. Set rotation style ______- The previous block helped us make the sprite
bounce but it made the sprite turn upside down. So, what do we do if we
want the sprite to stay on its feet? We can use this block to select the
rotation style that we want.
1. Left-right- This option lets the sprite move left or right horizontally
without turning upside down.

2. Don’t rotate - If we want the sprite to face only one direction, we can
choose this option. For example, if the sprite is facing right and we
want it to be facing right even after bouncing off the side of the stage,
we can choose this option. This makes the sprite appear to be walking
backward.

3. All around - We can choose this option if we want the sprite to turn
around when it bounces off the edge.

Sets the sprite rotational style

4.4 INTRODUCTION TO CONTROL BLOCKS

Control blocks

Control blocks are yellow colored blocks which can control the scripts.
1. Repeat - It is One of the Control blocks in
scratch. This Repeat block is used to repeat the
blocks in-side it for a specified number of times.
For example, when combined with a Motion
block like ‘move 10 steps’, ‘repeat 5’ will make
the sprite move 10 steps for 5 times.
2. End repeat - As per the given number in the Repeat block, repeat the blocks
inside it for a specified number of times after completion of the iterations,
the loop is terminated automatically and program control resumes at the
next block.

3. Forever - As the name implies, this block will run


the blocks inside over and over again.

4. End forever - forever block runs for infinity number of times and end when
the program ends.

5. Wait__secs - it is One of the Control Blocks


in Scratch. This block will make he sprite
wait for the specifies number of steps
before moving on to the next block. For
example, ‘move 10 steps’, ‘wait 2 secs’
‘turn 15 degrees right’ will make the sprite
wait 2 seconds before turning 15 degrees
right.

6. Stop all - This block stops the script form


running.

7. If __ then - This is a condition block which runs the block inside if the
condition is true. If it is false, the block inside will not run and the script
moves on to the next block.

8. If __ then else - This is an extension of the previous block. If the condition is


true, the blocks inside the if block are run. If the condition is false, the
blocks inside the else block are run.
9. End if then - When the end if-then bloc is encountered, program control
resumes at the next block.

10. repeat until __ - This block repeats the blocks inside until the condition is
fulfilled. If he condition is false, it runs the blocks inside and checks the
condition again. It continues to do it until the condition inside is true and
then moves on to the next block.

11. End repeat until - When the End repeat until block is encountered, program
control resumes at the next block.

12. Wait until ____ - This block pauses the script from running until the
condition given is fulfilled or until the condition is true. Unlike the repeat
until block, this block does not keep on checking again and again bu waits
for the event to be fulfilled.

4.5 INTRODUCTION TO PEN BLOCKS

Pen blocks

Pen blocks are color-coded dark-green and are used to control the pen aspect of
the scratch program.
1. pen down - This block Is used most frequently in projects that require art to
be drawn.

2. pen up - This block is only used for a small number of circumstances,but it


still can have much effect when used. Its most popular use is to raise a
lowered pencil (or pen, paintbrush, etc.) from the screen in a drawing
project.

3. Stamp - This block used in a script, the sprite will produce a bitmap image
of itself, which is stamped onto the stage.
4. Clear - This block removes all marks made by the pen or stamps.

5. Set pen color to __ - As this block can change the pen’s color, it is mainly
used when the pen is drawing something and a different color is desired.
The color can be changed by changing the value from 0 to 200.

0 200

6. Change pen color by ___ - This block increments or decrements the pen’s
color by the specified value. The color can be changed by changing the
value from 0 to 200.

0 200

7. Change pen shade by ___ - This block changes the pen’s shade by the
specified amount. The pen shade goes from 0 to 100. 50 is the default.

8. Set pen shade to __ - This block sets the pen’s shade to the specified
amount. The pen shade goes from 0 to 100. 50 is the default.

9. Set pen size to ___ - This block sets the pen’s size to the specified amount.
10. Change pen size to ___ - This block changes the pen’s size by the specified
amount.

4.6 INTRODUCTION TO SENSING BLOCKS

Sensing blocks
As we progress further into Scratch programming, we can make our projects
more interactive and creative. The block which help us create interactive proj-
ects are the sensing blocks. They are colour coded light blue.
1. Ask _______ and wait - This is a one of the sensing blocks that allows us to
add a question in the blank. The question appears as a voice balloon on the
stage area. When this block is run, a blank apace appears at the bottom of
the stage which is where the user inputs the answer. This answer is then
stored in a reporter block, answer.

2. Answer - This is a reporter block which stores the answer that is typed in
the blank space which appears at the bottom of the stage when ask and
wait block is run. The answer is stored when the Enter key is pressed or the
checkbox beside the answer block is ticked. Let us see how these two
blocks would work. Run the following script
When green flag clicked
ask ‘YOUR NAME’ and wait
(a blank space appears at the bottom, type ‘sprite’ and press enter)
Say answer

3. Touching mouse-pointer, touching edge - These blocks reports the


condition as true when the sprite is touching either the mouse pointer, the
edge of the stage. This block can be used with a control block such as
repeat until or if then else. It can be used in games where he sprite gas to
touch the edge of the stage area.
4. Touching color _____ ? - This block is used to detect when the sprite comes
in touch with the specified color. To choose the desired color, we have to
add that color to the square. This block reports true of the sprite touches
the specified color and false if it does not.

5. Mouse down? - This block returns true if the mouse button is pressed or
clicked anywhere on the screen.

6. Timer - The timer block is a sensing. The block starts at 0 when scratch is
launched and increases gradually; every second it will have increased by 1.
This block is almost always used with the Rest Time block -- usually the
timer must be reset at the beginning of a project for the timer block to hold
the right value.

7. Reset timer - This is a sensing block which rests the timer to zero. These
two blocks are especially useful in games where a time limit may be
needed for crossing a level.
4.7 INTRODUCTION TO SENSING BLOCKS

Sensing blocks
Sound blocks are used to change the volume, play certain sounds or stop all
sounds. An example of a sound lock is ‘play drum 1 for 0.25 beats’.

1. play sound __ - The Play sound () block is a sound block. The block will play
the specified sound, with no pause to its script.

2. Play sound __ until done - This block will play the specified sound, pausing
its script until the sound has finished playing.

3. Stop all sounds - This block will stop any sound currently being played on
the sprite.

4. Play drum __ for __ beats - Plays a drum sound for a specified number of
beats. The value of drum can be from 0 to 18 and value of beats can be
from 0 to 1. The drums are:
1. Snare drum 2. Bass drum 3. side stick 4. crash cymbal
5. Open Hi-Hat 6. Closed Hi-Hat 7. Tambourine 8. hand clap
9. Claves 10. Wood Block 11. Cowbell 12. Triangle
13. Bongo 14. Conga 15. Cabasa 16. Guiro
17. Vibraslap 18. Open Cuica

5. rest for ___ beats - This block pauses its script for specified amount of
beats, which can be decimal number & value of beats can be 0 to 1.
6. Play note __ for __ beats - Plays a musical note for specified number of
beats. The value of note can be from 0 to 60 and value of beats can be from
0 to 1,
7. Set instrument to __ - This block changes the instrument, it is mainly used
in projects that require multiple instruments. The value of instrument can
be from 0 to 21. The instruments are:

1. Piano 2. Electric Piano3. Organ 4. Guitar


5. Electric Guitar 6. Bass 7. Pizzicato 8. cello
9. Trombone 10. Clarinet 11. Saxophone12. Flute
13. Wodden Flute 14. Bassoon 15. Choir 16. Vibraphone
17. MusicBox 18. Steel Drum 19. Marimba 20. Synth Lead
21. Synth Pad.

8. Change volume by ___ - This block changes the volume of a sprite by the
specified amount. The volume value ranges from 0 to 100.
9. Set volume to ___ % - This block sets its sprite’s volume to the specified
amount.
10. Change tempo by ___ - This block changes the tempo (which determines
how long each beat is), it is mainly used to speed up and slow down the
Play Drum () for () Beats block and the Play Note () for () Beats block.
11. Set tempo to __ bpm - This block sets the scratch project’s tempo, or speed’
to the specified amount, using the unit “bpm”,or “beats per minute”.

4.8 INTRODUCTION TO DATA BLOCKS

Data blocks
1. Set __ to __ - This block will set the specified
variable to the given value: a string or number.
The pre-defined variable can be used such as
score, result and counter.
2. Change__ by __ - The block will change the
specified variable by a given amount. If the
variable is a string and not a number
3. Show variable ___ - This block displays the variable
on the stage.

4. Hide variable ___ - To hide the variable, we can also


use this block.

4.9 INTRODUCTION TO OPEBLOCKS

Data blocks
We have learned how the looks blocks can change the appearance of the sprite
and he Motion and Events blocks can control the sprite’s movement and events
of the project respectively. Sometimes, we may need to perform a math-
ematical calculation or comparison between two values. For such a purpose, we
can use the Operator Block.
Operator Blocks are color coded light green. Previously called Number Blocks
due to their mathematical ability, they were renamed Operator Blocks when
new blocks were added. The operator blocks have Boolean blocks and Reporter
blocks.
Boolean blocks- Boolean blocks are blocks used to perform comparisons based
on a condition and giving the output of True or False. A Boolean expression uses
a comparison operator to compare two pieces of data and gives out the output
accordingly. For example, if the condition given is ‘a number < 12’, (the com-
parison operator being less than ‘<’ and two pieces of data being a variable
number and 12) and the input is 7 , the output given is False.

1. < This block is used to compare two values and give out the output True if
the first value is smaller than second value or False if the first value is equal
to or greater than the second one

2. = - This block gives the output True if two values are equal and False if they
are not.

3. > - This block reports True if the first value is greater than the second and
False if the second value is more than the First.
Reporter blocks -
The Reporter blocks which requires a value.
1. + - This block is used for adding two numbers. It can be used in projects
involving addition, calculation or addition of lists of numbers.

2. - - This block subtracts the second value from the given first value.

3. * - This block is used to multiply two values and is used in math formulae or
multiplying lists of numbers.

4. / - The first value is divided by the second value using this block. If the
remainder is not zero, the remainder is given in the from of a decimal in the
output.

You might also like