You are previewing iPhone Game Development.
O'Reilly logo
iPhone Game Development

Book Description

What do you need to know to create a game for the iPhone? Even if you've already built some iPhone applications, developing games using iPhone's gestural interface and limited screen layout requires new skills. With iPhone Game Development, you get everything from game development basics and iPhone programming fundamentals to guidelines for dealing with special graphics and audio needs, creating in-game physics, and much more. Loaded with descriptive examples and clear explanations, this book helps you learn the technical design issues particular to the iPhone and iPod Touch, and suggests ways to maximize performance in different types of games. You also get plug-in classes to compensate for the areas where the iPhone's game programming support is weak.

  • Learn how to develop iPhone games that provide engaging user experiences

  • Become familiar with Objective-C and the Xcode suite of tools

  • Learn what it takes to adapt the iPhone interface to games

  • Create a robust, scalable framework for a game app

  • Understand the requirements for implementing 2D and 3D graphics

  • Learn how to add music and audio effects, as well as menus and controls

  • Get instructions for publishing your game to the App Store

Table of Contents

  1. Special Upgrade Offer
  2. Preface
    1. The Authors
    2. Our Goal
    3. Prerequisites
    4. Audience
    5. Organization of This Book
    6. Conventions Used in This Book
    7. Using Code Examples
    8. We’d Like to Hear from You
    9. Safari® Books Online
    10. Acknowledgments
  3. 1. Introduction to the iPhone
    1. Apple Developer Account and Downloading the SDK
      1. Application Bundles
      2. Xcode and Interface Builder
      3. Views and Controllers
        1. Adding a new View and View Controller to an existing window
        2. Adding a new View to an existing View Controller
        3. Proxy objects
    2. Loading Devices
      1. Certificates and Profiles
        1. App ID
        2. UDID
        3. WWDR certificate
        4. Installing the profile
      2. Xcode Configuration
    3. Objective-C Primer
      1. Classes
      2. Instantiation
      3. Messaging
      4. Member Variables
      5. Memory Management
      6. Constructors and Destructors
      7. Interface Builder Integration
      8. Mixed C++ and Objective-C
    4. Conclusion
  4. 2. Game Engine Anatomy
    1. Application Framework
      1. Main Loop
    2. Game State Manager
      1. State Machine
    3. Graphics Engine
      1. Texturing
        1. Pixels, textures, and images
        2. Transparency
        3. Texture blending
        4. Rotation
        5. Clipping
      2. Animation
        1. Two-dimensional animation: Sprites
        2. Three-dimensional animation: Models
        3. Animation controllers
        4. Particle systems
        5. Culling
        6. Texture sorting
        7. Texture files
        8. Resource management
        9. Level of detail
      3. Physics Engine
        1. Collision detection versus collision resolution
        2. Two-dimensional collision detection
        3. Three-dimensional collision detection
        4. Collision resolution
      4. Audio Engine
        1. Sound samples
        2. Playing sound
        3. Multichannel sound
        4. Music versus SFX
        5. Output devices and interruptions
      5. Player Input
        1. Touch events
        2. Resolving into high-level events
      6. Game Logic
        1. High-level events
        2. Artificial intelligence
        3. Transparent suspend and resume
        4. Frame-based versus time-based logic
        5. Game logic organization
    4. Conclusion
  5. 3. The Framework
    1. Game State Management
      1. Implementation
      2. Removing the Status Bar
    2. The App Delegate
      1. Frames per Second
    3. Event Handling
    4. The Resource Manager
      1. Texture Format
      2. Sound Format
      3. Deploying Resources
      4. Management
    5. The Render Engine
      1. GLESGameState
      2. Textures
      3. Font Textures
      4. Example State
    6. The Sound Engine
      1. Example State
    7. The Data Store
      1. Storing Simple Data
      2. Storing Complex Data
      3. Example State
    8. The Skeleton Application
    9. Conclusion
  6. 4. 2D Game Engine
    1. Game Design
      1. Feature List
      2. User Input Scheme
      3. Learning Curve
        1. Level 1
        2. Level 2
        3. Level 3
        4. Level 4
    2. Tile Engine
      1. Unique Tiles
      2. Drawing Tiles
      3. TileWorld Class
        1. Loading
        2. Rendering
        3. Camera
        4. Physics
    3. Animation
      1. Animation and Sprite Classes
        1. Property list
        2. Animation class
        3. Sprite class
    4. Physics
      1. Entities
      2. Entity-to-World
      3. Special Tiles
      4. Entity-to-Entity
    5. Level 1 Implementation
      1. gsEmuLevel
      2. TileWorld
      3. Main Character
        1. Entity
        2. gsEmuLevel
        3. User input
      4. Emu Chicks
        1. Entity
        2. gsEmuLevel
      5. Emu Mother
      6. Game Logic
      7. Sound
    6. Level 2 Implementation
      1. gsLionLevel
      2. TileWorld
      3. McGuffin
      4. Main Character
      5. Lion Entities
        1. Entity
        2. gsLionLevel
      6. Game Logic
      7. Sound
    7. Level 3 Implementation
      1. gsMazeLevel
      2. TileWorld
      3. Buttons
      4. Doors
      5. Cat and Mouse
      6. User Input
      7. Game Logic
        1. Initialization
        2. Context action
        3. Update
      8. Sounds
    8. Level 4 Implementation
      1. gsRiverLevel
      2. TileWorld
      3. Crocodiles
      4. Logs
      5. Tom
      6. User Input
      7. Game Logic
        1. Initialization
        2. Update
      8. Sounds
    9. Game State Serialization
      1. Initialize Storage
      2. End Game
      3. Modify UI
    10. Conclusion
  7. 5. 3D Games
    1. GLESGameState3D Class
      1. POWERVR
        1. Vectors and matrixes
        2. Model format
        3. 3ds Max plug-in
        4. Texture format
      2. Sprite3D
      3. Accelerometer
    2. 3D Game Design
      1. Graphics
        1. Ship
        2. Hoops
        3. Skybox
        4. Particle system
        5. 2D elements
      2. Input
        1. Accelerometer
        2. Thruster
      3. Camera
      4. Logic
    3. Implementation
      1. Camera
      2. Skybox
      3. Input
        1. Calibration
        2. Thrusters
      4. Rings
        1. Layout
        2. Implementation
      5. Particle System
      6. Logic
      7. Best Times
      8. End Game
    4. Conclusion
  8. 6. Considerations for Game Design
    1. Resource Management
    2. User Input Design
    3. Networking
    4. Third-Party Code
      1. Libraries
      2. Middleware
      3. Open Source Games
    5. App Store
    6. Conclusion
  9. A. References
    1. Code Reference
    2. Physics Libraries
    3. Middleware
    4. Open Source Games
  10. Index
  11. About the Authors
  12. Colophon
  13. Special Upgrade Offer
  14. Copyright