O'Reilly logo

Developing Mobile Games with Moai SDK by Francisco Tufro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Let the Right Music In!

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.

Audio manager

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.

  1. First of all, we need ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required