Game Career Guide is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Get the latest Education e-news
 
  • Developing iPhone Games: Peeking Inside the iPhone Toolbox

    [05.28.10]
    - Ian Marsh
  •  [This chapter from Apress' Beginning iPhone Games Development offers an overview of the iPhone's development platform and capabilities, and should get you acquainted with the different aspects of the platform you'll have to familiarize yourself with during development. It acts as a lead in to the full book, which describes each of these elements in detail.

    Apress is offering GameCareerGuide's readers 50 percent off of all books including this title -- visit apress.com and use promotional code APRESSGCGTI.]

    Now that we've established the iPhone's platform credentials and described why you should be excited about developing for it, let's take a peek at some of the tools you'll be using. These technologies include Objective-C or C/C++, Xcode, UIKit, Quartz 2D, Core Animation, OpenGL, audio APIs, networking, and GameKit. This chapter provides a brief overview of these technologies, how they can be used when developing a game, and examples of how they are employed in existing games.

    Development Tools and Environment

    The language of iPhone development is Objective-C. As the name implies, Objective-C is an extension of the American National Standards Institute (ANSI) C language designed to give C simple and straightforward object-oriented capabilities. While most of the iPhone APIs have Objective-C interfaces, it is possible for the noninterfacing parts of an application to be written in C/C++, since Objective-C syntax is a superset of the GNU C/C++ syntax. You'll need at least some understanding of Objective-C and experience with C/C++.

    Lucky for us, Apple prides itself on providing high-quality software to its developers. These tools have been enabling the creation of amazing software for the Mac for quite some time, and you'll be using nearly all the same tools for iPhone development. The foundation of iPhone development is Xcode, which allows for interface design, code editing, debugging, and performance analysis. All of this software is provided free of charge and will run on any Intel-based Mac computer.

    The Xcode integrated development environment (IDE) is a full-featured code editor, project manager, and graphical debugger. Xcode contains all the amenities of a modern IDE, including robust syntax coloring, error reporting, code completion, and code folding. Compiling, installing, and launching your application requires a single click, and the on-device debugging is great for hunting down bugs. Make yourself comfortable with its user interface and shortcuts, because you'll be spending a lot of time writing your C/C++ and Objective-C inside Xcode.

    Once your game is up and running, you can take advantage of the iPhone simulator. Able to simulate nearly every facet of the iPhone operating system apart from the accelerometer, the simulator is a quick and convenient way to test changes to your app. But make sure to test your app on a real device from time to time, since the simulator doesn't replicate device CPU performance or memory conditions.

    Completing the package are a few other tools aimed at helping you design and optimize your iPhone apps. Interface Builder provides a graphical user interface (UI) editor, which automates the loading and positioning of UIKit elements such as buttons and labels. If you're not using OpenGL to build your game, Interface Builder can greatly simplify the creation of items like menus and other static elements. Once you've reached the optimization phase of development, Instruments will come in handy. A powerful profiling tool, Instruments collects and visualizes data such as disk, memory, and CPU usage, allowing you to quickly find the bottlenecks or memory hogs in your game.

Comments

comments powered by Disqus