11. Sound

This is the final chapter that deals with the underlying technology we need to make Sir Lamorak’s Quest and most 2D games. Sound is one of the most important elements in a game. Although it’s possible to create a game that has no sound at all, sound really can take your game to a new level.

Many of the games in the early 1980s didn’t have sound, or the sound was as simple as clicks and buzzes. Even though the sound was not that advanced, just having something really made a difference to the player’s experience.

During this chapter, we review the SoundManager class and look at how we can play both music and sound effects. This involves using both the AVAudioPlayer class and OpenAL.1

Sound Project

The project for this chapter introduces ...

Get Learning iOS Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.