Game Development Reference
In-Depth Information
(void)browserViewControllerDidFinish:(MCBrowserViewController
*)browserViewController {
// The MCSession is now ready to use.
[self dismissViewControllerAnimated:YES
completion:nil];
if (self.gameScene)
{
[self.gameScene startGame];
}
}
-
(void)browserViewControllerWasCancelled:(MCBrowserViewController
*)browserViewController{
// The user cancelled.
[self dismissViewControllerAnimated:YES
completion:nil];
if (self.gameScene)
{
[self.gameScene discardSession];
}
}
In both the delegate methods, first the MCBrowserViewController is dis-
missed and GameScene is informed to change accordingly.
Now when both the device players click on the screen, MCBrowserViewController
opens and the players try to connect to each other using the default behavior provided by
this controller, and when done we show the appropriate text to the player. Hence this en-
tire implementation accomplishes our starter kit of this chapter.
Search WWH ::




Custom Search