Book Image

Mastering Cocos2d Game Development

By : Alex Ogorek
Book Image

Mastering Cocos2d Game Development

By: Alex Ogorek

Overview of this book

Table of Contents (15 chapters)
Mastering Cocos2d Game Development
About the Author
About the Reviewers

Chapter 4. Sound and Music

This chapter is all about the different ways to present music and sound effects to the player of the game using Cocos2d, and why high-quality music and sound effects matter in a great game. Trust me, there's more to sound effects than just playing a sound file when an event happens. Otherwise, why would it have an entire chapter? Although there are a lot of users who play with the sound off on mobile devices, it's still an immersive part of some players' experience, so we have to pay close attention to not only the sounds we choose but also how they're implemented.

In this chapter, we will cover the following topics:

  • Loading and unloading effects

  • Playing sound effects and loop background music in creative ways

  • Modifying the played sound on the fly

  • Other good examples of sounds


For the code up to this point, open the Chapter 4 project and the sound effects from the Sounds directory in the book's included files.

It's recommended that you follow the code provided, as...