The_Official_Raspberry_Pi_-_Beginner’s_Book_Vol1,_2018 (1)

(singke) #1
Chapter 4 Programming with Scratch^83

THE OFFICIAL RASPBERRY PI BEGINNER’S GUIDE


To complete the Olympic feel, you’ll need to add some music. Click on the Sounds tab above
the blocks palette, then click the ‘choose new sound from library’ icon. Click on the Music
Loops category, then click on the small play icons (Figure 4-19)until you find some music you
like – we’ve picked ‘dance around’. Click on the OK button to choose the music, then click on
the Scripts tab to open the scripts area again.


5 Figure 4-19: Select a music loop from the sound library


Add another when clicked Events block to your scripts area, then add a forever
Control block. Inside this Control block, add a play sound dance around until done block –
remembering to look for the name of whatever piece of music you chose – and click the green
flag to test your new program. If you want to stop the music, click the red octagon to stop the
program and silence the sound!

Free download pdf