Events, Costumes and Sound
Event blocks make a program respond to the keyboard and mouse. By switching costumes we bring a sprite to life, and we add sound.
All topics (8 of 11)
Chapter 1. Algorithm Basics
Chapter 2. Programming in Scratch
Chapter 3. Project Work
An event is an action that starts a program: clicking the flag, pressing a key or clicking a sprite. Every script begins with one of the blocks from the Events category, for example “when green flag clicked”, “when ... key pressed” or “when this sprite clicked”.
Every sprite has one or more costumes. Costumes are versions of how the sprite looks, for example different positions of a cat’s legs. The “next costume” block switches them one after another and so brings the sprite to life. This block is in the Looks category.
A script to make the cat walk: attach “change x by 10” and “next costume” to a “when right arrow key pressed” block. Now each press of the right arrow makes the cat take a step and change its legs. For the left arrow, write a separate script that changes x by −10.
Sound makes a project more fun. The “play sound ...” block from the Sound category plays a sound from the library or one you recorded. For example, if you add “play sound Meow” to a “when this sprite clicked” script, the cat meows when you click it. Too much sound can be distracting.
Key takeaways
- An event is an action that starts a script.
- Every script begins with an event block.
- Switching costumes brings a sprite to life.
- Sound blocks add audio to a project.
Practice tasks
- Build two scripts that move the cat with the right and left arrow keys.
- Write a script in which clicking a sprite plays a sound and changes its costume.
- Come up with a “when space key pressed” script that makes the sprite jump up (change y, then change it back).
Review questions
Test yourself: think first, then reveal the answer.
1What is an event? Give examples.Show answerHide answer
An action that starts a script: clicking the green flag, pressing a key or clicking a sprite.2What are costumes for?Show answerHide answer
To change a sprite’s appearance and bring it to life.
0 of 11 topics completed
Sign in to mark