O'Reilly logo

Mastering Android Game Development by Raul Portales

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

Summary

We have created a SoundManager that loads and unloads sound effects and music tracks from the assets folder, using the classes Android has for it—SoundPool and MediaPlayer—and we have learned the best use for each of them.

To play sounds we have added a GameEvent messaging system to the GameEngine that can be used for other purposes; this is a common mechanism for synchronizing GameObjects.

For music we have linked pausing and resuming the music with the Activity life cycle.

We have also added the possibility of enabling and disabling sounds and music independently at any time and stored the states in a persistent storage.

At this point the GameEngine is mostly complete. In the following chapters we are going to focus on the tools that Android ...

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