Projects
Welcome to my world
Build a 2.5D world to explore and interact with.
Step 1 You will make
You are going to create a 2.5D scene or what is sometimes called a first person view (FPV) scene. Your game will
need to meet the project brief.
A 2.5D game uses tricks to make a two-dimensional scene have the appearance of being three dimensional.
A FPV game mimics a real 3D environment, so that you view the virtual world from the perspective of the
playing character in the game.
You will:
Make a 2.5D scene
Use My Blocks and clones to generate the scene
Understand how the size and coordinates of a sprite can affect its perspective
PROJECT BRIEF: 2.5D simulation
You need to create a 2.5D simulation that the user can interact with. The simulation will be from a first person
view, so that the user appears to be looking through the screen at the environment you’ve created.
Your simulation should:
Use different sized sprites to represent the distance of the object from the viewer
Use clones to generate copies of sprites
Use My Blocks to keep your code organised and/or allow the use of inputs
Your simulation could:
Have an educational theme, to try and teach the user a skill
Use sounds or music to make the simulation appear more realistic
Step 2 Your idea
Use this step to plan your virtual environment.
What will you make?
Think about the simulation you want to create, and how the user will interact with the project.
It could be:
A nature simulation with on-screen controls to move around the scene
A room in a house where different sprites, such as a TV, can be clicked to make them work
A vehicle simulator with a steering wheel, pedals, and a gearstick
Who is it for?
Think about who you will make your simulation for (your audience). Is it an educational simulation to
teach people? Is it a game for entertainment? Maybe it’s a series of puzzles that need to be solved.
Get started
Open a new Scratch project (http://rpf.io/scratch-new). Scratch will open in another browser tab.
Working offline
To set up Scratch for offline use, visit our Scratch guide (https://learning-admin.raspberrypi.org/
en/projects/getting-started-scratch/1).
Use a notes app or pen and paper, or both to plan ideas for your simulation. Try to jot down as many
ideas as you can, and discuss them with a friend. Then pick the idea that you like the most.
This simulation is going to need quite a few graphics. How will you get the images you need to build your
project? You could:
1. Use the sprites and backdrops that already exist in Scratch
2. Use the tools in Scratch to draw your own sprites and backdrops
3. Download images from websites and then upload them to Scratch
Here are some ingredients that you might find useful:
Create a new backdrop in the Paint editor
Go to the Choose a Backdrop menu and click on Paint:
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:
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:
Your new backdrop will be shown on the Stage and will be available to use in Looks blocks.
Copy parts between sprite costumes
Click on the Costumes tab for your sprite.
Tip: Duplicate the costume that you want to edit — so that you can still use the original costume if
you need to. To do this, right-click (or on a tablet, tap and hold) on the costume and choose
duplicate. You will now have a copy of the costume:
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:
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:
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:
switch costume to nano-a2 the edited costume
Create backdrops and sprites using shapes
You can create backdrops and costumes for sprites in the Paint editor, using just shapes.
Go to the Choose a Sprite or Choose a Backdrop menu and choose the Paint option:
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.
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:
Here is an example of a sprite created with the Circle and Rectangle tools:
Pig: See inside (https://scratch.mit.edu/projects/495903163/editor)
Remember to name the costumes and backdrops that you create in the Paint editor.
Save your project
Step 3 Build and test
Now it’s time to make your simulation. Start with thinking about the background to your simulation. Will it scroll, or
will it be static?
Tip: Remember to test your project each time you add something. It is much easier to find and fix bugs before you
make more changes.
Choose a backdrop to use for your simulation. The backdrop could remain still, or you could make it
scroll.
Scroll a backdrop
Rather than scrolling the backdrop, in fact, you’re going to scroll a sprite, which you have created by
copying a backdrop.
Create a new sprite by copying the images from a backdrop, and adding them into your sprite.
Create a new variable called scroll_x.
The following blocks will create a scrolling effect on the sprite when the mouse is moved left and
right.
when clicked
go to x: 0 y: 0
create clone of myself
set scroll_x to 0
forever
if mouse x > 200 then
change scroll_x by 5
if mouse x < -200 then
change scroll_x by -5
go to x: scroll_x mod 480 y: 0
when I start as a clone
forever
go to x: scroll_x mod -480 y: 0
Tip: Instead of using the mouse position, you could use clicking on a button or pressing a key to
change the scroll_x variable.
Think about the sprites you will use for your simulation. Will some of them remain still in the scene, will
they change costumes, effects, or motion when they are interacted with? Will they scroll across the
screen? How will they be controlled if they move?
Move a sprite with key presses
when clicked
forever
if key left arrow pressed? then
change x by -10
if key right arrow pressed? then
change x by 10
Move a sprite with on-screen controls
Create sprites for your directions and position them on the screen.
The buttons should have controls to broadcast their direction, when they’re clicked on.
when this sprite clicked
broadcast left
The sprite being controlled should move in the direction indicated.
when I receive left
change x by -10
Change a sprite when it's clicked
You can change the appearance and orientation of a sprite whenever it is clicked. Here are some code
examples.
when this sprite clicked
switch costume to costume 2
when this sprite clicked
change color effect by 25
when this sprite clicked
turn 30 degrees
Animate a sprite with costumes
There are several ways to animate a sprite using its costumes. Here are a few examples.
when clicked
forever
next costume
wait 0.2 seconds
when I receive right
switch costume to right
repeat 3
next costume
wait 0.2 seconds
when this sprite clicked
repeat 3
next costume
Change the layer of a sprite
Sprites that you are using as backdrops need to be on the back layer. Sprites that you want in the
foreground need to be on the top layer. You can set the layer of a sprite or its clone.
when clicked
go to back layer
when I start as a clone
go to front layer
Will any of your sprites need to clone themselves? Will they produce many copies that perform different
actions when they start?
Create clones of a sprite
Here are a few ways to make clones and delete them after different events.
when clicked
repeat 20
create clone of myself
when clicked
forever
if touching mouse-pointer ? then
create clone of myself
when I start as a clone
forever
if touching edge ? then
delete this clone
Randomise your clones
When a clone is created, it may need instructions on how to move, but you might want the different
clones to behave slightly differently. You can use random blocks to do this.
when I start as a clone
point in direction pick random 0 to 359
forever
move 10 steps
wait 0.1 seconds
if on edge, bounce
when I start as a clone
forever
glide pick random 1 to 10 secs to mouse-pointer
Events to create a clone
Clones can be created with many different events. The blocks below will create a clone of a sprite
every time it is clicked upon.
when this sprite clicked
create clone of myself
You can create clones whenever the mouse is clicked as well, and make the clone appear at the
mouse-pointer’s location. Clones can appear in any location you like, so you might like them to go to a
specific sprite or position.
when clicked
forever
if mouse down? then
create clone of myself
when I start as a clone
go to x: mouse x y: mouse y
Will there be a musical or sound effect aspect to your simulation? Maybe there’s background noise, or a
sprite plays a tune when it is clicked?
The Scratch music extension
Once you have added the extension, new blocks will be available to you.
There are three main elements that can be changed within these blocks.
beats are a unit of time used in music. A beat could be a second long or a quarter of a second
long. It is up to you.
tempo sets how many beats there are in a minute: 60 beats a minute would mean that a beat is
1 second long.
note is the pitch of the note being played: 60 is the same as middle C on a piano.
Adding a sound from the library
Select the sprite you want to add the sound to.
Click the Sounds tab, and click Choose sound from library:
Sounds are organised by category, and you can click the Play button to hear a sound. Choose a
suitable sound and click OK.
You should then see that your sprite has your chosen sound.
Record a sound
Select the sprite that you want to have the new recorded sound, then select the Sounds tab:
Go to the Choose a Sound menu and select the Record option:
When you are ready, click the Record button to start recording your sound:
Click the Stop recording button to stop 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:
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:
Change sound effects
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:
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:
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’.
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.
Do you want your sprites to keep repeating an action, until some condition has been met? You can use
repeat until blocks to do this.
Using repeat until blocks
Here is a set of blocks that will keep a sprite moving, until its y position reaches -250.
when clicked
repeat until y position < -250
change y by -10
Think about the organisation of your blocks, and the inputs that might be needed. Can you use My
Blocks to optimise your project?
Use My Blocks to organise code
The simplest way to use My Blocks is to help organise your code. Here is a simple example.
define move right
if not touching edge ? then
switch costume to right_1
change x by 2
switch costume to right_2
change x by 2
switch costume to right_3
change x by 2
define move left
if not touching edge ? then
switch costume to left_1
change x by -2
switch costume to left_2
change x by -2
switch costume to left_3
change x by -2
when clicked
Using inputs with My Blocks
Blocks take text and number inputs as well.
Myforever
if key right arrow pressed? then
define move direction speed
move right
if direction = left then
if key left arrow pressed? then
change x by -1 * speed
move left
if direction = right then
change x by 1 * speed
when clicked
if mouse x < -200 then
move left speed
if mouse x > 200 then
move right speed
The key to most 2.5D scenes is changing the size of a sprite to give the impression that it is further
away.
Changing sprite sizes relative to position
The following blocks will make a sprite smaller as it moves up the screen, and therefore appear further
away.
when clicked
forever
change y by 10
change size by -3
wait 0.2 seconds
Test: Show someone else your project and get their feedback. Do you want make any changes to your
scene?
Debug: You might find some bugs in your project that you need to fix. Here are some common bugs.
My clones don't appear
Are your clones hidden? Make sure that when the clones are created, the show option is used. Also
make sure that you have them on the front layer.
My sprite doesn't move off the screen correctly
If you want a sprite to cycle from one side of the screen to another, or vanish when it gets to one side
of the screen, then you can check its position and perform some action. You might need to check
where the centre of your sprite is, on its costume, to make sure this works properly. It’s easisest to
drag the sprite to the side of the screen, and then check its x and y positions.
My Blocks are not working
Have you checked that you are using your new block somewhere in your code. You can define a new
block, but then you need to use it for the code beneath it to actually run.
My clones aren't doing anything
Are you using the when I start as clone block, to tell the clone what to do?
Do you have any conditions that might stop the clones from working? For instance, are they
supposed to move until they touch the edge of the screen? If a clone is created at the edge of the
screen, then they won’t do anything.
My sprites are moving in the wrong direction
Check that you are using the change x by block to move the sprites left and right, and the change
y by block to move them up and down.
Check whether you are using positive and negative numbers correctly, to increase or decrease x and
y.
You might find a bug not listed here. Can you figure out how to fix it?
We love hearing about your bugs and how you fixed them. Use the feedback button at the bottom of this
page if you found a different bug in your project.
Save your project
Step 4 Checklist
Did you meet the project brief? Think about your project and go through the checklist below and check off the
ones that apply to your project.
Does your simulation:
Use different sized sprites to represent the distance of the object from the viewer.
Use clones to generate copies of sprites.
Use My Blocks to keep your code organised and/or allow the use of inputs.
Your simulation could also:
Have an educational theme, to try and teach the user a skill.
Use sounds or music to make the simulation appear more realistic.
Reflecting about how you made your simulation will help you in your future projects:
How did you get your ideas?
What cool new thing(s) did you learn?
A famous inventor called Thomas Edison was very used to making mistakes. He said:
I have not failed. I’ve just found 10,000 ways that won’t work.
and
Many of life’s failures are people who did not realize how close they were to success when they gave up.
Mistakes and failure are temporary. Keep going until you succeed.
What mistakes did you make and how did they help you create your simulation or make it better?
Now you are the author of a Welcome to my world!
Take a moment to celebrate what you have made.
Where will you take your new powers? What will you make next?
Step 5 Upgrade your project
If you have time, you can upgrade your project. You might already have ideas about how to add more or you might
want to go back to the first step and look at other projects again for more inspiration.
You could:
Add more sprites to your project
Add extra sound effects or music
Change backdrops so that the simulation can switch to different scenes
Each example project in the Introduction (.) has a See inside link for you to open the project in Scratch and look
at the code to get ideas and see how they work.
Animal eyes: See inside (https://scratch.mit.edu/projects/553701588/editor)
Take a look at some projects created by community members in the Raspberry Pi Foundation’s studio of Welcome
to my world Community Projects See inside (https://scratch.mit.edu/studios/30320352).
Save your project
Step 6 Share
Now is the time to share your creation with your audience.
If you have a Scratch account, you can share your project through Scratch. Check with an adult first. You can send
a link to people you know, and the whole Scratch community will be able to find your project and try it out.
Share your Scratch project
Please make sure that you do not share any personal information about yourself when sharing your Scratch
projects.
Give your Scratch project a name.
Click the Share button to make the project public.
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.
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.
Why not invite your friends to create a project? Let them know how much fun you had.
If you have a Scratch account, and have shared your project, keep an eye out for comments that others may make
about your creation. Feedback is a great way to reflect on your work. Report and ignore any comments that are
unhelpful or irrelevant.
Comments and feedback in 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, go to the Project
Page and set the slider above the Comments box to Commenting off:
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:
Read the Scratch Community Guidelines (https://scratch.mit.edu/community_guidelines) so that you
know how you and others can maintain a friendly and creative community.
Inspire others with your project by submitting it to our Scratch studio!
To share your 2.5D scene with others who are doing the ‘Welcome to my world’ project, please complete
this form (https://form.raspberrypi.org/f/community-project-submissions).
Step 7 What next?
You have reached the end of the Further Scratch (https://projects.raspberrypi.org/en/pathways/further-scr
atch) path!
Now you can bring all your ideas to life in Scratch. Try using Scratch to make more cool stuff. If you need a
reminder of what you have learnt, you can go to the Scratch guide (https://projects.raspberrypi.org/en/projec
ts/getting-started-scratch).
Take part in Coolest Projects
Check out Coolest Projects (https://coolestprojects.org/), the world’s leading technology showcase for
young people! On the Coolest Projects website (https://coolestprojects.org/), you can find out when project
registration is open, and get ready to register your project!
If you have made a Scratch project, you can register your project in the Scratch category when Coolest Projects
project registration is open. Your project doesn’t have to be finished — prototypes and works in progress are
welcome too! When you have entered your project, your creation will be showcased in the Coolest Projects
online gallery, for people all over the world to see! Join other young people in celebrating and recognising each
other’s achievements as a community.
You can use the Coolest Projects How to make a project (https://coolestprojects.org/2020/03/31/how-to-
make-a-project-workbook-and-additional-resources/) resources to help you think of original project ideas.
Or, you can explore our other Scratch projects (https://projects.raspberrypi.org/en/projects?software%5B%
5D=scratch&curriculum%5B%5D=%201) and try them out.
Published by Raspberry Pi Foundation (https://www.raspberrypi.org) under a Creative Commons
license (https://creativecommons.org/licenses/by-sa/4.0/).
View project & license on GitHub (https://github.com/RaspberryPiLearning/welcome-to-my-world)