Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch

Book description

Beginning iOS Game Center and Game Kit shows you how to use Game Center and Game Kit to create fun and polished games that use advanced features such as social networking and voice over IP (VoIP). Game Kit and Game Center can help you reach new customers through social interaction, so this book shows you how you can quickly add a level of polish to your app that used to take weeks of hard work and late nights.

Implementing a leaderboard and achievement system has never been so simple! Gone are the days of writing your own server. You'll also see how to easily add advanced networking concepts like VoIP support in hours, not days.

Learn how to quickly implement many advanced social networking concepts into your apps. You'll be guided through the process of creating a custom Game Center Manager class that can be rapidly deployed into any of your new or existing projects. Furthermore, learn how to avoid pitfalls commonly encountered by new Game Center developers.

What you'll learn

  • What Game Center and Game Kit are and how you can improve your app by using them

  • How to configure your app with iTunes Connect to work with Game Center

  • How to set up leaderboard and achievement systems for use within your app

  • How to add a custom graphical user interface to Game Center to match the look and feel of your product

  • What multiplayer and networking does to your app through Game Kit

  • How to write an easy-to-implement and reusable Game Center Manager

Who this book is for

All iOS developers who want to easily bring their current or planned app to the next level. Game Center and Game Kit, despite the name, are not limited only to games—all iOS developers with a basic understanding of Cocoa and UIKit will find something useful in these APIs. They allow even a novice iOS developer to add an amazing level of polish to their apps with a minimal amount of effort.

Table of contents

  1. Title
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Author
  6. About the Technical Reviewer
  7. Acknowledgments
  8. Foreword: The Legend of Kyle, Game Hero
  9. Introduction
    1. Prerequisites
    2. How This Book Is Organized
    3. Required Software, Materials, and Equipment
  10. Chapter 1: Getting Started with Game Kit and Game Center
    1. Game Kit: An Overview
    2. Sample Game: UFOs
    3. UFOs: Examining the Source Code
    4. Getting Started with iTunes Connect
    5. Summary
  11. Chapter 2: Game Center: Setting Up and Getting Started
    1. Testing for Game Center
    2. Authenticating with Game Center
    3. The Sandbox
    4. Watching for Status Changes
    5. Working with GKLocalPlayer
    6. Retrieving a Friends List
    7. Friend List Avatars
    8. Working with Players
    9. Summary
  12. Chapter 3: Leaderboards
    1. Why a Leaderboard?
    2. An Overview of Leaderboards in Game Center
    3. Configuring a Leaderboard in iTunes Connect
    4. Posting a Score
    5. Setting a Default Leaderboard
    6. Adding Score Posting to UFOs
    7. Handling Failures When Submitting a Score
    8. Presenting a Leaderboard
    9. Customizing the Leaderboard
    10. Mapping a Player ID
    11. Local Player Score
    12. A Better Approach
    13. Summary
  13. Chapter 4: Achievements
    1. Why Achievements?
    2. An Overview of Achievements in Game Center
    3. Configuring Achievements in iTunes Connect
    4. Resetting Achievements
    5. Adding Achievement Hooks
    6. Summary
  14. Chapter 5: Matchmaking and Invitations
    1. Why Add Matchmaking and Invitations to Your App?
    2. Common Matchmaking Scenarios
    3. Creating a New Match Request
    4. Presenting Match GUI
    5. Handling Incoming Invitations
    6. Auto-Matching
    7. Matching Programmatically
    8. Adding a Player to a Match
    9. iOS 5 Reinvites
    10. Player Groups
    11. Player Attributes
    12. Player Activity
    13. Using Your Own Server (Hosted Matches)
    14. Summary
  15. Chapter 6: The Peer Picker
    1. Benefits of the Peer Picker
    2. Real-World Examples
    3. Working with Sessions
    4. Presenting a Peer Picker
    5. Advanced GKSession Interaction
    6. The Peer Picker Delegate
    7. Summary
  16. Chapter 7: Network Design Overview
    1. Three Types of Networks
    2. Less Common Networks
    3. Reliable Data vs. Unreliable Data
    4. Sending Only What Is Needed
    5. Prediction and Extrapolation
    6. Formatting Messages
    7. Preventing Cheating and Preventing Timeout-Related Disconnections
    8. What to Do When All Else Fails
    9. Summary
  17. Chapter 8: Exchanging Data
    1. Modifying a Single-Player Game
    2. Setting Up Our Engine for Multiplayer
    3. Putting Everything Together
    4. Disconnections
    5. Summary
  18. Chapter 9: Turned-Based Gaming with Game Center
    1. A New Sample Project
    2. GKTurnedBasedMatchmakerViewController
    3. Starting a New Game
    4. Making the First Move
    5. Continuing a Game in Progress
    6. Ending a Match
    7. Quitting and Forfeiting
    8. Programmatic Matches
    9. GKTurnBasedEventHandler
    10. Summary
  19. Chapter 10: Voice Chat
    1. Voice Chat for Game Center
    2. Voice Chat for Game Kit
    3. Putting It Together
    4. Summary
  20. Chapter 11: In-App Purchase with StoreKit
    1. Setting Up Your App in iTunes Connect
    2. Adding Products to Your App
    3. Purchasing a Product
    4. Test Accounts and Testing Purchases
    5. Submitting a Purchase GUI Screenshot
    6. Developer Approval
    7. Receipts
    8. Tying Everything Together in UFOs
    9. Summary
  21. Index

Product information

  • Title: Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch
  • Author(s):
  • Release date: November 2011
  • Publisher(s): Apress
  • ISBN: 9781430235279