Name: Add Sound Track
Description: A common pattern is to add sound track or background music to the game.
Need for Pattern: Having a sound track is a way of increasing the excitement of the game and communicating the feeling of the game to the players.
Related Game Patterns: Add Sound Effects [related]
Coding Concepts involved: Events
If you want to keep the same music looping or if you only have one level then you can add a soundTrack in a simple way using the code blocks shown below.
If you already have more than one level then you may want to change the tune for different levels. You can see how to do this in the screenshot below.
Test your game to check that your changes have the desired behaviour and that there are no side effects.
This Game Pattern is one of many allowing you to make improvements to your platform game and to learn coding and wider computing concepts. Find more on the Game Pattern page.
A next step you might want to try is to add sound effects when things happen.