Many games play music in the background to set the mood and make the game more entertaining.
Yours can, too! While you can program music to play for aspecific sprite, it’s usually a good idea to program the music on the stage. To do this,click on the stage. The music should start when the green flagis clicked, and keep playing forever. Scratch comes with a lot of sounds that soundgood when they’re played over and over. These types of sounds are called “music loops.”
To choose a music loop for your project, click on the sound tab,“add sound from library,” then the Music Loops Menu. Test sounds by pressing the play button,so you can find the sound that works best for your program.
You’ve now added a music loop to your program, but you still need to program it to play.
Click on sound, and find the “play sound” blocks.
Adding “play sound” to your block stack will tell the computer to move on to the nextinstruction in the stack after it starts to play a sound. That means your sound can beinterrupted by other sounds, and won’t work well when repeated because it never finishes playing.
Instead, add a “play sound until done” blockinside a forever loop. This now reads:You can now test it to make sure your code does what you want.
Great! The music loop is playing in the background forever.
Choose an Add-On
Time to Celebrate!
Create a wild winning celebration using some of these ideas.
Make your game more challenging by creating moving platforms.
Create a shrinking platform to increase your game's difficulty.
Splash! You Lose
Create a way for the player to lose in your game.
Add Some Tunes
Add some background music to your game.
Bug Fix: Land on Your Feet...or Not
Fix the bug that allows things other than a sprite's feet to keep it on a platform.