是否有任何完整的教程,包含示例代码,使用OpenFeint和Cocos2D?
我在cocos2d中总是收到失败,但是当我在基于视图的应用程序中运行此项目时,它会给我成功,并且分数将很容易提交
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error){
if (error ==nil) {
NSLog(@"Success");
} else {
NSLog(@"Fail");
}
}];
GKScore *myScoreValue = [[[GKScore alloc] initWithCategory:@"123"] autorelease];
myScoreValue.value = lastScore;
[myScoreValue reportScoreWithCompletionHandler:^(NSError *error){
if(error != nil){
NSLog(@"Score Submission Failed");
} else {
NSLog(@"Score Submitted");
}
}];
Run Code Online (Sandbox Code Playgroud)