Class 5 Computer CH 7 An Introduction To Scratch
Class 5 Computer CH 7 An Introduction To Scratch
You are given a task in class to find the perimeter of arectangle. You
plan the following steps to complete it.
1. Write the formula to calculate the perimeter as P = 2 x(L + B).
2 Put values of length (L = 7) and breadth (B = 5) into the formula.
3. Calculate the perimeter (P), and you get the result as P= 24.
Tou have solved the problem by breaking it down into simple steps.
This step-by-step
method of solving a problem is called an algorithm.
Now, imagine yourself as aa computer. You (the computer) are given
these instructions in alanguage
language that you understand. You will follow
these
instructions one by one to calculate the perimeter. The instructions
en to you are collectively called a program. Just as this algorithm
105
is written in the English language, computer prgrams are written in a
computer programming language that a computer understands.
The step-by-step instructions given to the computer using a
programming language to perform a task is called programming.
FEATURES OF SCRATCH
Ihere are many computer programming languages that can be used
to give instructions to acomputer. Scratch is an example of one such
programming language with the following facts and features:
Scratch is avisual programming language that was created for
children to understand the basics of computer programming.
It was first launched as a desktop application in 2007 by the Lifelong
Kindergarten Group at Massachusetts Institute of Technology (MIT)
Media Lab.
AVA'S COOL TIP
It is easy to learn and You can download the free
use.
Scratch app from the given link.
It can be accessed https://scratch.mit.edu/download
online as a tool or can
be downloaded for free.
It can be used to create games, digital stories, animations, and so on.
It is compatible with the Windows,
macOS, and Linux operating systems. Seratch 3
O Settings
Tips
Cotasos eSond
Co
Mtion
Blocks
menu Sprite
Blocks
palette
snang Stage
Code/Script
Area Sprite
pane
Sprite list
Ascript is also called a program. Let us learn how to create and run
ascript.
Creating a Script
Before you start creating projects in Scratch, it is important to learn how
to drag and drop blocks in the script area.
In Fiqure 7.3, the blocks are dragged and dropped in the script area and
further joined to create a script. When you drag a block from the blocks
palette, do not leave the mouse button till you drop it in the script
area. When you join two blocks together, a shadow appears. This is to
help you place the blocks at the correct position.
108
rtch 129.t
Ttoriats
Serstch Projt File Edit Tutoriats Serateh Proeed
4 Sounds
Costumes 4 Sounds
Costames
Meto
Motion
Motion
move 10 sepa
Loors Moe t10 opa
1s dogrees torr 15 degrees
C o e s
Seune
S15 degrees
Events
b
+ Fig. 7.3 Dragging and dropping blocks
Rearranging a Script
Once
thescript is created, you can move it anywhere on the script area.
To move
the stack of blocks, click on the first block and drag the script
place it.
where you want to
To delete the block or the entire script, right-click on it and choose the
pelete Block option (Fig. 7.4). Similarly, you move 100 steps
the
can create aduplicate of the block on turn 60 degre
Running a Script
Click on any block of the script to run it. To execute the script multiple
times you need to click on the blocks again and again.
LET'S REVIEW
Write T for True and F for False.
.Scratch is aprogramming language created for children.
2. The white
area on which a Sprite is seen is called stage.
When red stop button clicked, it will run the scripts in the project.
The default Sprite in Scratch is the cat.
5. You cannot remove all the scripts from the script area.
109
USING BLOCKS IN SCRATCH
All the blocks in the Scratch window have aunique purpose. The blocks
are joined together to make aproject. Let us make some projects in
Scratch using different blocks.
if on edge, bounce
This block bounces back the Sprite if, while moving, the
Sprite touches the edge of the stage.
Let us create a Scratch project using the blocks from the Motion block
menu.
oratsSca
Castues
Moion
10
turm 60 degrees
b npon
Block Description
pen down This block adds a pen to the Sprite. As the Sprite
moves on the stage, it dravws a line along with it.
sel pen size to 1 This block sets the thickness of the pen to aspecitic
number. Greater number equals to greater thickness.
111)
Block Description
change pen color v by 10
This block changes the colour of the pen by a
specified amount.
Let us create a project in Scratch using the blocks from the Pen
block menu.
1. Open a newproject in Scratch by clicking on the File menu and
selecting the New option.
2. Click on Add Extension present on bottom-left corner of the
Scratch window. The Choose an Extension window appears (Fig. 7.6).
DScratch 329.1
X
movo 30 sleps
um2 125 degrees
pen down
mOve 30 stens
bm125 deqrees
Ton edoe bounce
JCostues
movo 100seps
stamp
pen down
Looks
Iorever
movo 20 sleps
furn 15 degrees
dhango xby 10
chango yby
MyEes baap
gotoouse pointer
h°¡c e d
INFO BOX
AVA'S COOL TIP
can use
the Looks blocks menu to
You
:change
the appearance of the Sprite. The red stop button
purple- -coloured blocks change located at the upper-left
These
colour of the Sprite, increase its size, corner of the stage is
the
from the stage, and so on. It also used to stop the script
:hide it
that display text on the stage. while executing.
has blocks
to make a project
the Sprite walks where hang pen c
Soh Pujct
Coo
CosAses Sounde
Sound
move 20
15 degrees
pen down
Fveuts
Choose a Sound
Back
) D)
AElec Bass AElec Gutar AElec Piano AGudar
A Bass AMinor UK APiano
)
A Trombone ATrumpel Afro Sting Alert Ahen Creak1
ASax Alen Creak2
) D)
BBass BElec Bass BElec Guitar BElec Pano B Guitar B Piano BSax
4. Select any one option, and cick on it. The new sound gets
added to the list (Fig. 7.13).
O Seratch 3A1 X
Costes Sound8
AElec Guar
Cogy Cogy to Nes
ACre Qua
4
Saten Fade in Fade eut Reverse
Sackdn
Spnte
Narme
This PC Date modified ype
3D Objects No items match vour search
Desktop
Documents
Downloads
Musác
INFO BOX
F Ptues
a Hide Folders
Cancel
OSratch 329.1
O Open
New folder
Organize
AOneDrive - Personal
OMyProject 1 7/13/2022 1014 PM S83 File
OMy Project2 7/13/2022 1015 PMM SB3 Fle
This PC
3D Objects
EDesktop
Documents
Downloads
Muskc
E Pictures
Videos
Local Disk (C)
Open Cancel
CLOSING SCRATCH
o« FLASHBACK
* Scratch is avisual programming larnguage created for children to
understand the basics of computer programming.
* ASprite is a small cartoon character present on the stage of the
Scratch window.
3 The default Sprite in Scratch is the cat.
Ihe Motion block menu contains blocks that makes a Sprite do various
movements on the stage.
*Ine blocks from the Pen block menu allow a Sprite to draw as it
moves on the stage.
119
The blocks in the Looks blocks menu are used to change the
appearance
of the Sprite.
The blocks in the Control block menu are used to control the
execution
of a script.
The blocks in the Sound block menu are used to add sound effects in
aproject.
EXERCISES
A. Tick (/) the correct answers.
1. Which of the following is the file extension of
a Scratch 3.0 project?
a. sb2 b. sbp C. sb3
2. Which of the following is the default Sprite in
Scratch?
a. Dog b. Pen C. Cat
3. Which of the following blocks creates the
duplicate copy of a Sprite?
a. Pen Down b. Stamp C. Forever
4. Which is the correct colour for the blocks in
the Motion block menu?
a. Medium-blue b. Green
C. Purple
5. Which of the following block menus allow a
Sprite to draw as it
moves on the stage?
Motion b. Control C. Pen
121
30
4. Explain the use of the dark-green coloured blocks in Scratch
pen dowr
mo 10 slops
change pen color 20
on edgo, bomce
sel pen size lo 10
change pencolor by 1
3. 4
foevor
move 100
Inove 10 sleps
f on edge. tounce
tum 100 degrues
pen down
Don down
122
Write the scripts in Scratch to generate the following output.
B
2.
1.
d Sounds
Pen
erase al
Looks
oreMer
move 20 steps
tum 15 degrees
sel pen color to
pen down
Jperso
Garge pen color 10
et pen s le
Baosgu
Sore
Self-Reflection
124