【发布时间】:2011-08-13 16:24:30
【问题描述】:
我已经在我的游戏中集成了游戏中心......它运行良好,但我现在遇到了新问题:P 只有一个分数是用户提交的.. 之后没有分数提交,甚至高于或低于发布的分数...... 知道我要做什么... 问候 哈西布
【问题讨论】:
标签: iphone ios4 iphone-sdk-3.0 ios-simulator cocos2d-iphone
我已经在我的游戏中集成了游戏中心......它运行良好,但我现在遇到了新问题:P 只有一个分数是用户提交的.. 之后没有分数提交,甚至高于或低于发布的分数...... 知道我要做什么... 问候 哈西布
【问题讨论】:
标签: iphone ios4 iphone-sdk-3.0 ios-simulator cocos2d-iphone
我用这个来提交分数......在确定游戏中心可用后......
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:gameCenterCategory] autorelease];
int64_t score1 =socre;
scoreReporter.value = score1;
[scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
if (error != nil) {
NSLog(@"Submit failed");
}
else {
NSLog(@"Score Submited");
}
}];
[pool release];
【讨论】: