Apress

Beginning iPhone Games Development

By PJ Cabrera , Peter Bakhirev , Ian Marsh , Ben Smith , Eric Wing , Scott Penberthy

Beginning iPhone Games Development Cover Image

This book is the game-specific equivalent of Beginning iPhone 3 Development: Exploring the iPhone SDK, providing you with the same easy-to-follow, step-by-step approach, more deep technical insights, and that familiar friendly style.

Full Description

  • ISBN13: 978-1-4302-2599-7
  • 728 Pages
  • User Level: Beginner to Intermediate
  • Publication Date: May 13, 2010
  • Available eBook Formats: EPUB, MOBI, PDF
  • Print Book Price: $39.99
  • eBook Price: $27.99
Buy eBook Buy Print Book Add to Wishlist

Related Titles

Full Description

iPhone games are hot! Just look at the numbers. Games make up over 25 percent of total apps and over 70 percent of the most popular apps. Surprised? Of course not! Most of us have filled our iPhone or iPod touch with games, and many of us hope to develop the next best-selling, most talked-about game.

You’ve probably already read and mastered Beginning iPhone 3 Development; Exploring the iPhone SDK, the best-selling second edition of Apress’s highly acclaimed introduction to the iPhone and iPod touch by developers Dave Mark and Jeff LaMarche. This book is the game-specific equivalent, providing you with the same easy-to-follow, step-by-step approach, more deep technical insights, and that familiar friendly style.

While games are all about fun, at the same time, they’re serious business. With this Beginning iPhone Games Development book, you’re going to roll up your sleeves and get your hands dirty with some hardcore coding. While you may have written games before, this book will take you further, immersing you in the following topics:

  • Game graphics and animation with UIKit, Quartz, Core Animation, and OpenGL ES
  • Game audio with OpenAL, MediaPlayer Framework, AV Foundation, and AudioSession
  • Game networking with GameKit, Bonjour, and Internet sharing

For those looking for iPad game development coverage and/or iOS 5 SDK specific game coverage, check out the published Beginning iOS 5 Games Development by Lucas Jordan from Apress.

What you’ll learn

  • Efficient methods for drawing in 2D and 3D to the iPhone screen
  • Game-specific animation techniques with Core Animation
  • To use OpenGL ES for more complex and realistic gaming backgrounds and action
  • Numerous ways to add music to enhance the gaming experience
  • How to give your users access to their iPhone libraries from within games
  • The tools and techniques of 3D audio for creating even more realistic gaming experiences
  • How to do networking right, including two-player games over Bluetooth and multiplayer games over Wi-Fi

Who this book is for

All game developers who desire to create iPhone and/or iPod touch games.

Table of Contents

Table of Contents

  1. A Revolutionary Gaming Platform
  2. Games for Everyone, Anytime, Anywhere
  3. Developing iPhone Games
  4. Peeking Inside the iPhone Toolbox
  5. Moving Images on a Small Screen—UIKit Controls
  6. She Shoots, She Hits, She Scores! 
  7. Flipping Out and Sweeping Away with Core Animation
  8. OpenGL Basics: Wrapping Your Head
  9. Around the OpenGL AP
  10. Putting It Together: Making a Game in OpenGL
  11. The Next Steps: Atlases, Sprites, and Particles—Oh My
  12. Introduction to Core Audio
  13. Making Noise with OpenAL
  14. 3D Audio—Turning Noise into Game Sound
  15. Streaming: Thumping, Pulse-Quickening
  16. Game Excitement
  17. Networking for iPhone Games: Introductio
  18.  Going Head to Head
  19. Party Time
  20. Connecting with the Outside World
  21. Putting It All Together: Now Comes the Fun Part
Source Code/Downloads

Downloads are available to accompany this book.

Your operating system can likely extract zipped downloads automatically, but you may require software such as WinZip for PC, or StuffIt on a Mac.

Errata

If you think that you've found an error in this book, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.

* Required Fields

On page 45:
I am receiving a NSTimer warning:

'NSTimer' may not respond to '+scheduledTimerWith TimeInterval:target:selector:useInfo.repeat.'

On page 75:

the code self.animationImages.length doesn't work, owing to length: not recognized.

Is it [self.animationImages count] ?

On page 100:
On line 13 of this page the selector

[test updateBox];

is called. However, this selector hasn't been written yet in the sprite.m file.

On page 100:
The drawRect function calls a method 'updateBox' on object test that is not defined until page 119.

This function is supposed to update the bounding box variable 'box' with info from the 'width' and 'height' variables.

Nothing happens on the Simulator screen until this method is defined.

On page 100:
In drawRect method you make a call to method updateBox. But the implementation of updateBox method is seen only after page #118. And if I comment out that line the green shape is not visible. So I have to implement updateBox method and call that method inside drawRect method.

On page 108:
In updateSize method you've declared two CGFields:w and h. And then you continue saying w=h. After that neither w nor h is used. And the assignment of them to each other is not understandable.

On page 128:

line 26:
[self moveTo: p2];

It should be #import [self updateBox];

On page 129:

line 5:
#import "TextView.h"

It should be #import "TextSprite.h"

On page 210:
#import "BBPoint.h"

needs to be added to the top of BBSceneObject.h to get the project to compile correctly after creating the BBPoint definition.

On page 212-213:
term Size confused with Stride

it currently says:
initWithVertexes: vertexCount: vertexStride: renderStyle:

when the method definition is:
initWithVertexes: vertexCount: vertexSize: renderStyle:

also use of stride throughout page 213 is confusing when previously using the term size.

On page 220:
if ((touch.phase == UITouchPhaseBegan)) [self touchDown];

SHOULD BE:

if ((touch.phase == UITouchPhaseBegan) || ((touch.phase == UITouchPhaseStationary))) [self touchDown];

Otherwise button press not captured