Game Development Reference
In-Depth Information
You can also clear the local player's achievement progress. Do this with great care and
not without asking the player's permission. On the other hand, during development, the
resetAchievements method in Listing 14-18 comes in handy.
Listing 14-18 . ResettingAchievement Progress
-(void) resetAchievements
if (isGameCenterAvailable == NO)
[achievements removeAllObjects];
[GKAchievement resetAchievementsWithCompletionHandler:←
^(NSError* error)
[self setLastError:error];
BOOL success = (error == nil);
if ([delegate respondsToSelector:@selector(onResetAchievements:)])
[delegate onResetAchievements:success];
Now we enter the realm of matchmaking—connecting players and inviting friends to
play a game match together. To start hosting a game and to bring up the corresponding
matchmaking view, I've added a call to GameKitHelper 's showMatchmaker-
WithRequest method after the achievements view has been dismissed, as shown in
Listing 14-19 .
Listing 14-19 . Preparing to Show the Host Game Screen
-(void) onAchievementsViewDismissed
Search Nedrilad ::

Custom Search