Projects
Space talk
Use Scratch to give sprites an 'emote' so that they
communicate when clicked
Step 1 You will make
Create a space scene with characters 👾 that ‘emote’ to share their thoughts or feelings.
In Scratch, characters and objects are called sprites, and they appear on the Stage.
You will:
Add sprites and a backdrop to set up your project
Click on sprites to make them communicate using Looks and Sound code blocks
Use the Paint editor to change a costume
Step 2 Create your scene
Set up your project with a space backdrop and the first sprite.
Open the starter project
Open the Space talk starter project (https://scratch.mit.edu/projects/582213331/editor). Scratch will
open in another browser tab.
Working offline
For information about how to set up Scratch for offline use, visit our ‘Getting started with Scratch’
guide (https://projects.raspberrypi.org/en/projects/getting-started-scratch/1).
The Scratch editor
Add a backdrop
The Stage is where your project runs. A backdrop changes the way that the Stage looks.
Click (or on a tablet, tap) on Choose a Backdrop in the Stage pane:
Click on the Space category or type space in the search box:
In our example, we have chosen the Space backdrop, but choose the backdrop that you like the most.
Click on your chosen backdrop to add it to your project. The Stage should show the backdrop that you
chose:
Add a Sprite
Can you see the sprite that is already included in your project? That is the Scratch Cat.
Delete the Sprite1 (Scratch Cat) sprite: select the Sprite1 sprite in the Sprite list below the Stage and click
on the Delete icon.
Click on Choose a Sprite in the Sprite list:
Select the Fantasy category. Click on the Pico sprite to add them to your project.
Drag the Pico sprite to position them on the left-hand side of the Stage. Your Stage should look something
like this:
Save: If you are signed in to your Scratch account, click on the green Remix button. This will save a copy of
the project to your Scratch account.
Type the name of your project in the project name box at the top of the screen.
Tip: Give your projects helpful names so that you can easily find them when you have lots of projects.
Next, click on File, and then on Save now to save your project.
If you are not online or you do not have a Scratch account, you can click on Save to your computer to save
a copy of your project.
Step 3 Pico says hello
A sprite can have code, costumes, and sounds to change the
way that it looks and what it does.
Add code blocks to make Pico emote with words and sound
when the sprite is clicked.
Emotes are a way of showing the personality of a character in a game. They can use speech, sounds, movement,
and graphic effects, just like in Scratch. Do you play any games that use emotes?
Use the say block
Open the Looks blocks menu.
Click on a say Hello! for 2 seconds block.
The Pico sprite will show a speech bubble for two seconds.
Tip: Code blocks in Scratch glow with a yellow outline when they are running.
Drag the say Hello! for 2 seconds block to the Code area. Click on it again.
Make Pico talk when clicked (or tapped)
Drag a when this sprite clicked block from the Events blocks menu and connect it to the top of
your say block in the Code area. The blocks will snap together.
when this sprite clicked
say Hello! for 2 seconds hide speech after 2 seconds
Code comments
say Hello! for 2 seconds hide speech after 2 seconds
You will see comments in code examples. You don’t need to add the comments when you add code to your project.
If you have time when you have finished your project, it is a good idea to add comments to your code so that it is easier
to understand later. To add a comment, right-click (or on a tablet, tap and hold) on a block in the Code area and choose
Add Comment.
Test
Test: Click on the Pico sprite on the Stage and check that the speech bubble appears for two seconds. It is
important to test your code to make sure that it does what you expect.
You have already saved your project and given it a name. Scratch will now automatically save for you.
You can still click save if you like, just to make sure.
Step 4 Pico plays a sound
Another way to communicate is to use sound.
Add a sound to the Pico Sprite
Click on the Sounds tab for the Pico sprite and you will find a pop sound. Click on the Play icon to hear the
pop sound.
Debug: If you cannot hear a sound then check that sound is working on your computer or tablet.
To choose a new sound, click on the Choose a Sound icon and select the Space category or type space in
the search box.
Play a few different sounds using the Play icons. Once you have found the sound that you want to use, click
on it to add it to your project.
Make the sound play when clicked (or tapped)
Click on the Code tab. In the Sound blocks menu, find the start sound block.
Drag the block into the Code area, between the when this sprite clicked block and the say block. A
gap will open up and the block will snap into place.
Your code should look like this:
when this sprite clicked
start sound Alien Creak1
say Hello! for 2 seconds hide speech after 2 seconds
Test your code
Check that your start sound block has your chosen sound in it. If it does not, you need to click on the
sound in the start sound block, then select your chosen sound in the drop-down menu.
Test: Click on the Pico sprite and check that the speech bubble appears and you can hear the sound. If you
do not hear the sound, make sure that you have added the start sound block under the when this
sprite clicked block.
Step 5 Nano switches costume
Get Nano to emote by switching costumes.
Sprites have costumes to change the way that they look. To
animate a sprite, you can change its costume.
Nano signs “Thanks!”
Add the Nano sprite to your project from the Fantasy category.
Make sure that the Nano sprite is selected in the Sprite list below the Stage.
Click on the Code tab and add a script to get the Nano sprite to sign ‘Thanks’ using switch costume to
and wait:
when this sprite clicked when Nano is clicked
switch costume to nano-b Nano talking
wait 0.5 seconds try 0.25 instead of 0.5
switch costume to nano-a Nano smiling
Tip: All the blocks are colour-coded, so you will find the switch costume to block in the Looks blocks menu and
the wait block in the Looks blocks menu.
Test: Click on the Nano sprite on the Stage and check that Nano’s costume changes.
Nano uses sign language
Millions of people use sign language to communicate. A common way to sign ‘Thank you’ is to place your fingers
on your chin with your hand as flat as possible. You then move your hand forwards, away from your chin and
slightly down.
Nano will use sign language by switching costumes.
You can edit costumes for your sprites with the Paint editor. You will edit a costume of Nano to get them to sign “thank
you”.
Click on the Costumes tab to see the costumes for the Nano sprite:
Click on the nano-b costume. Click on the arm on the left-hand side, and then click on Delete.
The costume should look like this:
Tip: If you make a mistake in the Paint editor, you can click on Undo.
Go to the nano-c costume and click on the arm on the left-hand side, then click on Copy.
Go back to the nano-b costume and click on Paste. The costume should look like this:
Test: Click on the Nano sprite on the Stage and check that the speech bubble appears and Nano’s costume
changes to the costume that you have edited.
You have learned how to sign “thank you”. Next time you thank someone, why not use your new skill?
Step 6 Giga changes colour
Sprites can also use thought bubbles and change colours to
show their personality. You will get Giga to do this.
Make Giga change colour
Add the Giga sprite.
Drag the Giga sprite to the right-hand side of the Stage.
Make sure that you have the Giga sprite selected in the Sprite list below the Stage. Add this code to make
the Giga sprite communicate by changing colour:
when this sprite clicked
set color effect to 0 0 is the starting colour
think Hmm... for 2 seconds
clear graphic effects back to the starting colour
Tip: Click on the sprite in the Sprite list below the Stage before you add or change code, costumes, or sound. Make
sure that you have clicked on the correct sprite.
Try different numbers from 1 to 200 in the set color effect to block until you find a colour that you
like.
Change the words and number of seconds in the think block.
Test: Click on the Giga sprite on the Stage and check that the sprite changes colour and shows a thought
bubble.
Upgrade your project
Add the Tera sprite and use any of the blocks that you have
learned about to make an ‘emote’ for the Tera sprite.
You could also use the Text to Speech extension to make Tera speak out loud:
Make a sprite talk with the Text to Speech extension
Pico and Giga talk with the speech extension: See inside (https://scratch.mit.edu/projects/499373708/edito
r)
Click on Add Extension:
Choose Text to Speech:
You will get a new Text to Speech blocks menu:
You can use the blocks in the Text to Speech blocks menu to make your sprites talk out loud.
You can make a sprite talk out loud when clicked:
when this sprite clicked
set voice to alto
set language to Spanish
speak Hola
You can even give your sprite a kitten voice!
set voice to kitten
speak Cat gotta haz milk.
The Tera sprite’s personality is your choice, so have fun using your own creative ideas.
when this sprite clicked
say Hello! for 2 seconds
say Hello!
say hide speech bubble
think Hmm... for 2 seconds
switch costume to tera-d
wait 1 seconds 0.5 is half a second
set color effect to 0 number up to 200
clear graphic effects
play sound pop until done
start sound pop
speak hello
You can also ‘remix’ the project to make any changes you like. You could change the backdrop, and how the sprites
emote, and even choose different sprites and give them emotes.
Tip: Click on a sprite in the Sprite list below the Stage to change the code, costumes, and sound for that sprite.
Space talk certificate
Well done! You have completed the Space talk project. Here is a certificate (https://drive.google.com/file/d/18xx
4uNIyRSty_2ujHkGDzGwTgfSGC1AF/view?usp=sharing) to celebrate your new skills. Download a copy then
open it to add your name.
Completed project
You can view the completed project here (https://scratch.mit.edu/projects/485673032/).
Save your project
What next?
If you are following the Introduction to Scratch (https://projects.raspberrypi.org/en/pathways/scratch-intro)
pathway, you can move on to the Catch the bus (https://projects.raspberrypi.org/en/projects/catch-the-bus)
project. In this project, you will code an animation with sprites that need to make it to a bus before it leaves.
If you want to have more fun exploring Scratch, then you could try out any of these projects (https://projects.raspb
errypi.org/en/projects?software%5B%5D=scratch&curriculum%5B%5D=%201).
Published by Raspberry Pi Foundation (https://www.raspberrypi.org) under a Creative Commons license (ht
tps://creativecommons.org/licenses/by-sa/4.0/).
View project & license on GitHub (https://github.com/RaspberryPiLearning/space-talk)