Game Development Reference
In-Depth Information
To fix this, add the @import AVFoundation; statement and add the following code
to your AppDelegate.m ile:
- (void)applicationWillResignActive:(UIApplication *)application
{
// prevent audio crash
[[AVAudioSession sharedInstance] setActive:NO error:nil];
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// resume audio
[[AVAudioSession sharedInstance] setActive:YES error:nil];
}
This code handles AVAudioSession and prevents your application from terminating.
Summary
In this chapter, we have learned what advantages hardware game controllers have and
how to work with them. Adding game controller support to your game can certainly
provide a better user experience for your players. Some people prefer playing on
actual controllers than on touch-screen devices, since the screen is always flat and
doesn't provide feedback to touches. A player can use the controller without looking
at it, which completely changes the experience of playing if he/she is playing on a TV.
One might argue that with game controllers, Apple is making a move into the console
gaming territory, and a huge library of games on the iTunes App Store playable on
your TV or iPad with a separate hardware controller is opening another new way to
experience iOS games. Adding game controller support to your game is not difficult,
and if you are not already supporting them, you should really consider doing that.
We have also learned how to add background music and sound effects to your game.
In the next chapter, we will discuss how you can add your game to the App Store,
what provisioning profiles are, and how to prepare your application bundle.
In the next chapter, we will discuss how to prepare your application for the App
Store. We will also learn about provisioning profiles and procedures to have your
application approved by Apple.
 
Search WWH ::




Custom Search