Using Game Center in Cocos 2dx project

Using Game Center in Cocos 2dx project
0.0 0


Ive made a game and i just want a global leader board of scores using Game Center and the GameKit framework.

I know you have to call the objective c code through a class that allows mixing of C++ and objective c.

Im just looking for a full tutorial in how to do it all. I cant find it anywhere.

Any help would be great thanks!


You can call Objective-C code in any C++ file, just make sure the file type is set to “Objective-C++” in Xcode. Then you just start calling the GameKit functions as described in the Apple docs. It should just work without you having to do anything special.

There are a few gotchas regarding queuing up leaderboard and achievement requests and processing them in sequence, but it’s all described very well in the Apple documentation so I suggest you have a read through that.