You are previewing iOS Game Programming Cookbook.
O'Reilly logo
iOS Game Programming Cookbook

Book Description

Over 45 interesting game recipes that will help you create your next enthralling game

In Detail

As mobile game development is increasing in popularity, iOS Game Programming Cookbook offers a cutting-edge platform for you to visualize and strengthen your game ideas and implementation. You will start by understanding the concepts of SpriteKit and implement them in your games. You will learn about the particle system, game center, and how to analyze game performance, followed by how to use SpriteKit's built-in physics simulation and integrate the physics world in the game with bodies that have joints and can detect collisions in your projects. Next, you will pump up the volume in your game by adding music with iCloud support.

Moving on, you will add various AI behaviors and obstacle avoidance in your games. You will also get the chance to refresh your mathematics and physics skills to get a deeper understanding of game AI. By the end of the book, you will have created a multiplayer game!

What You Will Learn

  • Explore Apple's new SpriteKit framework

  • Create advanced iOS games using emitters, parallax effects, and texture packers

  • Add sound to your games with iCloud support

  • Implement and integrate various AI behaviors, such as flocking, alignment, and cohesion in your game

  • Develop a mini 3D game using OpenGL

  • Create a multiplayer drag-race game using Bluetooth

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. iOS Game Programming Cookbook
      1. Table of Contents
      2. iOS Game Programming Cookbook
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. iOS Game Development
        1. Introduction
        2. Getting started with the SpriteKit game framework
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Developing a mini game using SpriteKit
          1. Getting ready
          2. How to do it...
          3. How it works...
      9. 2. SpriteKit
        1. Introduction
        2. Learning the basics of SpriteKit – The FlyingSpaceship tutorial
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Understanding scenes, nodes, and sprites
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Anatomy of game projects
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Applying actions on sprites
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Adding infinite scrolling
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Moving characters
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      10. 3. Animations and Texture
        1. Introduction
        2. Animating your textures
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Creating a texture atlas
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Adding animations using a texture atlas
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Collision detection
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Parallax background
          1. Getting ready
          2. How to do it…
          3. How it works…
      11. 4. Particle System and Game Performance
        1. Introduction
        2. Installation of the particle system
          1. Getting ready
          2. How to do it
          3. How it works
          4. There's more
          5. See also
        3. Using the particle system in games
          1. Getting ready
          2. How to do it
          3. How it works
          4. There's more
          5. See also
        4. Particle emitter integration
          1. Getting ready
          2. How to do it
          3. How it works
          4. There's more
          5. See also
        5. Game performance analysis
          1. Getting ready
          2. How to do it
            1. Debug navigator
            2. Instruments
          3. There's more
          4. See also
      12. 5. Adding Music to iOS Games and an Introduction to iCloud
        1. Introduction
        2. Adding music to games
          1. Getting ready
          2. How to do it...
            1. System Sound Services
            2. AVAudioPlayer
            3. Audio Queue Services
          3. How it works…
          4. There's more…
          5. See also
        3. Adding background and sound effects
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Introduction to iCloud
          1. Getting ready…
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also…
        5. Integration of iCloud with iOS games
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      13. 6. Physics Simulation
        1. Introduction
        2. Introduction to physics simulation
          1. Getting ready
          2. How to do it...
        3. Integrating physics engine with games
          1. Getting ready...
          2. How to do it...
          3. How it works…
          4. There's more…
        4. Adding real-world simulation
          1. How to do it...
      14. 7. Adding Reality to Games
        1. Introduction
        2. Creating physics bodies in the world
          1. Getting ready
          2. How to do it...
        3. Physics joints
          1. Getting ready
          2. How to do it…
        4. Detecting contact and collisions
          1. Getting ready
          2. How to do it…
      15. 8. Introduction to Game Math and Physics
        1. Introduction
        2. The Pythagorean theorem
          1. Getting ready
          2. How to do it
        3. Using vectors
          1. How to do it
          2. How it works
        4. Physics
          1. How to do it
          2. How it works
      16. 9. Autonomous Moving Agents
        1. Introduction
        2. Introduction to steering behaviors
          1. Getting ready
          2. How to do it
        3. Implementing the seek
          1. Getting ready
          2. How to do it
          3. There's more
        4. Implementing flee
          1. Getting ready
          2. How to do it
          3. There's more
        5. Implementing arrive
          1. Getting ready
          2. How to do it
          3. There's more
        6. Implementing evade
          1. Getting ready
          2. How to do it
          3. There's more
        7. Implementing wander
          1. Getting ready
          2. How to do it
          3. There's more
        8. Implementing wall avoidance
          1. Getting ready
          2. How to do it
        9. Obstacle avoidance
          1. Getting ready
          2. How to do it
          3. There's more
      17. 10. 3D Game Programming with OpenGL
        1. Introduction
        2. Introducing OpenGL
          1. Getting ready
          2. How to do it
        3. Building a mini 3D animation game using OpenGL
          1. How to do it
          2. See also
      18. 11. Getting Started with Multiplayer Games
        1. Introduction
        2. Anatomy of multiplayer games
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Setup for a multiplayer game
          1. Getting ready
          2. How to do it
          3. How it works
        4. Assigning roles to players
          1. Getting ready
          2. How to do it
          3. How it works
          4. There's more
          5. See also
      19. 12. Implementing Multiplayer Games
        1. Introduction
        2. Creating our TankRace environment
          1. Getting ready
          2. How to do it
          3. How it works
        3. Movement of players
          1. Getting ready
          2. How to do it
          3. How it works
        4. Implementing game play
          1. Getting ready
          2. How to do it
          3. How it works
          4. There's more
          5. See also
      20. Index