Home · Academy · Robotics & Coding · Programming with Scratch · Looks, Sound and Events

Looks, Sound and Events

Bring sprites to life with costumes, speech, sound and event blocks.

LESSON COMPASS

What will you use this page for?

Core idea

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.

Evidence to produce

Complete the page task with your own input, test conditions and reasoning.

Control trap

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…

Next connection

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.

Module sources: Python Tutorial · Arduino Learn

LevelBeginner
Age10–16
Duration30–45 min
PrerequisiteMotion and the Coordinate System
ContentStandard lesson · 1,619 words
Last updated

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:

  1. Open Scratch and choose a sprite with at least two costumes (for example, the cat).
  2. Add a sound from the Sounds tab (for example, "Meow").
  3. Build the block sequence below.
when this sprite clicked
next costume
start sound Meow
say Costume changed! for 1 seconds

Try it:

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:

Review questions

  1. How does an event start a script in Scratch?
  2. Why should costume changes support the meaning of an interaction?
  3. What can happen when several sounds are started without timing control?
  4. How can broadcast messages reduce tangled dependencies between sprites?
  5. What accessibility alternative can support information communicated by sound?
  6. How would you test that an event-driven animation resets correctly?

Answers

  1. An event block listens for something such as the green flag, a key press, a click or a broadcast, then starts the attached stack.
  2. Visual changes are clearer when they communicate state, feedback or story rather than adding unrelated decoration.
  3. Sounds can overlap, become unpleasant or hide important feedback; wait, stop or volume rules may be needed.
  4. Sprites can react to named events without directly controlling one another’s scripts.
  5. Use visible text, an icon, colour plus text, animation or another non-audio cue.
  6. Trigger it repeatedly, interrupt it at different moments and confirm that position, costume, sound and variables return to known values.

Lesson summary

Check-your-understanding questions

  1. What do we call switching costumes in order to make a character look like it is moving?
  2. What is the difference between the say ... for ... seconds and say ... blocks?
  3. If you want to wait for a sound to finish before moving to the block below, which sound block do you use?
  4. What happens if a stack of blocks has no event block on top?
  5. Which event block do you use if you want code to run when the user clicks the sprite with the mouse?

Answers

  1. Animation. When costumes switch in order fast enough, the character looks like it is moving.
  2. The say ... for ... seconds block removes the bubble by itself after the set time; the say ... block leaves the bubble on screen until you change it with another block.
  3. I use the play sound ... until done block; it waits until the sound ends.
  4. The code does not run, because there is no trigger to start it.
  5. I use the when this sprite clicked block.

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

  1. How would you define Looks, Sound and Events in your own words?
  2. What is one normal use of the structure learned in this lesson?
  3. Which boundary or unexpected case would you test?
  4. How could you detect and correct one likely mistake?
  5. How would you adapt the same idea to another robotics or coding project?

End-of-lesson check — sample answers

  1. A good definition explains both the main idea and its purpose.
  2. The example should identify the input, the process and the resulting output.
  3. A boundary test can use the lowest or highest accepted value; an unexpected test can use missing or invalid input.
  4. Compare expected and actual results, change one thing at a time and repeat the test.
  5. 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.

Start QuizBack to Programming with Scratch
QUESTION POOL

Reinforce this lesson with 10 questions

This lesson has a pool of 20 questions. Each attempt selects 10 and reshuffles the choices.