Part I
The Tools to Get Started
- Chapter 1: Games on iOS
- Chapter 2: The Xcode Programming Environment
- Chapter 3: The C Programming Language
- Chapter 4: The Objective-C Programming Language
- Chapter 5: The Cocoa Foundation Framework
Chapter 1
Games on iOS
What You Will Learn In This Chapter:
- Examining the unique features of games on iOS
- Documenting and developing your idea
- Prototyping and preparing your game for coding
- Getting an overview of the game-related frameworks in iOS
Since you have picked up this book and are reading this, you must be interested in writing a game for iOS. Why do you want to write a game? There are some great reasons to write a game for iOS, first and foremost is that writing a game is fun! You can escape all of the constraints of reality in a game. In your game, you make the rules.
Writing games for iOS can be particularly fun because of the amazing capabilities of the device. You can include using a GPS, camera, accelerometer, and even a gyroscope in your game. Writing games for iOS can also be financially rewarding. With the ubiquity of iOS devices, millions of people can play your game. Moreover, since you will distribute your game in Apple's App Store, you do not have to worry about setting up your own storefront to distribute your creations. In January of 2011, Apple released a list of the top-selling applications on the App Store:
- Doodle Jump
- Tap Tap Revenge 3
- Pocket God
- Angry Birds
- Tap Tap Revenge 2.6
- Bejeweled 2 + Blitz
- Traffic Rush
- Tap Tap Revenge Classic
- AppBox Pro Alarm
- Flight Control
Notice that nine of the ten best-selling applications of all time for the iOS platform are games. Therefore, your choice to start investing your valuable time as an iOS game developer is a good one.
But, before worrying about making millions in the App Store, you need to think about not just making any iOS game, but making a good game.
What Makes a Good iOS Game?
As an aspiring iOS game developer, the first question that you need to ask yourself is, What makes a good iOS game? In this section, I'll try to give you some ideas that you can think about while you are designing your game.
Device Usage
As you start to formulate your ideas on your iOS game, you need to keep several things in mind. The first is how people use iOS devices and how that relates to the way that they play games.
Take another look at the top iOS applications. You could categorize each of the games as a casual game. There are no 100-hour RPGs or first person shooters on the list. All of the games on the list are easy to pick up for first-time gamers. Additionally, all of these games let you get in and out quickly in short bursts.
Think about how people use games or other applications in general on a mobile device. When you take out your phone to game, or use the address book, calendar, or text messaging, you want to get into the application and do what you want to do and get out quickly. Mobile users generally do not have a lot of time to dig into all of the features that may be present in a full-featured desktop application. The same is true for games. The most successful games for iOS are simple, with easy-to-learn rules and short levels that can be played in a few minutes. This may change as the iPad becomes a more prevalent gaming platform; but for now, short levels and simple rules are the best way to start the design of a successful game.
Use Unique Features of iOS
Some other factors that you should consider when designing your iOS game is how a player will control the game and how you can take advantage of the advanced features of iOS devices.
The most successful games on iOS have very simple control schemes. There are no physical buttons available on an iOS device. Therefore, designing a game that needs a controller like that of an Xbox 360 with dozen of buttons will not work in iOS. The control scheme needs to be simple. The most successful game controls allow the player to interact directly with the game actors themselves, and not through an intermediary controller like a D-pad or joystick. Apple clearly lays this point out in its Human Interface Guidelines (HIG), which I recommend that you read. The HIG is available online at http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/Introduction/Introduction.html.
You can use the touch capability of iOS devices to immerse the player in the game. When you allow a player to control a game by interacting directly with the parts of the game, the player feels more involved with the game. Think about building a board game like chess. It is more intuitive and immersive for a player to move the chess pieces as opposed to using an onscreen joystick and buttons to move the pieces.
You can also use some of the other features of iOS devices to make your games more immersive. All iOS devices contain an accelerometer that you can use to determine the orientation of the device. Consider how you can use this to enhance the controls of your game. Imagine a game that the player controls by tilting a device. You will learn how to build this type of game later in the book. This control scheme allows you to incorporate the physical world of the player with the imaginary world of your game.
Another feature widely available is GPS. Think about how you could incorporate the location of a player into your game. Perhaps you could build a game that gives a player points for going to certain locations. On the other hand, maybe, if a player were in a certain location he or she would be able to get a special weapon.
Make Your Game Fun
Your most important consideration while you are designing your game should be to make the game fun. If the game is not fun, no one will want to play it. Keep in mind that you will be playing the game very often as you are developing it. If the game is not fun, you will not enjoy the development process and this will show through in the game. Think about what makes games fun and apply those things to your game. Different people have different ideas of fun, and your perception of fun may not be the same as everyone else's. It is helpful to have as many other people as possible try out your game during the development process. These testers can often provide valuable feedback that you can use to make your game better.
First, the game should be easily approachable. Games with rules that are difficult to understand are often difficult for new players to pick up. You do not want to do anything to deter players from playing your game. Instead, use a simple set of rules that players will readily understand. If you have to write 10 pages of help to explain the rules of your game, it is probably too complex for a handheld device. If you do decide to make a complex game, you should be prepared to offer players a tutorial. Players are far more inclined to work through an in-game experience as opposed to reading a document to learn the rules.
Next, balance the game to challenge your players. It is not fun to play a game that is too easy nor is it fun to play a game that is too difficult. As the game designer, you need to find a balance that challenges your players but does not discourage them from playing. To do this, you will need to play-test your game often during the development cycle. Puzzle games often use another technique. That is, to start slowly with easy levels and gradually work the player up to the more difficult levels. That way, the player can get a feel for the game mechanics on the easier levels and apply those lessons to the more difficult ones.