-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDDGameKitHelperDelegate.m
More file actions
30 lines (24 loc) · 908 Bytes
/
DDGameKitHelperDelegate.m
File metadata and controls
30 lines (24 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
// DDGameKitHelperDelegate.h
// Version 1.0
#import "DDGameKitHelperDelegate.h"
#import "GKAchievementHandler.h"
@implementation DDGameKitHelperDelegate
// return true if score1 is greater than score2
// modify this if your scoreboard is reversed (low scores on top)
-(bool) compare:(int64_t)score1 to:(int64_t)score2
{
return score1 > score2;
}
// display new high score using GKAchievement class
-(void) onSubmitScore:(int64_t)score;
{
[[GKAchievementHandler defaultHandler] notifyAchievementTitle:@"New High Score!!!" andMessage:[NSString stringWithFormat:@"%d", score]];
}
// display the achievement using GKAchievement class
-(void) onReportAchievement:(GKAchievement*)achievement
{
DDGameKitHelper* gkHelper = [DDGameKitHelper sharedGameKitHelper];
[[GKAchievementHandler defaultHandler] notifyAchievement:[gkHelper getAchievementDescription:achievement.identifier]];
}
@end