- 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 their waits are doubles of each other.
Quick-fire
Your drum waits 0.5 seconds. If a dancer changes costume every 0.7 seconds, what does the video look like after a minute?
Reveal the answer
Like somebody dancing to a different song. The dancer and the drum drift apart, and by the end they have nothing to do with each other. Dancing on the beat means using the same number as the beat.
Today’s Topic 3 min
- Dance sprites, whose 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 come 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 wrote.
- Make something pulse on the beat and return to the size it started at.
- Move the stage lights on the beat, and reset them on every green flag.
Learnt — costume, size, colour 27 min
Nobody in a music video walks about. They stay where they are and change. Every one of today’s blocks is a change, and every one of them happens on the beat.
1 · The costumes are the dance
Add Anina Dance and open its Costumes tab. There are thirteen, and 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 is the same number the drum uses, which is why 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
Something that grows on the beat feels like it is playing the music. The trap is easy to fall into.
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 exactly one beat. Anything that goes up must come back, and the numbers 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, then press the stop sign mid-pulse.
- Run it again. The size starts from 100, not from whatever it was left at.
3 · The lights
Looks has a set of graphic effects. The one that looks like stage lighting is color.
| Block | Category | What it does |
|---|---|---|
change [color v] effect by (25) | Looks | Shifts the sprite’s colours round the rainbow. At 200 it wraps back. |
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. Belongs 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 your dancer stays whatever colour the last run left them.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 beside the band.
- Give her the four-block dancing stack, with 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, so he is half a beat behind her. - Play it. Two dancers, taking turns rather than moving as one.
Step 3 — the pulse
- On the drum kit, add the up-and-down size stack.
- Put
set size to (100) %above its forever. - Play. The kit should breathe with the beat and never grow.
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 the same colour.
Step 5 — watch it as a video
- Press the full-screen button above the Stage.
- Watch the whole thing for thirty seconds without touching anything.
- Anything that drifts, grows or changes colour for ever needs a reset at the top.
My dancer is enormous.
A change size by (10) with nothing to bring it back. Either add the matching negative, 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 was left behind. clear graphic effects at the top of the stack fixes it.
One dancer, on your beat
Put a dancer of your choosing on the track you wrote last lesson.
- The dancer changes costume in time with your drum.
- It never travels anywhere.
- Two runs in a row look the same.
Two dancers who are not twins
Add a second dancer. The two must be clearly different to watch, without either one falling off the beat.
- Both are in time with the same track.
- One moves on every beat, the other 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 visible should be moving to the same beat: the dancers, the instruments and the lights.
- At least four things changing on the beat.
- Sizes come back, colours reset, nothing runs away.
- Pressing the flag twice gives 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 ordinary beats, and then one that is not. On the eighth, 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 on the drop that do not change otherwise.
- Everything is back to normal by the next beat.
- It keeps happening for as long as the video runs.
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 travelling. It is changing, on a timer.
next costumewith the beat’s own wait is a dance.- A pulse goes up and comes back, and its two waits add up to one beat.
change [color v] effect by (25)is the lighting rig.- Whatever a loop changes, the set-up above it has to put back.
- Dance sprite
- A library sprite whose 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 within one beat. It must return, or it runs away.
- Graphic effect
- Colour, ghost and the rest. Reset them with clear graphic effects.
Next lesson: the video gets a shape — a verse, a chorus, and one sprite telling everybody when to change.