- Learnt27 min · costumes, size and colour, all on the beat
- Basic25 min · put the dancers on your track
- Challenge 1–327 min · one dancer, two dancers, the whole stage
- Extrabonus · the drop
Review — where we got to 5 min
Last lesson you built a track out of loops.
- A backing track is
play sound [Dance Snare Beat v] until doneinside a forever. - A beat is
play sound [Drum Bass1 v]and await (0.5) seconds. - Layers stay together when one wait is double the other.
Quick-fire
Your drum waits 0.5 seconds. A dancer changes costume every 0.7 seconds. What does the video look like after a minute?
Reveal the answer
It looks like someone dancing to a different song. The dancer and the drum slip apart. By the end they do not match at all. To dance on the beat, use the same number as the beat.
Today’s Topic 3 min
- Dance sprites: their costumes are the dance
next costumeandwait (0.5) seconds, the same wait as the beatchange size by (10)as a pulse, and why it must shrink backchange [color v] effect by (25)andclear graphic effects
Learning outcome
By the end of this lesson you will be able to:
- Make a sprite dance in time with a beat you made.
- Make something pulse on the beat and go back to its first size.
- Change the stage lights on the beat. Reset them on every green flag.
Learnt — costume, size, colour 27 min
Nobody in a music video walks about. They stay in one spot and change. Every block today makes a change. Every change happens on the beat.
1 · The costumes are the dance
Add Anina Dance and open its Costumes tab. There are thirteen costumes. They are drawings of one person dancing. You do not have to draw anything.
when flag clicked
forever
next costume
wait (0.5) seconds
end
0.5 too. So they land together.How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
2 · A pulse has to come back
A pulse is a sprite that grows on the beat. It looks like it is playing the music. But there is a trap.
forever
change size by (10)
wait (0.5) seconds
end
forever
change size by (20)
wait (0.25) seconds
change size by (-20)
wait (0.25) seconds
end
The two waits add up to 0.5. So the pulse takes one beat. What grows must shrink back. The waits must add up to the beat.
How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
- Put
set size to (100) %at the top of the stack, above the forever. - Run it. Press the stop sign while it is big.
- Run it again. The size starts from 100, not from where it stopped.
3 · The lights
Looks has a set of graphic effects. They change how a sprite looks. The one that looks like stage lights is color.
| Block | Category | What it does |
|---|---|---|
change [color v] effect by (25) | Looks | Moves the sprite’s colours round the rainbow. At 200 it goes back to the start. |
set [ghost v] effect to (50) | Looks | Makes it half see-through. 0 is solid, 100 is invisible. |
clear graphic effects | Looks | Puts every effect back to normal. Put it at the top of a stack. |
when flag clicked
clear graphic effects
forever
change [color v] effect by (25)
wait (0.5) seconds
end
clear graphic effects. Without it, your dancer keeps the colour from the last run.How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
Basic — put the dancers on the track 25 min
Open your track from last lesson. Add people to it, one at a time.
How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
Step 1 — the first dancer
- Add Anina Dance. Put her on the left of the stage.
- Set her size to about 90%, so she fits next to the band.
- Give her the four-block dance stack. Use the same wait as your drum.
- Play it. She should change on every hit.
Step 2 — the second dancer
- Add D-Money Dance on the right.
- Give him the same stack.
- Add
wait (0.25) secondsabove his forever. Now he is half a beat behind her. - Play it. The two dancers take turns. They do not move as one.
Step 3 — the pulse
- On the drum kit, add the grow-and-shrink size stack.
- Put
set size to (100) %above its forever. - Play. The kit should pulse with the beat. It should never keep growing.
Step 4 — the lights
- Give each dancer the colour-effect stack.
- Put
clear graphic effectsabove every forever. - Play twice in a row. Both runs should start with the same colour.
Step 5 — watch it as a video
- Press the full-screen button above the Stage.
- Watch it all for thirty seconds. Do not touch anything.
- Does something slip, grow or change colour for ever? It needs a reset at the top.
My dancer is enormous.
A change size by (10) has nothing to bring it back. Add the same number with a minus. Or use set size to (100) % instead.
My dancer changes costume much too fast.
There is no wait (0.5) seconds inside the forever. So the costume changes thirty times a second.
Everyone is a strange colour when I press the flag.
The colour effect from the last run is still there. Put clear graphic effects at the top of the stack.
One dancer, on your beat
Pick a dancer. Put it on the track you made last lesson.
- The dancer changes costume in time with your drum.
- It stays in one spot.
- Two runs in a row look the same.
Two dancers who are not twins
Add a second dancer. The two must look different. Both must stay on the beat.
- Both are in time with the same track.
- One moves on every beat. The other moves on every second beat.
- Or one starts half a beat later, so they take turns.
Teacher note — two ways to be different
A different wait (1 instead of 0.5) makes a slower dancer. A wait (0.25) seconds above the forever makes a dancer on the off-beat, which is much more interesting to watch and costs one block. Worth showing both.
The whole stage on one beat
Everything you can see moves to the same beat. That means the dancers, the drums and the lights.
- At least four things change on the beat.
- Sizes shrink back. Colours reset. Nothing runs away.
- Press the flag twice. You get the same show both times.
Teacher reveal — the resets that make it repeatable
when flag clicked
clear graphic effects
set size to (100) %
switch costume to [anina stance v]
forever
next costume
change [color v] effect by (25)
wait (0.5) seconds
end
Three resets above the loop, one for each thing the loop changes. That is the pattern worth naming out loud: whatever a loop changes, the set-up must put back.
The drop
Seven normal beats, then one big one. On the eighth beat, everything happens at once. The dancers go big. The lights jump. A cymbal crashes.
How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
- The drop lands on every eighth beat, not at random.
- At least two things change only on the drop.
- Everything is back to normal by the next beat.
- It keeps happening for as long as the video plays.
Teacher notes — a repeat inside a forever
when flag clicked
set size to (100) %
forever
repeat (7)
next costume
wait (0.5) seconds
end
play sound [Cymbal Crash v]
set size to (140) %
wait (0.5) seconds
set size to (100) %
end
A repeat (7) inside a forever is the shape. Seven ordinary beats, then the eighth is whatever comes after the repeat, and then the forever starts the seven again.
Going further: right now every sprite counts its own eight, and they can slip apart. One sprite shouting broadcast [drop v] would keep the whole stage together — which is exactly what next lesson is about.
Summary 4 min
Dancing in Scratch is not moving about. It is changing, on a timer.
next costumewith the beat’s own wait is a dance.- A pulse grows and shrinks back. Its two waits add up to one beat.
change [color v] effect by (25)is the stage lights.- If a loop changes something, the blocks above the loop put it back.
- Dance sprite
- A library sprite. Its costumes are drawings of one dance.
- On the beat
- Using the same wait as the music, so changes land on the hits.
- Pulse
- Grow and shrink back in one beat. It must shrink back, or it keeps growing.
- Graphic effect
- Colour, ghost and the rest. Reset them with clear graphic effects.
Next lesson: the video gets a verse and a chorus. One sprite tells everyone when to change.