实施游戏中心排行榜(iOS 7) [英] Implement a Game Center leaderboard (iOS 7)

查看:187
本文介绍了实施游戏中心排行榜(iOS 7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要开发Game Center的帮助! 我发现此开发人员网页 http://blog. lucaslouca.com/game-center-leaderboard-ios-7-app/#comment-3761 ,并需要一些帮助

I need help with developing Game Center! I found this developer web page http://blog.lucaslouca.com/game-center-leaderboard-ios-7-app/#comment-3761 and need some help with it

这是我的问题!

我叫大卫!我已经开发了游戏,就像飘扬的小鸟,我需要实现游戏中心!我有MyScene.m和MyScene.h,所以我了解最多7个步骤,但是不知道是否应该将这三个文件添加到我的游戏中,我不是经验丰富的游戏开发人员,需要一些帮助.我有几个问题:1)我是否必须将三个文件添加到自己的游戏中才能使游戏中心正常运行GameCenterManager.h GameCenterManager.m AppSpecificValues.h? 2)我到底应该把这段代码放在哪里? " //虚拟高分 NSUInteger _highscore = 1234;

Hi, my name is David! I have developed game, it is like flappy bird and I need to implement game center! I have MyScene.m and MyScene.h, so I understand steps up to 7, but don't know if I should add those three files to my game I am not experienced game developer and need some help. I have few questions: 1) Do I have to add thee three files to my own game in order for game center to work GameCenterManager.h GameCenterManager.m AppSpecificValues.h? 2) Where exactly I should put this code? " // Dummy Highscore NSUInteger _highscore = 1234;

//Sumbit highScore [_gameCenterManager reportScore:_highscore forLeaderboardID:@"1"]; "

// Sumbit highScore [_gameCenterManager reportScore: _highscore forLeaderboardID:@"1"]; "

在MyScene.m中?如果是的话,我可以把它放在-(id)initWithSize:(CGSize)size委托人:(id)代表州:(GameState)州 或在-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event中(我为游戏中心创建了按钮,并在触摸中开始调用该方法). 3)我应该在我的Scene.m或View Controller.m中将此委托方法-GKGameCenterControllerDelegate(第9步)放在哪里? 有关常规信息:我的游戏中只有一个UIView Controller,即视图控制器.场景通过"switch"方法进行导航,每个场景都是游戏状态之类的东西,例如GameStateMainMenue或GameStatePlay等.谢谢您的帮助!

in MyScene.m? if yes can I put it in -(id)initWithSize:(CGSize)size delegate:(id)delegate state:(GameState)state or in -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event (I have created button for game center and called the method in touches began). 3) Where should I put this delegate method - GKGameCenterControllerDelegate (Step 9) in My Scene.m or in View Controller.m? For general info: I have only one UIView Controller in my game which is view controller. the scenes are navigated by "switch" method, each scene is game state something, of example GameStateMainMenue or GameStatePlay and so on. Thank you for your help!

推荐答案

要为排行榜创建必要的代码,请参见此处: IOS 7页首横幅中的游戏中心

To create the necessary code for a leaderboard see here: Game Center in IOS 7 leaderboard

要验证用户身份,您需要以下代码:

To authenticate the user you need this code:

[[GCHelper sharedGameKitHelper] authenticateLocalPlayer];

这篇关于实施游戏中心排行榜(iOS 7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆