Chapter 17
Creating Multiplayer Games with GameKit

Now that you have some of the basic Game Center features added to Hog Dice, you’re ready to extend the game’s functionality to allow for online multiplayer gaming over Game Center.

With online multiplayer Game Center games, players can enjoy playing your game with other real-life people, which can help increase the popularity of your game. Besides the bump in popularity, playing games with other humans is a lot of fun. So, if your game lends itself to player versus player gameplay, consider adding multiplayer functionality—even if it means a little more work on your part.

In Game Center, there are two types of multiplayer games: real-time and turn-based. In both cases, players can invite friends or participate in an auto-matched game with random players. In this chapter, you’ll focus on auto-matched, turn-based gaming, which the following images depict:

images/CreatingMultiplayerGamesWithGameKit/multiple-games.png

An auto-matched game occurs when Player A attempts to start a new online game. If there’s already a game started by another player (Player B), and that game is looking for a spot to fill, then Player A will join Player B’s game, which is already in progress. Additionally, players can have more than one multiplayer Game Center game active at any given time. The beauty of turn-based gaming is that players don’t have to be connected to the Game Center during the entire game; they need to connect only when it’s their turn.

Hog Dice already has what it needs to play solo games against a primitive AI system. The game also has the functionality it needs to play games against another local player on the same device. Your job is to extend this multiplayer capability to allow players to play against other Game Center players.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset