Getting started with Scratch Guide_RaspberryPi
Getting started with Scratch Guide_RaspberryPi
Projects
Scratch is a graphical programming language developed by the Lifelong Kindergarten group at the MIT Media Lab.
In Scratch, you can drag and combine code blocks to make a range of programs, including animations, stories,
musical instruments, and games. It’s a bit like the programming equivalent of building blocks!
Scratch is used in many schools as part of the curriculum. It is free, and young people can use it at home as well as
in clubs.
Scratch allows young people to learn coding concepts and create interactive projects without needing to learn a
text-based programming language. You will not need to be able to type quickly or remember complex code to use
Scratch.
How to use this reference guide
If you have not used Scratch before, then this guide will help you to set up and create your first project.
You can return to this guide and use it to look up information that you need when you are making your own
projects in Scratch.
At the end of the guide you will find links to paths of Scratch projects, from beginner through to advanced, where
you can learn coding by making fun and interesting apps, games, stories, animations, art and music.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 1/122
3/6/24, 6:29 AM Getting started with Scratch
Software
This guide will explain how to get started with Scratch 3 (either online (https://scratch.mit.edu/) or
offline (https://scratch.mit.edu/download))
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 2/122
3/6/24, 6:29 AM Getting started with Scratch
You can use Scratch on a laptop or desktop computer, or on a tablet. You can also use Scratch on a Raspberry Pi
computer.
Open a web browser on your computer or tablet and visit rpf.io/scratch-new (https://rpf.io/scratch-n
ew) to open a new project in the Scratch editor. Scratch will open in a new tab in your web browser.
Tip: You can also visit scratch.mit.edu (https://scratch.mit.edu/) and then click on Create.
Scratch on Raspberry Pi
If you are using a Raspberry Pi computer, Scratch may already be installed. Click on the Raspberry Pi
icon to open the menu, then click on Programming, then select Scratch 3.
If you need to install Scratch, follow this process:
Click on the Raspberry Pi icon to open the menu
Click on Preferences
Click on Recommended Software
Select Scratch 3
Click on OK
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 3/122
3/6/24, 6:29 AM Getting started with Scratch
When you use Scratch with this guide or one of our projects, you will need to switch between Scratch
and the project instructions.
Click on (or on a tablet, tap) the title of a browser tab to switch between the Scratch editor and project
instructions.
If you are using Microsoft Windows 10, drag the Scratch tab in your web browser so that it is in a
separate window, and keep dragging until the cursor reaches the right-hand edge of your screen. The
window will then be positioned on the right-hand side of the screen.
Now, drag the window containing this guide or your project instructions to the left-hand side of your
screen until the cursor reaches the left-hand edge. The window will take up the left half of your
screen.
You can resize the windows to get them just the way you want.
Tip: You can also hold down the Windows key and press the Left arrow key or Right arrow key to
position a window in the left or right half of your screen.
Try it now and see how you prefer to work.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 4/122
3/6/24, 6:29 AM Getting started with Scratch
When you are using Scratch in a web browser, you can zoom in or out to adjust the size.
For example, if you are using Microsoft Windows and you want to use zoom on a webpage in Google
Chrome or Microsoft Edge, hold down the Ctrl key and press the + key or - key to zoom in or out.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 5/122
3/6/24, 6:29 AM Getting started with Scratch
If you set up a Scratch account, you can save and keep all your Scratch projects online, and work on
them again in the future.
You can also share your projects and receive feedback, as well as comment on projects made by other
people in the Scratch community.
A Join Scratch dialog box will open. Create a new username, and make sure that it is not your
real name. Then, create a strong password, with a mix of characters, numbers, and symbols.
Then, click on Next.
Choose the country you live in from the drop-down menu, then click on Next.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 6/122
3/6/24, 6:29 AM Getting started with Scratch
Select the month and year you were born. Then, click on Next
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 7/122
3/6/24, 6:29 AM Getting started with Scratch
At some point, you will need to go to your email inbox and confirm your email address.
If you are an educator, you can set up Teacher and Student Accounts.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 8/122
3/6/24, 6:29 AM Getting started with Scratch
The Stage is where the action takes place in your project. The Stage has one or more background images called
backdrops.
Sprites are characters and objects that appear on the Stage. Sprites are given instructions using Scratch code
blocks. This is called programming.
Drag code blocks from the Blocks menu to the Code area to program your sprites and the Stage. Code blocks can
make a sprite move around, change the way that it looks, and play sounds.
Sprites can have multiple costumes. You can change the costume to change the appearance of a sprite. This can
be used for effects such as giving the appearance of walking.
A script is a series of blocks that are joined together to give instructions to the Stage or sprites. The Stage and
sprites can each have many different scripts.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 9/122
3/6/24, 6:29 AM Getting started with Scratch
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 10/122
3/6/24, 6:29 AM Getting started with Scratch
You can click on blocks in the Code area to run them. Click on the move block and the cat will move.
Tip: If you are using Scratch on a tablet, you can tap an item to click on it.
Hat blocks run the blocks below them when a particular event happens. The when green flag
clicked block runs code when you click on the green flag above the Stage to run your project.
Drag a when green flag clicked block above the move block so that they snap together.
when clicked
move 10 steps
Tip: Scratch blocks are colour-coded, so you will find the when green flag clicked block in the
Events blocks menu.
Now, click on the green flag above the Stage and the cat will move.
You can add more sprites to your project, and you can also add a backdrop.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 11/122
3/6/24, 6:29 AM Getting started with Scratch
Choose a sprite
In the Sprite list, click on Choose a Sprite to see the library of all Scratch sprites.
You can search for a sprite, or browse by category or theme. Click on a sprite to add it to your project.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 12/122
3/6/24, 6:29 AM Getting started with Scratch
Choose a backdrop
In the bottom right-hand corner of the Stage pane, click on Choose a Backdrop.
You can search for a backdrop, or browse by category or theme. Click on a backdrop to add to your
project.
Click in the project name box and change the name to match your project.
If you share your project, then other people will also see this name, so make sure that it makes sense.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 13/122
3/6/24, 6:29 AM Getting started with Scratch
You can return to this guide if you need help using Scratch when you are working on our pathway projects or on
your own independent projects.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 14/122
3/6/24, 6:29 AM Getting started with Scratch
Step 6 Motion
Motion blocks allow you to move your sprite around the Stage.
Movement
The move block is the simplest way to ge started with moving a sprite:
move 10 steps
You can go to or glide to the mouse-pointer, a random position on the Stage (or your finger on a tablet), or
another sprite:
go to random position
You can also go to or glide to a position given by x and y coordinates on the Stage.
go to x: 0 y: 0
glide 1 secs to x: 0 y: 0
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 15/122
3/6/24, 6:29 AM Getting started with Scratch
Drag a glide (1) secs to x: y: block into the Code area but don’t attach it to any other blocks yet. This
block has the coordinates of the starting point and will be used later to make the sprite return:
Drag a glide (1) secs to (random position v) block into the Code area and add it to your code at the
point you want the sprite to move.
Click on the dropdown menu and select the name of the sprite you want to glide towards:
Finally, drag the glide (1) secs to x: y: block, that is already in the Code area, to your script to glide
back to the start:
Tip: When you drag a sprite on the Stage, the motion blocks that use x and y coordinates update in the Motion
blocks menu. The current x and y coordinates are show in the Sprite pane.
Rotation
You can also change the direction that a sprite is pointing in. This changes the direction that the sprite will
move in if you use a move block. It may also change the rotation of the sprite’s costume depending on the
rotation-style setting.
When you add a sprite, it will be facing right (90 degrees). You can change this in the Sprite pane or using code
blocks.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 16/122
3/6/24, 6:29 AM Getting started with Scratch
turn 15 degrees
turn 15 degrees
direction
Sprite direction
The direction of a sprite controls how much it is rotated.
When you add a new sprite it points to the right which is a direction of 90 degrees.
Direction Degrees
Up 0
Right 90
Down 180
Left -90
You can change the direction of a sprite in the Sprite pane. Click on the direction number and move the arrow
that appears, or type a number.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 17/122
3/6/24, 6:29 AM Getting started with Scratch
The sprite’s direction is used by the move block. Changing the direction of a sprite may also change the rotation
of the sprite’s costume depending on the sprite’s rotation-style.
Stop a sprite going upside down
When you add a sprite, its rotation-style is set to all around. If you make the sprite point left (-90
degrees) then the sprite costume will go upside down when the sprite rotates!
Sometimes this is what you want, but if you have a sprite that moves left and right then you often want the
sprite to point left or right depending on the direction it is facing.
Click on the Left/Right icon in the middle to change the rotation style to left-right to stop a sprite turning
upside down:
Spin around
This code makes a sprite spin when the green flag is clicked:
when clicked
forever
turn 1 degrees
In a turn block within a forever loop, change the number of degrees to 1 and your sprite will appear to spin.
Tip: If you do not add a move block, your sprite will spin in the position that it is in.
Move in a circle
This code makes a sprite fly in a circle when the green flag is clicked:
when clicked
forever
move 1 steps
turn 1 degrees
Change the values in a move block and turn block within a forever loop to 1 and your sprite will appear to
move in a big circle.
Tip: If you want your sprite to always start in the centre of the Stage, you can add a go to x: 0 y: 0 block
before the forever block.
Bouncing
The if on edge, bounce block is really useful when you want to make a sprite bounce around and stay on the
Stage:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 19/122
3/6/24, 6:29 AM Getting started with Scratch
if on edge, bounce
See some of the ways in which you can get your sprite to bounce around:
This code makes a sprite bounce on the left-hand and right-hand edges of the Stage. Because the sprite
rotates horizontally, it appears to flip when it changes its direction when the green flag is clicked:
when clicked
point in direction 90
forever
move 5 steps
if on edge, bounce
In this example, the point in direction block automatically points the sprite to the right (90 degrees) when
the green flag is clicked. If you change the number of degrees to -90, your sprite will point left.
Add a set rotation style block and select left-right in the drop-down menu, so that your sprite will
not flip upside down when it bounces on the edge of the Stage.
Tip: You can drag your sprite on the Stage to move it to the y (up–down) position that you want.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 20/122
3/6/24, 6:29 AM Getting started with Scratch
when clicked
point in direction 0
forever
move 5 steps
if on edge, bounce
Change the number of degrees in the point in direction block to 0 to make a sprite point upwards.
Add a set rotation style block and select don't rotate in the drop-down menu to stop your sprite
rotating, even when it bounces.
Tip: You can drag your sprite around the Stage to move it to the x (left–right) position that you want.
Bounce at an angle
This code makes a sprite appear to rotate randomly when the green flag is clicked:
when clicked
point in direction 45
forever
move 5 steps
if on edge, bounce
If your sprite moves at 45 degrees, you will find that it appears to bounce on the edge of the Stage at an angle.
Change the number of degrees in the point in direction block to 45 to make your sprite bounce all
around.
Add a set rotation style block and select all around in the drop-down menu, so that your sprite will
turn when it bounces on the edge of the Stage.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 21/122
3/6/24, 6:29 AM Getting started with Scratch
Using coordinates
You can also change and set the x and y coordinates and get their values to use in other blocks:
Scratch coordinates
Scratch coordinates
In Scratch, the coordinates x:0, y:0 mark the central position on the Stage.
A position like x:-200, y:-100 is towards the bottom left on the Stage, and a position like x:200, y:100 is
near the top right.
You can see this for yourself by adding the Xy-grid backdrop to your project.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 22/122
3/6/24, 6:29 AM Getting started with Scratch
change x by 10
set x to 0
change y by 10
set y to 0
x position
y position
Click on a sprite in the Sprite pane and then click on the Code tab to see the Motion blocks.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 23/122
3/6/24, 6:29 AM Getting started with Scratch
Step 7 Looks
Sprites can communicate using Looks, through a say speech bubble, a think thought bubble, or through their
graphic effects.
say
think
The sprite will show a speech bubble for two seconds when clicked.
Space talk: See inside (https://scratch.mit.edu/projects/485673032/editor)
Click on the sprites to see them communicate with speech and thought.
The say () and think () blocks are used to say or think something, until another message or an empty say
() or think () block replaces it.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 24/122
3/6/24, 6:29 AM Getting started with Scratch
Size
Set or change the size of your sprites.
change size by
set size to %
size
set size to 50 %
If you set the size of a sprite to 50 percent, it will be half as tall and half as wide. If you set the size of a sprite to
200 percent, it will be twice as tall and twice as wide.
To set the size of a sprite when the project is started, place a set size to block under a when green flag
clicked block:
when clicked
set size to 50 %
You can also quickly set the size of a sprite in the Size property in the Sprite pane below the Stage:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 25/122
3/6/24, 6:29 AM Getting started with Scratch
Graphic effects
Set or change a range of visual effects, such as colour, fisheye, whirl, pixelate, mosaic, brightness and ghost.
Try to set the different effect values to see what each one does. Explore how different effect changes make
your sprite look.
Tip: A color effect of 225 is the same as a color effect of 25, so you can keep changing the colour. For
other graphic effects, no other changes will be made after you reach the maximum or minimum number for the
effect.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 26/122
3/6/24, 6:29 AM Getting started with Scratch
forever
Use the clear graphic effects block to start again. Clicking on the green flag also clears all graphic
effects.
To set a graphic effect for a sprite when the project is started, place a set graphic effect to block under a
when green flag clicked block:
when clicked
Tip: You can also set and change graphic effects for the Stage.
Costumes
To create an animation effect with your sprites, you can change their costumes.
switch costume to
next costume
costume number
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 27/122
3/6/24, 6:29 AM Getting started with Scratch
wait 1 seconds
Tip: Make sure that you use a block that has a time value, not a start sound, say, or think block, otherwise,
you will not see the costume change.
Note: The set size to block sets the size to a specific value, while the change size by block changes the
value from what it was before, e.g. change size by 10 adds 10 to the value of the size.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 28/122
3/6/24, 6:29 AM Getting started with Scratch
when clicked
forever
change size by 40
change size by 20
This code uses a series of change size by and wait blocks to make the heart grow and shrink. Try to create
your own pulsing sprite.
You could also use the change graphic effect by block to create a sprite that continues to change its
appearance.
when clicked
wait 1 seconds
Note: If you use code that changes a graphic effect and then changes it back again, remember to use a wait
block in between the change graphic effect by blocks, otherwise, it will happen so fast that you won’t
see it!
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 29/122
3/6/24, 6:29 AM Getting started with Scratch
You can use a clear graphic effects block at any time to reset the effects:
You can add actions that make a change to a sprite and then reverse them, such as growing, waiting, and then
shrinking.
Squash ball when clicked: See inside (https://scratch.mit.edu/projects/435723273/editor)
This code will grow a sprite, apply the fisheye effect for 0.5 seconds, and then return the sprite to its starting
appearance:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 30/122
3/6/24, 6:29 AM Getting started with Scratch
repeat 20
move 3 steps
move 3 steps
Tip: If you want to use all the costumes that a sprite has, you can just use the next costume block in a loop.
Tip: Increase the number of steps in each move block to make the sprite go faster. Change the number in the
repeat loop to adjust the distance.
Tip: To make the sprite move backwards, you can use negative numbers, for example, move -3 steps. Or, you
can use a point in direction -90 block to change the sprite’s direction before the sprite moves (-90
points to the left).
Backdrops
You can use code to change the backdrop too.
switch backdrop to
next backdrop
backdrop number
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 31/122
3/6/24, 6:29 AM Getting started with Scratch
There are lots of ways to move to the next backdrop. Choose one that works for your project.
next backdrop
next backdrop
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 32/122
3/6/24, 6:29 AM Getting started with Scratch
next backdrop
wait 5 seconds
next backdrop
Visibility
The show and hide blocks control the visibility of a sprite.
show
hide
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 33/122
3/6/24, 6:29 AM Getting started with Scratch
show
hide
Set the backdrop when green flag clicked to make sure that sprites show or hide correctly on the first
backdrop:
when clicked
Tip: You can also make sprites show and hide when green flag clicked.
Layers
To change how your sprites appear in relation to each other, you can use layers.
go to front layer
go forward layers
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 34/122
3/6/24, 6:29 AM Getting started with Scratch
Alternatively, you can use a go to front layer or go to back layer block to position a sprite.
If you want a sprite to always stay at the front or back, use a forever loop to make the sprite move back to
the correct layer if you accidentally move it:
when clicked
forever
when clicked
go to front layer
go backward 1 layers
Change the value in the go backward 1 layers block for each sprite, depending on where you want it to be
positioned in relation to other sprites:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 35/122
3/6/24, 6:29 AM Getting started with Scratch
when clicked
go to front layer
go backward 2 layers
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 36/122
3/6/24, 6:29 AM Getting started with Scratch
Step 8 Sound
To add sound to your project, use Sound blocks. For example, you can create a continuous background
soundtrack, or add sounds that play at regular intervals.
First, select a sound from the Sound Library, or record your own sound.
Select the sprite that you want to have the new sound, then select the Sounds tab. Each sprite starts with a
default sound:
Scratch has a library of sounds that you can add to your sprites. Click on the Choose a Sound icon to open the
Sound Library:
To play a sound, hold your mouse cursor (or your finger, if you are using a tablet) over the Play icon:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 37/122
3/6/24, 6:29 AM Getting started with Scratch
Click on any sound to add it to your sprite. You will be taken straight back to the Sounds tab and you will be able
to see the sound that you have just added:
If you switch to the Code tab and look at the Sound blocks menu, you will be able to select the new sound:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 38/122
3/6/24, 6:29 AM Getting started with Scratch
When you are ready, click the Record button to start recording your sound:
Your new recording will be shown. You can Re-record your sound if you are not happy with it.
Drag the orange circles to crop your sound; the part of the sound with a blue background (between the orange
circles) will be the part that is kept:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 39/122
3/6/24, 6:29 AM Getting started with Scratch
When you are happy with your recording, click the Save button. You will be taken straight back to the Sounds
tab and you will be able to see the sound that you have just added:
If you switch to the Code tab and look at the Sound blocks menu, you will be able to select the new sound:
Add code to run Sound blocks where you want sound in your project.
You can use a play sound until done block inside a forever loop. Once the sound has finished, the
forever loop makes the sound start again from the beginning.
when clicked
forever
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 40/122
3/6/24, 6:29 AM Getting started with Scratch
Note: When you choose a new sound, if you select the Loops category, Scratch will only show you the sounds
that are suitable for a single looping soundtrack.
when clicked
forever
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 41/122
3/6/24, 6:29 AM Getting started with Scratch
In this project, the Stage has code to play a sound at regular intervals:
when clicked
forever
wait 3 seconds
forever
wait 4 seconds
When you start sound, the sound will play, but the next block will run immediately and will not wait for
the sound to finish playing first.
This means that if you had a series of start sound blocks, the sounds would all play almost at the same time,
layered on top of each other. The effect can be interesting and sometimes messy.
Have a play with it sometime!
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 42/122
3/6/24, 6:29 AM Getting started with Scratch
when clicked
Once you have chosen your sounds, you may want to change the volume, pitch, or pan (so you hear the sound
from the left- or right-hand speaker).
set volume to 80 %
You can set volume to a value from 0 (silent) to 100 (full volume). This is useful if you want some sounds
to play louder than others, or if you want a sprite to appear further away.
The pitch effect controls how high or low a sound is. Setting the pitch to a higher value also makes a
sound faster. You can set pitch effect to values between -360 (very low) and 360 (very high).
The pan left/right effect allows you to control whether a sound comes out of a left- or right-hand
speaker or headphone or both. You can set pan left/right effect to values from -100 (all sound
from the left) to 100 (all sound from the right).
You can also use the Text to Speech extension:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 43/122
3/6/24, 6:29 AM Getting started with Scratch
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 44/122
3/6/24, 6:29 AM Getting started with Scratch
You can use the blocks in the Text to Speech blocks menu to make your sprites talk out loud.
speak Hola
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 45/122
3/6/24, 6:29 AM Getting started with Scratch
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 46/122
3/6/24, 6:29 AM Getting started with Scratch
Step 9 Events
when clicked run blocks when the green flag above the Stage is clicked
when this sprite clicked run the blocks when the sprite for this script is clicked
when stage clicked run the blocks when the stage is clicked
Tip: The when stage clicked block is only available when you are working in the Code area for the Stage.
If you are on a computer with a keyboard, you can use when key pressed:
You can also use a when backdrop switches to block to start a script when the backdrop changes.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 47/122
3/6/24, 6:29 AM Getting started with Scratch
There are lots of ways to move to the next backdrop. Choose one that works for your project.
next backdrop
next backdrop
next backdrop
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 48/122
3/6/24, 6:29 AM Getting started with Scratch
wait 5 seconds
next backdrop
show
hide
Set the backdrop when green flag clicked to make sure that sprites show or hide correctly on the first
backdrop:
when clicked
Tip: You can also make sprites show and hide when green flag clicked.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 49/122
3/6/24, 6:29 AM Getting started with Scratch
when loudness > 10 run blocks when the microphone detects sound
when timer > 10 run blocks when the timer reaches 10 seconds
You can make a script run a number of seconds after the green flag is clicked:
when clicked
Add blocks underneath the wait block to run after the delay.
The last two blocks in the Events menu are broadcast blocks. You can use when i receive (message v)
to start a script when any sprite runs a matching broadcast (message v) block.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 50/122
3/6/24, 6:29 AM Getting started with Scratch
Send a broadcast
You can decide when to broadcast your message. For example:
broadcast shrink
broadcast start
Receive a broadcast
Sprite can react to a broadcast by using a when I receive block. Multiple sprites can respond when they
receive the same message.
You can add blocks below a when I receive block to tell the sprite(s) what to do when they receives the
message.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 51/122
3/6/24, 6:29 AM Getting started with Scratch
go to x: 100 y: 50
show
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 52/122
3/6/24, 6:29 AM Getting started with Scratch
Step 10 Control
Control blocks control the order that blocks run in, including decisions (selection) and loops (repetition).
The wait block delays for a number of seconds before running the next block.
Loops control how many time the code inside them runs.
You can do this by placing an if block inside a forever block. You will need to trigger the script, for example
with a when flag clicked or when I receieve block.
You can check for important conditions in a game:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 53/122
3/6/24, 6:29 AM Getting started with Scratch
forever
go to Start
forever
Tip: You can stop a forever block by clicking the Stop button above the Stage, or by using the stop blocks.
There are three options for the stop block:
The if...then and if...then...else blocks are used to make decisions about which code blocks to run
next. This is sometimes called selection. The if...then block checks a hexagonal-shaped condition and runs
the code blocks inside, if the condition is true. The if...then..else block has an additional section to run the
code blocks inside, if the condition is false.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 54/122
3/6/24, 6:29 AM Getting started with Scratch
if then
if then
else
if then
There are lots of hexagonal shaped condition blocks in Scratch, including blocks in the Sensing and
Operators blocks menus.
touching mouse-pointer ?
touching color ?
= 50
If you want to run different blocks when the condition is false then use an if...then...else block instead:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 55/122
3/6/24, 6:29 AM Getting started with Scratch
hide
else
You can build more complex checks by ‘nesting’ if...then and if...then...else blocks one inside the
other.
You can find hexagonal-shaped blocks to use as conditions in the Operators and Sensing blocks menus.
The wait until and repeat until blocks also use conditions:
repeat until repeat the blocks inside until the condtion is true
A clone is a copy of a sprite, it has the costumes, scripts and sounds held by the sprite it was cloned from at the
time of cloning. There are a number of blocks that can be used to clone sprites.
With the create clone of [myself v] block, a sprite can create a clone of itself or of another sprite in the
project.
create clone of myself clones the sprite that runs this block
The when I start as a clone hat block is used to trigger a new script once the clone has been created. The
clone will exist in the project until the delete this clone cap block is used.
Using the when I start as a clone hat block then including the create clone of [myself v] block in
the script underneath means it is also possible for clones to create other clones.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 56/122
3/6/24, 6:29 AM Getting started with Scratch
when I start as a clone the script that runs when the clone is created
There is a maximum number of clones a sprite can have at any point, at the time of writing this is 300.
Clones of clones
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 57/122
3/6/24, 6:29 AM Getting started with Scratch
Step 11 Sensing
The blocks in the Sensing blocks menu are used to get user text input, detect conditions, and report on values in
your project.
There are several hexagonal Sensing blocks that you can use in Control blocks to make decisions and control
when blocks run.
The touching block has options for detecting whether the sprite that owns the script is touching the mouse
pointer (where you finger last touched on a tablet), the edge of the Stage, or another sprite:
touching mouse-pointer ?
touching edge ?
touching Sprite2 ?
There are blocks for detecting whether the sprite that owns the script is touching another colour (on the Stage or
another sprite), or whether a colour on this sprite is touching another colour.
touching color ?
color is touching ?
The key pressed block has options for number, letter, and arrow keys. You need a keyboard to be able to enter
keys. It detects whether the key is currently being pressed:
The mouse down block detects whether the mouse is currently pressed, or the screen is being tapped or touched
on a touchscreen:
mouse down?
The ask and answer blocks are used to get text input from the user:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 58/122
3/6/24, 6:29 AM Getting started with Scratch
The ask block works with a keyboard or with a virtual on-screen keyboard on a tablet.
The answer block is a reporter block that reports a value and can be used as a variable.
ask Did you find everything you wanted today? and wait
else
Debug: Check that you have spelled the options correctly in your code and in your answer. It’s okay if you use
capital letters, so “Yes” and “YES” will match “yes”.
Add multiple questions to create a chatbot or non-player character that you can talk to.
Tip: If you hide the sprite that asks a question, then question will appear inside the input box instead of as a
speech bubble.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 59/122
3/6/24, 6:29 AM Getting started with Scratch
The Sensing blocks menu also contains several reporter blocks that can be used to get values:
distance to mouse-pointer
distance to Sprite2
You can detect the current position of the mouse-pointer (or the current or most recent position of your finger on a
tablet):
mouse x
mouse y
You can detect the loudness of sound from the microphone. A pop-up window will ask the user for permission to
use the microphone:
loudness
The timer starts counting when the project loads, and can be set back to 0 with reset timer:
timer
reset timer
You can also access reporters for the Stage and other sprites:
backdrop # of _stage_
x position of Sprite2
costume # of Sprite2
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 60/122
3/6/24, 6:29 AM Getting started with Scratch
There are reporters related to the date and time in the real world, in your local timezone:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 61/122
3/6/24, 6:29 AM Getting started with Scratch
Step 12 Operators
The Operators blocks are used to compare variables and values, do calculations with numbers, and work with
strings (text).
The hexagonal ‘Boolean’ blocks are used as conditions, and return true or false. These blocks can be used in
Control blocks with a hexagonal input.
Comparison operators:
> 50
< 50
= 50
Tip: When you use = with text you can mix upper and lower case letters, so < YES = yes > returns true.
There are maths operations:
You can choose random numbers between the smallest and largest number (including those numbers).
The and, or, and not operators can be used to combine conditions.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 62/122
3/6/24, 6:29 AM Getting started with Scratch
and
or
not
letter 1 of apple
length of apple
apple contains a ?
Replace the text with the text you want to use, or drag in a variable:
Tip: The join block doesn’t add spaces so you will need to type them.
You can drag a join block inside another join to create longer text strings:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 63/122
3/6/24, 6:29 AM Getting started with Scratch
say join Hi, I'm join name the cat for 2 seconds
Notice the ‘space’ at the end of Hi, I'm and the beginning of the cat.
There are also more maths operators that are useful for some projects.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 64/122
3/6/24, 6:29 AM Getting started with Scratch
Step 13 Variables
Type in the name of your variable. You can choose whether you would like your variable to be available to all
sprites, or to only this sprite. Press OK.
Once you have created the variable, it will be displayed on the Stage, or you can untick the variable in the
Scripts tab to hide it.
You should think about whether you need to set a starting value when you make a variable:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 65/122
3/6/24, 6:29 AM Getting started with Scratch
Type in the name of your variable. You can choose whether you would like your variable to be available to all
sprites, or to only this sprite. Press OK.
If you want to hide the variable on the Stage, uncheck the box next to the variable in the Variables blocks
menu.
Setting a start value
If your variable should have the same starting value every time your project is run, then add a script to set it:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 66/122
3/6/24, 6:29 AM Getting started with Scratch
when clicked
set total to 0
Rename a variable
This will change the name of the variable in all the blocks in which you have used it.
Tip: Make sure you know the difference between set and change by. set will replace the value stored in a
variable. change by will change the value of a number variable by the amount you choose, change by1 will add
one to a variable. change by-1 will take one away from a variable.
Tip: Variables on the Stage always appear in a layer above all of the sprites. If you have a moving sprite, the sprite
will go under any variables on the Stage.
You can use a slider to control the value in a variable.
Tip: On a tablet, double tap on the variable on the Stage to change between the display options.
Right-click again on the variable displayed on the Stage and select change slider range.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 67/122
3/6/24, 6:29 AM Getting started with Scratch
The value range that is right for your variable depends on what you are using it for. Sometimes you will need to
experiment a little to get it right, but remember that you can change it at any time.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 68/122
3/6/24, 6:29 AM Getting started with Scratch
At the end of the game (or whenever you want to update the high score), you’ll need to check whether you have
a new high score.
Drag a join block into the block where you want to use it:
Replace the text with the text you want to use, or drag in a variable:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 69/122
3/6/24, 6:29 AM Getting started with Scratch
Tip: The join block doesn’t add spaces so you will need to type them.
You can drag a join block inside another join to create longer text strings:
say join Hi, I'm join name the cat for 2 seconds
Notice the ‘space’ at the end of Hi, I'm and the beginning of the cat.
Tip: any sprite could be a button but there are already some button sprites in Scratch that you can use.
Click on the Variables Blocks menu and select the Make a Variable button.
Give the variable a name that is easy to recognise.
You will need to add code to your button sprite to update the variable. You could:
Use the button to set the variable to a new value.
set speed to 10
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 70/122
3/6/24, 6:29 AM Getting started with Scratch
Use the button to change the existing value in a variable by a new amount.
change score by 1
Use the button to ask a question and set the variable to the answer.
Inserting a change block into a loop will change your variable each tim the loop runs.
repeat 10
change speed by 1
The code below would increase a player’s score the longer they played the game:
forever
wait 10 seconds
change score by 1
The code below would keep running the loop adding 1 to the time variable until time = 50.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 71/122
3/6/24, 6:29 AM Getting started with Scratch
wait 1 seconds
change time by 1
You can also use built in Scratch variables, such as size, costume number, volume and direction:
repeat 10
change size by 10
change volume by 5
when clicked
go to front layer
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 72/122
3/6/24, 6:29 AM Getting started with Scratch
when clicked
forever
Try using the same approach with other graphic effects such as brightness or color.
Control movement speed with a variable
when clicked
forever
if on edge, bounce
Set the minimum and maximum values for the range of the slider to suit your project.
when clicked
forever
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 73/122
3/6/24, 6:29 AM Getting started with Scratch
when clicked
forever
next costume
A delay of more than one second is quite a long time. If you include a decimal number in the range of a slider,
then you can change the value by a 100th of a second at a time.
A range of 0.00 to 1.00 allows you to choose a delay between 0 seconds (no delay) and 1 second.
Change the numbers to get the minimum and maximum values that you want users to be able to use in your
project.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 74/122
3/6/24, 6:29 AM Getting started with Scratch
when clicked
forever
Play the sound in a separate forever loop, so that the pitch will change immediately, rather than waiting until
the sound has finished playing:
when clicked
forever
You can also use a variable to change the volume and pan (tilt) effect.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 75/122
3/6/24, 6:29 AM Getting started with Scratch
Step 14 My blocks
My blocks allow you to create new blocks for a sprite. You give the block a name and then define what the new
block does using other Scratch blocks. You can use your new block in any script on the sprite that owns the block.
This example defines a talk block that makes a sprite change costume:
define talk
repeat 2
talk
talk
You can use My blocks to organise your code. It’s simpler to group together all the blocks that make a sprite talk
and then just use one talk block when you want your sprite to talk.
If you decide that you want to change the way your sprite talks then you only have to change the code in one
place.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 76/122
3/6/24, 6:29 AM Getting started with Scratch
repeat 2
say words
talk hello
talk hi
Making a block
Making a block
Click on My Blocks, and then click Make a Block.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 77/122
3/6/24, 6:29 AM Getting started with Scratch
You will see a new define block. Attach code to this block.
You can then use your new block just like any normal block.
The code attached to your new define block is run whenever the block is used.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 78/122
3/6/24, 6:29 AM Getting started with Scratch
You will see a new define block as usual, except that this one contains the data gap you added and which
you gave a name.
You can then use your new block, filling in data in the gap.
As usual, the code attached to your new define block is run whenever the block is used.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 79/122
3/6/24, 6:29 AM Getting started with Scratch
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 80/122
3/6/24, 6:29 AM Getting started with Scratch
change x by 2
change x by 2
change x by 2
change x by -2
change x by -2
change x by -2
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 81/122
3/6/24, 6:29 AM Getting started with Scratch
when clicked
forever
move right
move left
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 82/122
3/6/24, 6:29 AM Getting started with Scratch
Step 15 Extensions
The extensions library allows you to add new blocks to the blocks menu with additional features.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 83/122
3/6/24, 6:29 AM Getting started with Scratch
You can use the blocks in the Text to Speech blocks menu to make your sprites talk out loud.
speak Hola
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 84/122
3/6/24, 6:29 AM Getting started with Scratch
The Pen section then appears at the bottom of the blocks menu.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 85/122
3/6/24, 6:29 AM Getting started with Scratch
To use the Music blocks in Scratch, you need to add the Music extension.
Click on the Add extension button in the bottom left-hand corner.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 86/122
3/6/24, 6:29 AM Getting started with Scratch
The Music section then appears at the bottom of the blocks menu.
If you are using a Raspberry Pi computer then you can also use extensions for using electronics with the Raspberry
Pi (you will need extra components or a Sense Hat):
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 87/122
3/6/24, 6:29 AM Getting started with Scratch
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 88/122
3/6/24, 6:29 AM Getting started with Scratch
Use the Paint editor to create your own backdrops and costumes, and to edit existing backdrops and costumes.
You will be taken to the Paint editor, where the new backdrop will be highlighted in the list. If you have other
backdrops in your project, you will also see them in the list.
To set the main colour of the backdrop, click on the Rectangle tool, then use the Fill colour chooser to select a
colour, then drag the shape over the full backdrop canvas:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 89/122
3/6/24, 6:29 AM Getting started with Scratch
If you want to add more details to your backdrop, you can use the Rectangle tool, Circle tool, or Brush tool, or a
combination of all three!
When you have finished, make sure that you give your new backdrop a name that makes sense:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 90/122
3/6/24, 6:29 AM Getting started with Scratch
Your new backdrop will be shown on the Stage and will be available to use in Looks blocks.
Select which
tool(s) to use to
make the
shape(s) that
you want:
Circle: Click on
the Circle tool
to draw a
circle. Press
and hold the
Shift key on
your keyboard to draw a perfect circle.
Rectangle: Click on the Rectangle tool to draw a rectangle. Press and hold the Shift key to draw a square.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 91/122
3/6/24, 6:29 AM Getting started with Scratch
Triangle: Use the Rectangle tool to draw a rectangle or a square. Click on the Reshape tool and select the
corner that you want to remove. Click on the Delete tool to turn your shape into a triangle.
You can use the Fill tool to change the colour of a shape:
You may need to use the Forward and Backward tools to move your shapes forward or backward so that they
are positioned correctly within your image:
You can select all the shapes and Group them together so that you can adjust them or move them as one
shape:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 92/122
3/6/24, 6:29 AM Getting started with Scratch
Here is an example of a sprite created with the Circle and Rectangle tools:
If you want to resize your text, click on the Select (Arrow) tool and select the text, then drag the corner handles
to resize the text:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 93/122
3/6/24, 6:29 AM Getting started with Scratch
If you want to change the Fill colour of your text, use the Fill colour chooser to select a colour, then select the
Fill (Bucket) tool and hold your mouse cursor over the text (or if you are using a tablet, tap the text). The text will
automatically change colour. Click on the text to make the change:
If you want each word in a message to be a different colour, size, and font, follow the process above for each
word in your message.
Position your text and/or group of words with the crosshair in the centre of the Paint editor:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 94/122
3/6/24, 6:29 AM Getting started with Scratch
You will need to position and resize the added costume in the Paint editor, to match the sprite’s other costumes.
Tip: If you position a sprite on the Stage and then change its costume, the sprite might appear to ‘jump’ or
change size. You will need to position and resize the costumes in the Paint editor so that they all appear in the
right position on the Stage.
Centre your costumes
Sprites rotate around their centre. You can see if your sprite is centred by looking at the small grey crosshair
shown in the Paint editor:
If the crosshair is not at the centre of your costume, you can use the Select tool to highlight the full costume. A
cross will then show in the centre of your highlighted costume:
You can drag the highlighted costume so that the cross in the costume aligns with the crosshair:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 95/122
3/6/24, 6:29 AM Getting started with Scratch
Occasionally, you might want to choose a point to rotate around that is not the centre of the costume. In that
case, you can align your chosen costume rotation point with the crosshair in the Paint editor:
To remove any part of the costume that you do not need any more, click on the part to select it, then click on
Delete:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 96/122
3/6/24, 6:29 AM Getting started with Scratch
The duplicated costume with parts removed should look something like this:
Tip: If you make a mistake in the Paint editor, you can click on Undo:
Go to the costume with the part that you want to add and click on the part that you need, then click on Copy:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 97/122
3/6/24, 6:29 AM Getting started with Scratch
If you want to add a part from a costume that is not already shown in the Costumes tab, you need to add the
costume to your sprite first. Click on the Choose a Costume icon, then find the costume that you want and click
on it to add it to your sprite:
When you have copied the part that you need, go back to the duplicated costume and click on Paste. The
duplicated costume should now look something like this:
Now, switch to the Code tab. You will be able to use the new costume in your code blocks:
Right-click (or on a tablet, tap and hold) on the costume, and choose duplicate.
Make small changes to the copy of the costume. For example, you can move, rotate, or change all or part of the
costume. You can also add movement lines.
If your costume uses vector graphics, then you can select parts of a costume and change each part separately.
You can duplicate the costume again and make more changes to add more frames to your animation.
You can now use your costumes in a simple sprite animation.
Go to the Fill colour chooser and select a colour. It will automatically fill the shape that you have selected.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 99/122
3/6/24, 6:29 AM Getting started with Scratch
Repeat the steps above for any part of the costume that you have missed, or for any other part of the costume
you want to change colour.
Use the tips below to help you to create your own designs for your sprites in the Paint editor.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 100/122
3/6/24, 6:29 AM Getting started with Scratch
To make your own Hill sprite, shown in the example above, you can use the Circle and Rectangle tools in the
Paint editor:
Go to Choose a Sprite and select Paint to create a new sprite costume.
Choose a Fill colour. Click on Outline and deselect it (to do this, click on the box with the diagonal line in the
bottom left-hand corner of the menu). Now, use the Circle tool to draw an oval. Then, select the Rectangle
tool and draw a rectangle underneath the oval.
If you use varying colours for the shapes, you may need to use the Front and Back tools in the Paint editor
to move your shapes forward or backward so that they are positioned correctly within your background.
You can select all the shapes and Group them together so that you can adjust them or move them as one
shape.
Now, make other sprites for your scenery, if this fits in with your project idea.
Remember to name your sprite(s).
Use the Line tool to create a triangle
You can create polygons, such as a triangle, and use these shapes to create roofs or mountains.
Go to Choose a Sprite and select Paint to create a new sprite costume. In this example, you will make houses.
House: See inside (https://scratch.mit.edu/projects/453595663/editor)
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 101/122
3/6/24, 6:29 AM Getting started with Scratch
If you follow the instructions below, you can use the Line tool to create any shape:
Choose a Fill colour. To choose the colour black, decrease the Brightness to zero (0).
Select No outline.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 102/122
3/6/24, 6:29 AM Getting started with Scratch
The effect of multiplying shapes is used by professional animators to create the impression of weather patterns,
such as rain or clouds; a cluster of objects, such as buildings or a wood; or a crowd of people in a scene.
To multiply any type of shape:
Go to Choose a Sprite and select, in this example, the Cloud sprite
In the Costumes tab, use the Select tool to highlight the whole of the shape
Use the Copy and Paste tools to create duplicates of the shape
Use the Select tool to move the shape within the Paint editor
You can vary the size of the shapes to help to create a greater sense of 3D effects, for example
You can select all the shapes and Group them together, so that you can adjust them or move them as one
shape
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 103/122
3/6/24, 6:29 AM Getting started with Scratch
Tip: If you find it hard to manage the sprites on your Stage, such as having a large sprite that keeps covering a
much smaller one, you can click on Hide so that you don’t see a sprite or sprites. Then, when you have finished,
click on Show again.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 104/122
3/6/24, 6:29 AM Getting started with Scratch
Use the Sound editor to add and edit existing sounds, and to record your own sounds.
Creating sounds
Scratch has a library of sounds that you can add to your sprites. Click on the Choose a Sound icon to open the
Sound Library:
To play a sound, hold your mouse cursor (or your finger, if you are using a tablet) over the Play icon:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 105/122
3/6/24, 6:29 AM Getting started with Scratch
Click on any sound to add it to your sprite. You will be taken straight back to the Sounds tab and you will be able
to see the sound that you have just added:
If you switch to the Code tab and look at the Sound blocks menu, you will be able to select the new sound:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 106/122
3/6/24, 6:29 AM Getting started with Scratch
When you are ready, click the Record button to start recording your sound:
Your new recording will be shown. You can Re-record your sound if you are not happy with it.
Drag the orange circles to crop your sound; the part of the sound with a blue background (between the orange
circles) will be the part that is kept:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 107/122
3/6/24, 6:29 AM Getting started with Scratch
When you are happy with your recording, click the Save button. You will be taken straight back to the Sounds
tab and you will be able to see the sound that you have just added:
If you switch to the Code tab and look at the Sound blocks menu, you will be able to select the new sound:
Editing sounds
Edit whole sounds or parts of sounds.
Reverse a sound
Reversing sounds are useful for creating special effects, for example the Slide whistle sound makes a good
shrinking effect, so reversing it makes the perfect growing effect!
Add or record a sound.
Click on the Reverse icon to make the sound play backwards. You will see the sound wave reverse.
Tip: To keep both the original version and the reversed version of the sound, right-click (or tap and hold) on the
original sound and choose ‘duplicate’.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 108/122
3/6/24, 6:29 AM Getting started with Scratch
Crop a sound
Select the sound to be edited.
Choose a starting position for your edited sound on the sound wave then left-click and hold. Drag your mouse
pointer to the new end position for your sound and release. You will see a highlighted area on the sound wave.
If you are using a tablet using your mouse or finger to tap and drag over the sound wave.
Use the sound editor tools to Copy, Copy to New, Paste or Delete the highlighted section of the sound.
Tip: You can use the Undo tool to reverse any changes you are not happy with.
The sound editor has tools to change the speed, volume and fade effects of a sound - you can also make it
robotic!
To apply an effect to the whole sound click on a sound effect tool below the sound wave:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 109/122
3/6/24, 6:29 AM Getting started with Scratch
Click on the sound effect tools as many times as you like as each time it will apply the effect again.
To apply an effect to part of a sound, choose a starting position for your effect on the sound wave then left-click
and hold.
Drag your mouse pointer to the effect end position and release. You will see a highlighted area on the sound
wave.
If you are using a tablet using your mouse or finger to tap and drag over the sound wave.
Click on a sound effect tool. The sound wave will update and you can play your new sound:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 110/122
3/6/24, 6:29 AM Getting started with Scratch
Step 18 Debug
Debugging is finding and fixing mistakes in your code that are called bugs.
It’s easier to identify issues if you make one change at a time, and then run your program
It might take a few experiments for your project to work in the way that you planned
Here are some tips that can help you to debug a project when it is not doing what you want it to do:
To test a set of blocks on their own, drag them away from their containing script, click on them to test
them, then drag them back to the main script
If your project uses variables to store data, then it can be helpful to show those variables on the Stage.
Click on the checkbox next to a variable in the Variables blocks menu to show or hide it on the Stage.
Does the variable always have the value that you expect?
Add comments
Add comments to blocks, sets of blocks, and/or scripts. Use everyday language to explain what the code does.
Sometimes, this will make you realise that your code does not actually do what you want it to do!
Comments are useful for when you want to understand your code later, and they help other people to
understand your projects.
There are common problems that lots of beginners (and experts!) experience in Scratch.
My sprite is going upside down — Add a set rotation style left-right or set rotation
style don't rotate block.
My sprite ‘jumps’ when it changes costume or bounces — Make sure that the costume is centred in the
Paint editor (line up the blue cross in the costume with the crosshair in the centre of the Paint editor).
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 111/122
3/6/24, 6:29 AM Getting started with Scratch
My sprite stops when it gets to the edge of the Stage — Add an if on edge, bounce block.
My sound does not play — Have you added a block to play sound when the sprite is clicked? If you have
copied code from another sprite, you will need to add the sound to this sprite in the Sounds tab. Check the
volume on your computer or tablet, and make sure that you have not lowered the volume with code — try
set volume to 100.
Other sprites keep going in front of my sprite — Use a go to front layer block.
My sprite only moves/changes once — Put your code inside a forever block so that it keeps running.
My sprite does not change when I move a variable slider — Put your code inside a forever block so that
it keeps updating.
Tip: If you cannot find the problem after you have tried these techniques, then take a break or work on a different
part of your project. When you come back, you might find the bug straight away!
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 112/122
3/6/24, 6:29 AM Getting started with Scratch
It’s useful to learn how to copy and delete code blocks, and duplicate sprites.
Tip: You can use Ctrl-z (hold down the Ctrl key and tap ‘z’) to undo lots of actions in Scratch. If you accidentally
delete a Sprite or other item, you can use Restore from the Edit menu to get it back.
You can delete code blocks you don’t need any more:
To delete a group of blocks, left-click on the top block to be deleted and drag it to the Blocks menu. All blocks
underneath it will be deleted too.
To restore blocks you have deleted in error, right-click and select Undo from the menu.
You can also delete a sprite by clicking on the sprite’s Trash can in the Sprite pane.
To restore a sprite, including all of its code blocks, go to the Edit menu and select Restore Sprite
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 113/122
3/6/24, 6:29 AM Getting started with Scratch
Duplicating or copying code can save you time when making a project.
Duplicate blocks
Duplicate blocks or sets of blocks to reuse in a sprite’s program:
Duplicate a sprite
Right-click (or on a tablet, tap and hold) on your first sprite in the Sprite list below the Stage:
Select duplicate. This will create a copy of your first sprite, with the suffix “2”:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 114/122
3/6/24, 6:29 AM Getting started with Scratch
Your second sprite has exactly the same code as your first sprite. Do not run the program until you have started
to change the second sprite’s code — you might not see the second sprite because it might be positioned
underneath the first sprite.
Create a new sprite and copy over all or some of the first sprite’s code.
Your second sprite will now have exactly the same code as your first sprite. Do not run the program until you
have started to change the second sprite’s code — you might not see the second sprite because it might be
positioned underneath the first sprite.
If you want to copy costumes, sprites, sounds, and scripts between projects, drag them into the Backpack.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 115/122
3/6/24, 6:29 AM Getting started with Scratch
To add a sprite to your Backpack, drag the sprite from the Sprite list to the Backpack. This will store the full
sprite in your Backpack, including all of its costumes, sounds, and scripts.
To add a backdrop to your Backpack, select the Stage pane and click on the Backdrops tab, then choose
the backdrop that you want and drag it to your Backpack.
To use an item in your Backpack in another project, open the project and drag the item from the Backpack to
the correct pane or tab.
To delete an item in your Backpack, find the item in the Backpack tab, then right-click (or on a tablet, tap
and hold) on the item and select delete.
You can hide your Backpack when you are not using it. To do this, click on the Backpack tab at the bottom
of the screen.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 116/122
3/6/24, 6:29 AM Getting started with Scratch
It’s always worth spending some time making sure you have followed best practices so your project is easy to
understand.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 117/122
3/6/24, 6:29 AM Getting started with Scratch
To let other people access your project, make your project public. You can also share your project’s
unique web address with other people.
Please make sure that you do not share any personal information about yourself when sharing your
Scratch projects.
Give your Scratch project a name.
If you like, you can add instructions in the Instructions box, to tell other people how to use your
project.
You can also fill in the Notes and Credits box: if you have made an original project, you can write
some short comments, or if you have remixed a project, you can credit the original creator.
Click the Copy Link button to get the link to your project. You can send this link to other people by
email or text, or on social media.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 118/122
3/6/24, 6:29 AM Getting started with Scratch
Scratch provides the ability to comment on your own and other people’s projects. If you do not want
to allow people to comment on your project, you should turn off commenting. To turn off commenting,
set the slider above the Comments box to Commenting off.
Copy the web address and paste it into an email, or write down the web address and give it to the
person who you want to share the project with
Tip: You can access completed Scratch projects on a computer or mobile device.
Include all the instructions that the user needs to explore your project fully.
Make sure that your instructions are given step by step and are simple. Instructions are easier to
read if you write them in a list.
Include all the user interaction, such as clicking on the green flag to start, and which sprites to
click on.
Let the user know if the project includes sound, as they may need to wear headphones or turn the
volume up on their device.
In the Notes and Credits box:
Thank the people who created the projects that inspired you. You could even include the web
addresses of the projects.
Did you include images or sounds that were created by someone else? If so, credit the source(s)
in this box.
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 119/122
3/6/24, 6:29 AM Getting started with Scratch
If you are happy and feel safe to allow people to write comments on your project, you can leave the
first comment:
If you think a comment or project is mean, insulting, too violent, or otherwise inappropriate, click the
Report button to let the Scratch Team know about it. To report a comment, click the Report button
above the comment. To report a project, click the Report button on the Project Page:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 120/122
3/6/24, 6:29 AM Getting started with Scratch
Our Scratch paths have six projects each, to help you learn different skills in Scratch, in order to create your own
projects independently.
You can return to this reference guide, Getting started with Scratch, whenever you need to remind yourself of the
skills you have learnt.
These projects can be completed on any computer or tablet that runs Scratch 3.
Beginner Scratch projects
If you are new to Scratch, start with our pathways for beginners:
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 121/122
3/6/24, 6:29 AM Getting started with Scratch
Did you enjoy the Scratch guide? Have you spotted an issue? Please click the Send feedback button below and let
us know!
https://projects.raspberrypi.org/en/projects/getting-started-scratch/print 122/122