Sound and music are always left for the final stages. It's so embarrassing that the same has happened with this book. If you're serious about the gaming experience you're creating, take music and sound into account from the beginning. Even if your game is not audio-centric, you should think of music and audio as feedback systems and treat them with the same importance as graphics.
In this chapter we'll learn how to play audio files inside your game using the built-in Untz sound system. We'll add background music and sound effects.
In order to add some music and effects to our game we'll create a module called
AudioManager that will take care of loading sounds and playing them.