One-sentence summary
We learn how to change the way a Scratch sprite looks and sounds, and how to start those actions with events such as the green flag, a key press or a click.
Why it matters
In the previous lesson we learned to move a sprite around the stage. But a project is more than movement. A good animation or game comes alive in the moments when a character changes its look, speaks and makes sound.
There is also another question: when should the program start? When a key is pressed, when the sprite is clicked, or the moment the project opens? The answer to this "when" question comes from events.
In this lesson we will use three block categories together: Looks, Sound and Events. Combined, they let us build a sprite that changes its costume and plays a sound when you click it.
Looks blocks: how a sprite appears
The Looks category contains the blocks that change how a sprite appears on the stage. It can change costumes, speak, grow, shrink or change colour.
Changing costumes
Every sprite has one or more costumes. A costume is the sprite's current appearance. Switching costumes in order makes the character look like it is moving; this is called animation.
Example: A walking cat.
when green flag clicked
forever
next costume
wait 0.3 seconds
Here the next costume block shows the following costume each time. Without wait 0.3 seconds, the costumes would change so fast the eye could not follow them.
To pick a specific costume, we use the switch costume to ... block:
when green flag clicked
switch costume to cat-a
Speaking and thinking
A sprite can say something. The say ... block shows a speech bubble next to its head.
when green flag clicked
say Hello!
If you want to decide how long the bubble stays on screen, use the say ... for ... seconds block:
when green flag clicked
say Hello! for 2 seconds
The think ... for ... seconds block shows a thought bubble instead of speech. The only difference is the shape of the bubble.
Size and effects
The set size to ... block makes the sprite larger or smaller. 100 is the normal size; 50 is half, and 200 is double.
when green flag clicked
set size to 150
The change ... effect by ... block adds visual effects such as colour, fisheye or ghost. For example, the ghost effect makes a sprite semi-transparent:
when green flag clicked
change ghost effect by 50
Sound blocks: how a sprite makes sound
The Sound category lets you add sound to your project. Every sprite has its own sound list; you can pick a sound from Scratch's ready-made library or record your own.
Playing a sound
There are two main blocks. play sound ... until done waits until the sound finishes, then moves on to the next block:
when green flag clicked
play sound Meow until done
say Done!
Here the sprite first finishes meowing, then says "Done!".
The start sound ... block starts the sound but does not wait; the program moves straight to the next block. This way the sprite can move at the same time as the sound plays:
when green flag clicked
start sound Meow
move 10 steps
Stopping a sound
To silence everything at once, we use the stop all sounds block. For example, if you want to cut the music when a key is pressed, this is useful.
when space key pressed
stop all sounds
Events: when does the program start?
The Events category decides when a sequence of code runs. These blocks sit on top of the others and trigger the code below them. Without a trigger, a stack of blocks will not run on its own.
The green flag
The when green flag clicked block runs when you press the green flag above the stage. It is the most common way to start a project.
when green flag clicked
go to x: 0 y: 0
say Started
Pressing a key
The when ... key pressed block runs when you press the keyboard key you choose. It is often used in games to steer a character.
when right arrow key pressed
move 10 steps
when up arrow key pressed
point in direction 0
move 10 steps
Clicking the sprite
The when this sprite clicked block runs when the user clicks the sprite with the mouse. It is ideal for button-like interactions.
when this sprite clicked
say You clicked me! for 2 seconds
Hands-on practice
Now let's combine all three categories in a single project: a sprite that changes its costume and sound when clicked.
Goal: Each time the sprite is clicked, it switches to a different costume, plays a sound at the same time and says something short.
Steps:
- Open Scratch and choose a sprite with at least two costumes (for example, the cat).
- Add a sound from the Sounds tab (for example, "Meow").
- Build the block sequence below.
when this sprite clicked
next costume
start sound Meow
say Costume changed! for 1 seconds
Try it:
- Click the sprite directly, not the green flag.
- Click a few times and watch the costume change each time.
Extra task: Make the green flag reset the sprite to its normal size and first costume. That way you get a clean start every time you launch the project.
when green flag clicked
set size to 100
switch costume to cat-a
Common mistakes
Forgetting to add an event block
This is the most common mistake. Even if the blocks are correct, if there is no event block on top (such as when green flag clicked or when this sprite clicked), the code will never run. There is no trigger to start it.
Confusing the "say for" and "say" blocks
The say ... block leaves the bubble on screen until you change it yourself. The say ... for ... seconds block removes the bubble by itself after the set time. If you want the bubble to disappear, choose the timed one.
Not wanting to wait for a sound to finish
The play sound ... until done block will not move to the next block until the sound ends. If you want the sprite to move at the same time as the sound plays, you should use the start sound ... block.
Writing code on the wrong sprite
In Scratch, every sprite has its own code area. Code you write on one sprite does not affect another. If your code is not working, check whether you have the correct sprite selected.
Safety note
This lesson happens entirely on screen, inside Scratch, so there is no physical risk. Still, keep two things in mind:
- To avoid long stretches at the screen, take a short break every 30–40 minutes and rest your eyes.
- Scratch is an online platform. When you share a project or write a comment, do not share personal details such as your address, phone number or school name. If you are unsure, ask an adult.
Review questions
- How does an event start a script in Scratch?
- Why should costume changes support the meaning of an interaction?
- What can happen when several sounds are started without timing control?
- How can broadcast messages reduce tangled dependencies between sprites?
- What accessibility alternative can support information communicated by sound?
- How would you test that an event-driven animation resets correctly?
Answers
- An event block listens for something such as the green flag, a key press, a click or a broadcast, then starts the attached stack.
- Visual changes are clearer when they communicate state, feedback or story rather than adding unrelated decoration.
- Sounds can overlap, become unpleasant or hide important feedback; wait, stop or volume rules may be needed.
- Sprites can react to named events without directly controlling one another’s scripts.
- Use visible text, an icon, colour plus text, animation or another non-audio cue.
- Trigger it repeatedly, interrupt it at different moments and confirm that position, costume, sound and variables return to known values.
Lesson summary
- Looks blocks change the costume, speech bubbles, size and effects.
- Sound blocks play sound (
start sound ...does not wait,play sound ... until donedoes) and silence it withstop all sounds. - Events blocks decide when code runs; without an event block, code does not start.
- Three key events: the green flag, a key press and clicking the sprite.
- Combining these three categories lets us build an interactive sprite that changes its look and sound when clicked.
Check-your-understanding questions
- What do we call switching costumes in order to make a character look like it is moving?
- What is the difference between the
say ... for ... secondsandsay ...blocks? - If you want to wait for a sound to finish before moving to the block below, which sound block do you use?
- What happens if a stack of blocks has no event block on top?
- Which event block do you use if you want code to run when the user clicks the sprite with the mouse?
Answers
- Animation. When costumes switch in order fast enough, the character looks like it is moving.
- The
say ... for ... secondsblock removes the bubble by itself after the set time; thesay ...block leaves the bubble on screen until you change it with another block. - I use the
play sound ... until doneblock; it waits until the sound ends. - The code does not run, because there is no trigger to start it.
- I use the
when this sprite clickedblock.
Source and verification note
For “Looks, Sound and Events”, verification focuses on whether the relationship between Looks blocks: how a sprite appears and Speaking and thinking remains consistent across examples. Block names are kept consistent with the current core Scratch categories. Project behaviour should be tested separately for start-up, normal play, errors and restarting.
End-of-lesson check
- How would you define Looks, Sound and Events in your own words?
- What is one normal use of the structure learned in this lesson?
- Which boundary or unexpected case would you test?
- How could you detect and correct one likely mistake?
- How would you adapt the same idea to another robotics or coding project?
End-of-lesson check — sample answers
- A good definition explains both the main idea and its purpose.
- The example should identify the input, the process and the resulting output.
- A boundary test can use the lowest or highest accepted value; an unexpected test can use missing or invalid input.
- Compare expected and actual results, change one thing at a time and repeat the test.
- Find the rule that remains the same, then adapt the steps to the new project’s input, tool and output.
Next lesson
Conditions and Sensing: We will learn to write programs that check whether the sprite is touching an edge, a colour or the mouse pointer, and make decisions based on that.