arrow_back Dance Whirl
There are many ways to move and animate sprites in Scratch.
In this video, you will make the sprites whirl to music.
To start, choose a sprite to program.
This example uses the "G", but you can use any sprite you'd like.
Next, choose a song.
Select the Sounds tab, and click “Choose sound from library.”
The library contains sound effects and music loops.
Select Music Loops, and try a few.
("dance snare beat" plays) ("triumph" plays) Choose a sound you like, and click OK.
Next, program the sound to play.
Click Scripts, and select the “Sound” menu.
Click, hold, and drag out a “play sound” block.
Click the block to see what it does.
("triumph" plays) Whoa!
Next, program the letter to whirl or twist.
Select the Looks menu, and drag a “change effect” block below the “play sound” block.
Change the value to “whirl,” and click run.
("triumph" plays) The song plays, and the letter whirls.
To make the letter whirl more, repeat the effect.
From the Control menu, add a “repeat 10” block around the “change effect” block.
The repeat block is a type of loop.
It runs the change effect block 10 times.
("triumph" plays) You did it!
The letter whirls, but only in one direction.
Next, make it whirl back.
Press the stop sign to reset the effect.
Add another “repeat” block below the first one you added.
Then, add a “change effect” block from the Looks menu.
Change the values to “whirl” and negative 25.
Try it out.
("triumph" plays) Great job!
The letter whirls 10 times in one direction, then it whirls 10 times the other way.
Next, add an event to tell the computer when to run this code.
This example will use a “when this sprite clicked” block, but you can use any event you like.
You could run this code when you press a key or click the flag.
To copy this code to other letters, click, drag, and drop the code onto another sprite.
Click the sprite to check that it copied correctly, and run the code.
("pop") ("triumph" plays) ("pop") Copy this code to as many sprites as you like.
Now it’s your turn: Select a sprite to program.
Select a sound from the “Sounds” tab.
Add a “play sound” block.
Add two “repeat 10” blocks and two “change effect” blocks Change the values to “whirl.”
Make one whirl a positive value, and one a negative value.
Copy this code to as many sprites as you like.
Once you finish these steps, return to this page to select another video.