Book Image

Mastering Android Game Development

By : Raul Portales
Book Image

Mastering Android Game Development

By: Raul Portales

Overview of this book

Table of Contents (18 chapters)
Mastering Android Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
API Levels for Android Versions
Index

Sound FX


Sound effects will be used for events in the game such as explosions, firing bullets, and so on, but also could be used in other cases such as menu clicks and dialogs appearing. In our game we will add sound effects to the explosions of the asteroids and the spaceship as well as for laser firing.

We will begin discussing some ways to get sound effects for games. We cannot work if we don't have sound files, right?

Once we have our sounds in place, we will update GameEngine to provide a way to signal events in the game, and we will let SoundManager know when one of those events happens.

Finally we will explain how SoundPool works and how to include it in our SoundManager, associating a game event to a sound effect.

Hands on—let's get some sound files.

How to create sound FXs

For indie developers, there are a few places where you can get sound effects. The already mentioned OpenGameArt not only has graphics but also sounds. One of the best places to find sound effects for games is the...