iPhone Game Development - Chris Craft [63]
Finally, you select the winning design and pay the designer, and your completed design is sent to you along with its copyright. If you need a simple one- or two-screen user interface that looks great, you might want to consider this option.
Creating sounds
Having great visuals for your applications is important, but don't underestimate how important audio is to a great end-user experience. Movie studios invest a huge amount of time, effort, and money into creating the perfect soundtrack for the latest blockbuster movie. You can hear the same attention to detail in many modern video games. After having compelling graphics, one of the best ways to pull the player into your game world is to have first-rate audio. The average developer isn't much better at creating music and sound effects than at creating graphics. Fortunately for us, there are other options:
SoundsXtras (www.soundsxtrascom). SoundsXtras provides absolutely royalty-free sounds. It's a very large sound library with over 22,000 audio files.
PodSafe Audio (http://podsafeaudiocom). This is an online community of independent artists who you could work with to use their music in your projects.
The Freesound Project (www.freesoundorg). The Freesound Project is an online community for free and open exchange of sounds. Since all sounds are released under the Creative Commons Sampling Plus License, you are free to create applications using them. The Freesound Project has everything from audio snippets to samples to recordings.
Soundsnap (www.soundsnapcom). Another online community-driven sound library, Soundsnap maintains an audio library with 100,000 high-quality sound effects and loops. You can get a free account that allows up to five free downloads a month, or get a pro membership. The unlimited annual pro membership fee is currently $149.
AudioJungle (http://audiojunglenet). AudioJungle is another audio community that has thousands of stock music loops and audio effects. Each audio file has a small fee associated with it, but it's a great place to pick up something special. In many cases a sound effect is around $1, and a song is less than $10.
Programming: AmuckRacer
Gentlemen and ladies, start your engines! You are now ready to take what we have learned in this chapter and create your next exciting iPhone game: AmuckRacer. First, you will need to gather the right graphics for the game. Before you get started writing code, we will go over some design and analysis materials to make sure you are on the right track.
Defining your goals
In AmuckRacer the goal is to create a simple but exciting racing simulation. We are going to use sprites, or game graphics, for our images so the game will be in 2-D. Here are our goals for AmuckRacer:
The player should be able to steer by tilting the iPhone to the left and right.
The player should be able to brake by tilting the iPhone backward and accelerate by tilting the iPhone forward.
The game needs to increase in difficulty as it's played.
If the player drives off the road, the car should drastically lose speed.
If the player collides with another car or an oil slick, the car should come to a stop.
The player must make it to a checkpoint in order to continue playing to the next round.
The game should include some viral aspect to help increase sales.
Examining your options
It is important to always review your goals and consider your options before you begin actually coding an application. As the saying goes, you want to measure twice and cut once. This way if you ever change your mind you will only have lost design time and not coding time. It is always easier to think of something than it is to code something.
Consider our first two goals: “The player should be able to steer by tilting the iPhone to the left and right” and “The player should be able to brake by tilting the iPhone backward and accelerate by tilting the iPhone forward.” Both of these goals can be achieved by using the iPhone's accelerometer.