Scratch exercise 64

Disco dancer

In this exercise you will create an animation of a dancer complete with flashing disco lights.


1. Create a new Scratch game .. File>New



2. Select the Cat sprite under the stage, switch to it's "Cosumes" tab and import the Dan1, Dan2, Dan3, Dan4, Dan5, and Dan6 costumes from the "People" folder ..


Now delete the Cat costumes and re-name the sprite "dancer".



3. You are going to make the dancer appear to dance by changing costumes and moving. We'll also add a graphic effect (Fish-eye).

Click on the Script tab of the dancer and add these scripts ..

The first repeat loop moves the dancer in one direction and the second moves him back to where he started.


Press the "B" key to try them out and the "E" key to end playback. Experiment with the "repeat", "move" and "fish-eye" values until you get an effect you like.



4. Select the stage, go to the stage "background" tab and fill the stage with black. Then go to the sound tab and import "HipHop" from the "Music loops" folder.

We want this loop to keep playing repeatedly. To do this we must add a play sound script block and then add a wait script with a value exactly the length of the loop.

Try this script ..



5. Now we need to add two disco balls. Download, save and then import this sprite/image ("Choose new spite from file" button )..



Re-name it "disco ball 1" and then add this script to it ..



6. Duplicate "disco ball 1" and re-name it "disco ball 2".

Now edit the "go to x y" script block of "disco ball 2" script so it appears in the top RIGHT corner of the stage opposite disco ball 1.



7. Use "File>Save as" to name and save your game. Call it "disco dancer".



8. Now we're going to add the spotlight effects. Download, save and import this spotlight beam image ..




Re-name it "spotlight 1", and then select the Costume tab and click "Edit".

Click on the "Set costume center" button and drag the costume center point to the pointed end ..



9. We want the spotlight to follow the dancer and flash different colours.

Add these scripts to it ..



10. Now duplicate "spotlight 1" and make these changes to it ..



11. Finally we need to add a flashing floor. Download, save and import this image ..



Drag the disco floor sprite to the bottom of the stage and add this script to it ..



12. Use "File>save" to re-save your game again.



13. You're finished. Well done. Press "B" to start the game and wtahc the disco dancer. Press "E" to end.