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, the 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 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
Table of contents
- About the Authors
- About the Technical Reviewer
1. A Revolutionary Gaming Platform: Games for Everyone, Anytime, Anywhere
- 1.1. The Ever-Present iPhone
- 1.2. Mass Appeal—There's a Gamer Born Every Minute
- 1.3. User Interfaces—Death of the D-Pad
- 1.4. Connectivity—Plays Well with Others
- 1.5. User Data—This Time It's Personal
- 1.6. Device Performance—A Multimedia Powerhouse
- 1.7. Dev Kit? You're Holding It!
- 1.8. Innovation—Good Things Come from Small Developers
- 1.9. Summary
- 2. Developing iPhone Games: Peeking Inside the iPhone Toolbox
3. Moving Images on a Small Screen—UIKit Controls
3.1. A Quick Introduction to Cocoa Touch
- 3.1.1. The Objective-C Language
- 3.1.2. Cocoa Touch and the UIKit Framework
3.2. Building a Simple Game
- 3.2.1. Creating an Xcode Project
- 3.2.2. Creating the IVBricker User Interface
3.2.3. Snazzy Graphics Make the Grade
- 22.214.171.124. Adding the Image
- 126.96.36.199. The Illusion of Motion
- 188.8.131.52. Rocking and Grooving with User Input
- 184.108.40.206. Handling Accelerometer Input
- 220.127.116.11. Handling Touchscreen Input
- 18.104.22.168. When Objects Collide
- 22.214.171.124. Failure Conditions
- 126.96.36.199. Winning Conditions
- 188.8.131.52. Loading and Displaying Images Programmatically
- 184.108.40.206. Creating the Grid of Bricks
- 220.127.116.11. Detecting image View Collisions
- 18.104.22.168. Changing the Timer to CADisplayLink
- 3.2.4. The End?
- 3.3. Application Delegate Events
- 3.4. Saving and Loading Game State
- 3.5. Animating Images
- 3.6. Summary
- 3.1. A Quick Introduction to Cocoa Touch
4. She Shoots, She Hits, She Scores!
- 4.1. Quartz 2D Game Overview
- 4.2. Every Artist Needs a Canvas
- 4.3. Your First Graphic with Quartz 2D
- 4.4. Sprites
- 4.5. Which Way Is Up?
- 4.6. Vector Art
- 4.7. Flipbook Animations
- 4.8. Heads-Up Displays
- 4.9. Asteroids Game Architecture
- 4.10. Conclusion
5. Flipping Out and Sweeping Away with Core Animation
- 5.1. Core Animation Sample Project Overview
- 5.2. Animating UIViews
- 5.3. Animating Core Animation Layers
- 5.4. Summary
6. OpenGL Basics: Wrapping Your Head Around the OpenGL API
- 6.1. What Is OpenGL ES and Why Do I Care?
- 6.2. Understanding the 3D World
- 6.3. Matrix Basics: Taking the Red Pill
- 6.4. Rendering Basics
- 6.5. The Basic Game Template
- 6.6. Wrapping the CAEAGLLayer in a View: EAGLView
- 6.7. How to Draw Stuff with OpenGL
- 6.8. The Game Loop and the Timer
- 6.9. The Input Controller
- 6.10. The App Delegate
- 6.11. Summary
7. Putting It Together: Making a Game in OpenGL
- 7.1. Space Rocks! Game Design
- 7.2. Getting Started with the Template
- 7.3. Rotation Makes the World Go 'Round
- 7.4. 3D Point Upgrade
- 7.5. Adding Buttons
- 7.6. Building a Better Spaceship
- 7.7. Space Rocks!
- 7.8. Adding Missiles
- 7.9. Making Nicer Buttons
- 7.10. Collision Detection
- 7.11. Collisions on the Rocks
- 7.12. Summary
8. The Next Steps: Atlases, Sprites, and Particles—Oh My!
8.1. Textures and Texture Atlases
- 8.1.1. What Is a Texture Anyway, and Why Do I Care?
- 8.1.2. Getting Image Data into OpenGL
- 8.1.3. Binding Textures
- 8.1.4. UV Is Not Bad for Your Skin
- 8.1.5. You Get a Textured Quad!
- 8.1.6. Say Hello to the Texture Atlas
- 8.1.7. Switching the Old and Busted for the New Hotness
- 8.1.8. A Nicer User Interface
- 8.1.9. Colors with Textures
- 8.2. Sprite Animation
8.3. From 2D to 3D
- 8.3.1. It's Only One More D—What's the Big Deal?
- 8.3.2. Where Do 3D Models Come From?
- 8.3.3. From Modeler to Screen
- 8.3.4. What Is Normal?
- 8.3.5. Standardizing on GL_TRIANGLES
- 8.3.6. Textures Plus Models
- 8.3.7. Shadows Define Shape
- 8.3.8. Depth Buffer and Face Culling
- 8.3.9. Collision Detection Tweaks
- 8.4. Particle Systems Add Life to Your Game
- 8.5. Summary
- 8.1. Textures and Texture Atlases
9. Introduction to Core Audio
- 9.1. Audio Services Provided by Core Audio
- 9.2. The Core Audio Frameworks
- 9.3. Codecs and File Formats
- 9.4. Alerts and Vibration: Introducing System Sound Services
- 9.5. Setting Policies for Your Audio: Introducing Audio Session Services
- 9.6. Easy Audio Playback in Objective-C with AVFoundation
- 9.7. Mission Complete...but Our Princess Is in Another Castle!
10. Making Noise with OpenAL
- 10.1. OpenAL Overview
- 10.2. My Story and Goals for Audio Coverage
- 10.3. Roadmap for the Audio Coverage
10.4. Setting Up Basic Sound in OpenAL
- 10.4.1. Setting Up an Audio Session
- 10.4.2. Opening a Device
- 10.4.3. Creating a Context
- 10.4.4. Activating the Context
- 10.4.5. Generating Sound Sources
- 10.4.6. Generating Data Buffers
- 10.4.7. Loading Sound Data from Files
- 10.4.8. Submitting Sound Data to OpenAL Data Buffers
- 10.4.9. Attaching a Data Buffer to a Sound Source
- 10.4.10. Playing Sound
- 10.4.11. Shutting Down and Cleaning Up
- 10.5. Exposing Flaws and the Missing Details
10.6. Sound Resource Manager: Fixing the Design
- 10.6.1. Overview of the Resource Manager
- 10.6.2. Initial Cleanup
- 10.6.3. The Sound File Database (Cache System)
- 10.6.4. OpenAL Source Management (Reserving and Recycling)
- 10.6.5. Integration with Space Rocks!
- 10.6.6. Handling When All Available Sources Are Exhausted
- 10.6.7. Final Demo Embellishments
- 10.7. Save Point Reached
11. 3D Audio—Turning Noise into Game Sounds
- 11.1. The Design of OpenAL: Sources, Buffers, and Listeners
- 11.2. Limits of 3D Audio in OpenAL
- 11.3. Integrating the Listener into Space Rocks!
- 11.4. Adding Positions to Sounds
- 11.5. Listener Orientation
- 11.6. Source Direction and Cones
- 11.7. Velocity and the Doppler Effect
11.8. Distance Attenuation
- 11.8.1. Attenuation Models
- 11.8.2. Back to Space Rocks!
- 11.9. Using Relative Sound Properties to Selectively Disable 3D Effects
- 11.10. Achievement Unlocked: Use All OpenAL 3D Features
12. Streaming: Thumping, Pulse-Quickening Game Excitement
- 12.1. Music and Beyond
- 12.2. iPod Music Library (Media Player Framework)
12.3. Audio Streaming
- 12.3.1. AVFoundation-Based Background Music for Space Rocks!
- 12.3.2. OpenAL Buffer Queuing Introduction
12.3.3. OpenAL-Based Background Music for Space Rocks!
- 22.214.171.124. A New Buffer Data Class for Streaming
- 126.96.36.199. Unqueue the Processed Buffers
- 188.8.131.52. Queue a New Buffer If Necessary
- 184.108.40.206. Handle a Buffer Underrun
- 220.127.116.11. Handle EOF and Finished Playing
- 18.104.22.168. OpenALSoundController Changes
- 22.214.171.124. BBSceneController Integration
- 126.96.36.199. Analysis: Number of Buffers and Buffer Sizes
- 188.8.131.52. Star Power Ready!
- 12.3.4. OpenAL Speech for Space Rocks!
- 12.3.5. Audio Queue Services Based Background Music for Space Rocks!
- 12.3.6. Perfect Full Combo!
- 12.4. Audio Capture
- 12.5. Back to OpenGL
- 12.6. The End of the Audio Road
- 13. Networking for iPhone Games: Introduction
14. Going Head to Head
- 14.1. Hello Pong!
- 14.2. Using Peer Picker to Find a Human Opponent
- 14.3. Making the Connection
- 14.4. Sending and Receiving Messages
- 14.5. Game Over: Handling Disconnects
- 14.6. Summary
15. Party Time
- 15.1. 8 × 3 = ?
- 15.2. Making Connections
- 15.3. Socket Servers
- 15.4. Finding Servers via Bonjour
- 15.5. Implementing the Game Client
- 15.6. Implementing the Game Server
- 15.7. Summary
16. Connecting with the Outside World
- 16.1. Challenges
- 16.2. Basics of Online Game Play
- 16.3. Making Games More Social
- 16.4. Summary
- 17. Putting It All Together: Now Comes the Fun Part
- Title: Beginning iPhone Games Development
- Release date: August 2010
- Publisher(s): Apress
- ISBN: 9781430225997
You might also like
40 Algorithms Every Programmer Should Know
Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental …
Hands-On System Programming with C++
A hands-on guide to making system programming with C++ easy Key Features Write system-level code leveraging …
Learn CMake through a series of task-based recipes that provide you with practical, simple, and ready-to-use …
From Mathematics to Generic Programming
In this substantive yet accessible book, pioneering software designer Alexander Stepanov and his colleague Daniel Rose …