Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
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.
Choose a sound you'd like
Next, program the sound to play.
Click code and select the sound menu.
Click, hold and drag out a play sound block.
Click the block to see what it does.
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.
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.
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.
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.
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'd like.
Once you finish these steps, return to this page
to select another video.