Chapter 9. GameCenter leaderboards and achievements—Rock, Paper, Scissors

 

This chapter covers

  • Working with GameCenter
  • Creating leaderboards for your games
  • Playing and chatting with others

GameCenter is a great way to open your app up to a more social aspect of gaming. It includes leaderboards, achievements, and even chatting within the app. In this chapter you’ll take the Rock, Paper, Scissors game from chapter 8 and add Game-Center functionality to it.

Using GameCenter, a player can view their past game scores and achievements, as well as the scores and achievements of friends. They can invite friends to play games through GameCenter, which matches the devices up to play together.

In this chapter, you’ll look at techniques for authenticating players in Game-Center and using leaderboards and achievements. Leaderboards allow your app to store a user’s score and display the leaderboard as a view. Achievements are similar to leaderboards, but are stored as a percentage (for example, 100% means the player achieved the goal).

The last few techniques will explore matching players up for games, and even voice chatting within the app using GameCenter.

9.1. Game Center authentication and leaderboards

GameCenter requires the user to create a username and password in order to store and display score and achievement data. A lot of the work and user interface (UI) is provided in GameKit, but there’s still work to do in the app and in iTunesConnect.

9.2. GameCenter achievements

9.3. Matching and playing via GameCenter

9.4. Summary

sitemap