Presenting Match GUI

We begin by first working with the standard matchmaking GUI provided to us by Apple. Start by first adding a new button to handle presenting the view on the main screen of our test game. I have also gone ahead and renamed the old Play button to Single Player, and created a new button called Multiplayer (see Figure 5–1). We will use the UFOViewController to act as the delegate for our matchmaking behavior, so set the view controller to conform to GKMatchmakerViewControllerDelegate. Additionally, modify the action method of the multiplayer button we just added to match the following code.

- (IBAction)multiplayerButtonPressed; {     GKMatchRequest *request = [[GKMatchRequest alloc] init];     request.minPlayers = 2;     request.maxPlayers ...

Get Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.