Game Development Reference
In-Depth Information
Chapter 1
A Simple First Game
In this topic you are going to learn a lot about working with iOS. The goal, of course, is to be able to
build a game that runs on iOS. To do that, you must learn about a lot of different elements that a full
game will incorporate, such as basic UI widgets, audio, complex touch input, Game Center, in-app
purchases, and of course graphics. This topic will explore these concepts and many others. Think
of it as a guide to the building blocks that you will need to make a compelling game that is specific
to iOS and Apple's mobile devices. All iOS applications have one thing in common—the application
Xcode—so it makes sense to start with that.
In this first chapter, we are going to build a very simple game of Rock, Paper, Scissors. We will
use the Storyboard feature of Xcode to create an application with two views and the navigation
between them.
Included with this topic are sample Xcode projects; all of the code examples are taken directly from
these projects. In this way, you can follow along with each one in Xcode. I used version 4.5 of Xcode
when creating the projects for this topic. The project that accompanies this chapter is called Sample 1;
you can easily build it for yourself by following the steps outlined in this chapter.
The project is a very simple game in which we use Storyboard to create two scenes. The first
scene is the starting view, and the second scene is where the user can play the Rock, Paper,
Scissors game. The second scene is where you will add a UIView and specify the class as
RockPaperScissorView . The source code for the class RockPaperScissorView can be found in the
project Sample 1.
We will walk through each of these steps, but first let's take a quick look at our game, shown in
Figure 1-1 .
1
 
Search WWH ::




Custom Search