1
votes

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

Here are my questions!

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"]; "

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!

1
possible duplicate of Game Center in IOS 7 leaderboard - Wyetro
Ok Wyatt! I will try to implement your version and tell you how it goes - David Muldarov
OK Wyatt, I created new objective C file name it GCHelper and added it to my file. Then I copied your GCHelper.h and GCHelper.m from Game Center in IOS 7 leaderboard – Wyatt Mufson and pasted them into my GCHelper.h and m but when I build and run player doesn't get authenticated! Do I need to do something additional like add a navigation View Controller? - David Muldarov
I authenticate in the app delegate - Wyetro
What code do you put there? - David Muldarov

1 Answers

1
votes

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];