Beginning iOS Game Development

Overview

Get in the game and start building games for the iPhone or iPad!

Whether you only have a little experience with iOS programming or even none at all, this accessible guide is ideal for getting started developing games for the iPhone and iPad. Experienced developer and author Patrick Alessi presents the iOS system architecture, gives you the step-by-step of game development, and introduces the languages used to develop games. From the basic building blocks to including drawing, ...

See more details below
Paperback
$27.20
BN.com price
(Save 31%)$39.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (22) from $1.99   
  • New (12) from $3.99   
  • Used (10) from $1.99   

Overview

Get in the game and start building games for the iPhone or iPad!

Whether you only have a little experience with iOS programming or even none at all, this accessible guide is ideal for getting started developing games for the iPhone and iPad. Experienced developer and author Patrick Alessi presents the iOS system architecture, gives you the step-by-step of game development, and introduces the languages used to develop games. From the basic building blocks to including drawing, responding to user interaction, animation, and sound, this book provides a one-stop-shop for getting your game up and running.

  • Explores the tools and methodology used to develop games for the iPhone and iPad
  • Requires no previous experience with building a game for the iOS platform
  • Details how iOS games require different considerations than other applications
  • Addresses working with the Xcode programming environment, how to draw with the Quartz 2D API, ways to handle user input, and techniques for incorporating animation with Core Animation and sound with Core Audio

If you're ready to jump on the gaming app bandwagon, then this book is what you need to get started!

Read More Show Less

Product Details

  • ISBN-13: 9781118107324
  • Publisher: Wiley
  • Publication date: 12/20/2011
  • Edition number: 1
  • Pages: 432
  • Sales rank: 639,000
  • Product dimensions: 7.30 (w) x 9.10 (h) x 1.00 (d)

Meet the Author

Patrick Alessi has built data-centric applications for clients ranging from small business databases to large-scale systems for the United States Air Force. He is the developer of several applications in the iTunes store, and is the author of Professional iPhone and iPad Database Application Programming. He has also developed a variety of real-time systems, graphics intensive desktop applications, and games. Currently, he is focused on developing connected applications and games for mobile devices such as the iPhone and iPad.

Read More Show Less

Table of Contents

INTRODUCTION xxi

PART I: THE TOOLS TO GET STARTED

CHAPTER 1: GAMES ON IOS 3

What Makes a Good iOS Game? 4

Device Usage 4

Use Unique Features of iOS 4

Make Your Game Fun 5

Graphics and Design 6

Developing Your Idea 6

Documenting Your Game 6

Prototyping Your Game 7

Preparing to Code 8

Game-Related Frameworks 9

Cocoa 9

Drawing: UIKit and Core Graphics 11

User Interaction: Cocoa Touch 12

Animation: Core Animation 12

Sound: Core Audio 13

Game Kit 14

Summary 14

CHAPTER 2: THE XCODE PROGRAMMING ENVIRONMENT 17

The Coding Environment 18

Creating a Project 19

Navigating Your Project 22

The Navigator Area 22

Navigating by Symbol 23

Searching Your Code 23

Viewing Code Issues 24

Examining Logs 24

Editing Your Code 25

Code Coloring 25

Indentation and Snippets 26

Fix-it 28

Integrated Help 28

Using the Jump Bars 29

The Assistant Editor 30

Xcode Debugging Tools 31

Breaking and Stepping through Your Code 31

Additional Breakpoint Features 35

Building a Simple Interface 36

Summary 42

CHAPTER 3: THE C PROGRAMMING LANGUAGE 45

Introducing C 45

Variables and Expressions 46

Data Types 46

Variables 47

Base Data Types 47

Generating Output and Accepting Input 47

Extending the Data Types 50

Operators 51

Assignment Operators 52

Arithmetic Operators 54

Relational Operators 54

Logical Operators 55

Scope 55

Structures 56

Arrays 61

Loops 64

for Loops 64

while and do…while Loops 67

break and continue 72

Execution Flow and Decisions 73

The if Statement 73

The Conditional Operator 74

Choosing an Option with switch 75

Breaking Up Code with Functions 77

Pointers 82

A Game Example 85

Summary 91

CHAPTER 4: THE OBJECTIVE-C PROGRAMMING LANGUAGE 95

Classes and Objects 96

Instance Variables 97

Methods and Messages 98

Managing Memory 104

Automatic Reference Counting 106

Inheritance 107

Building Subclasses from a Base Class 107

Overriding Base Class Methods 110

Polymorphism 111

Building a Game in Objective-C 114

Exposing Class Data with Properties 115

Declaring a Property 115

Accessing a Property 117

Class Methods 117

Implementing the MindPlayer 119

Building the Game Loop 127

Summary 134

CHAPTER 5: THE COCOA FOUNDATION FRAMEWORK 137

Model-View-Controller Architecture 138

Your First iOS Game 138

Building the UI 140

Outlets and Actions 140

Handling Text with NSString 144

NSString Methods 144

Mutable and Immutable Types 144

String Comparison 145

Collecting Objects with NSArray 146

NSArray Methods 146

Modifying Arrays by Using NSMutableArray 147

Wrapping Numbers with NSNumber 147

Other Collection Classes 148

NSSet 148

NSDictionary 148

Building the Game Model 157

Periodic Events and Timers 162

Summary 169

PART II: GAME BUILDING BLOCKS

CHAPTER 6: DRAWING WITH UIKIT AND CORE GRAPHICS 173

Introducing the Drawing Frameworks 173

UIKit 174

Core Graphics 175

The Drawing Environment 175

The Graphics Context 175

The UIView Coordinate System 176

The drawRect: Method 176

Drawing Shapes with UIBezierPath 177

Specifying Colors with UIColor 178

Advanced Drawing with Core Graphics 186

Shadows 186

Gradients 188

Starting the Blocker Game with the BlockView 192

Working with Images 197

The Image Classes 198

The View Hierarchy 199

Animation and Timing with CADisplayLink 206

Finishing the Blocker Game 215

Summary 217

CHAPTER 7: RESPONDING TO USER INTERACTION 219

Events in iOS 219

The Event Architecture 220

Event Objects 221

Handling Multitouch Events 222

Building a Simple Touch-Based Game: Simon Says 225

Responding to Motion with the Accelerometer 241

Recognizing Gestures 247

Summary 248

CHAPTER 8: ANIMATING YOUR GRAPHICS 251

Animating Images with UIImageView 252

Introducing Core Animation 255

A Brief Introduction to Blocks 255

Animating UIView Properties and Transitions 256

Property Animations 256

Transition Animations 267

Core Animation Basics 276

Layer Layout 277

Animatable Properties 277

Layer Trees 283

Summary 286

CHAPTER 9: MAKING NOISE WITH IOS AUDIO APIS 289

Playing Simple Sounds with the System Sound Services 290

Playing Sounds with the AV Foundation Framework 291

The AVAudioPlayer Class 291

Format and Performance Considerations 292

Confi guring the Audio Session 293

Playing Multiple Sounds Simultaneously 313

Looping Sounds 313

Media Player Framework 322

Summary 330

CHAPTER 10: BUILDING A NETWORKED GAME WITH GAMEKIT 333

Introducing GameKit 333

Starting Out 334

Networking Your Game 351

NSData and NSCoding 352

Converting Classes to Data with Archives 353

Connecting and Sending Data 354

Running the Game 364

Summary 366

APPENDIX: ANSWERS TO EXERCISES 369

INDEX 385

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)