Chapter 10. Making Some Noise
This is the last chapter of this book, but it's far from the least important subject. Music and sound effects are a crucial part of a game's user experience. The right music can completely change the way a level feels. The right sound effects can help the player understand a game's mechanics or give him/her just the feedback that he/she needs to perform the right action at the right time.
Furthermore, the player expects to have sound in a game since it's been present in games since the early days of gaming. Sadly, when it comes to sound, HTML games have some big problems. There is not one single powerful solution you can use that will make it possible to add sound to your game and have it work on all browsers.
In this chapter we will cover four different techniques to add sound to your game:
Embedding: This is the oldest way to include sound in a page. It was used a lot in the old days to make a page play a MIDI file as background music. It's not standard, doesn...