Theory
🐱 7. Dance Party
Now that you have some experience with loops, let’s use some to throw a dance party! Good thing Scratch has awesome dancers!
Step1:
Find Ben and Max in your sprites library and load them into a new program.
Step2:
👉 Go to Ben’s script editor.
🎭 Use a next costume looks block for his dance positions.
⏱️ Add a wait (0.5) seconds control block for a quick costume switch.
🚶♂️ Try adding side-to-side movement with move 10 steps and move -10 steps motion blocks.
🔁 Wrap everything in a forever control block to keep Ben dancing endlessly. Enjoy his moves!
Step3:
🔁 Switch to Max’s script editor.
👀 Check Max’s costumes under the Costumes tab.
🏀 Notice the fourth costume, max-d, showing her holding a basketball.
❗️ Avoid having the basketball randomly appear and disappear while Max dances—it would be odd!
🎭 Begin a new script with a 🚩 when flag clicked event block. 👗
Drag over three 🔄 switch costume to () looks blocks for max-a, max-b, and max-c costumes.
⏳ Don’t forget to add a wait () seconds control block between each costume change.
🔄 You can use a forever control block to make her repeat the costume changes.
⏱️ Shorten the wait time to 0.5 seconds to make her dance faster.
Step4:
🏃♀️ When Max wears the max-a costume, add a ▲ change y by 10 in motions blocks to make her jump up.
👣 When she wears the max-c costume, add a ▼ change y by -10 in motions block to make her land back on the ground.
Step5:
It’s not a dance party without a fun backdrop! Try loading the Party backdrop from your Scratch library.
Step6: Code complete
🎶 Choose a fun song like “Dance Celebrate” from the Scratch sound library.
🕺 Add a ▶️ start sound (__) sound block under Max’s when flag clicked event block and select your chosen song
BEN’s code
Max’s code
🕺 Try using the 🔄 turn motion code to give your dancers more movement.
🖼️ Add more backdrops and use a 🔁 loop to make them switch out during the dance party.
💬 Use a 💬 say looks code block to make Ben and Max talk! What funny things can you make them say?