I’ve looked around but I can’t really figure it out.
I found this but I’m getting linker errors on the GKAchievementViewController part
I tried this and made a mixed Obj-C C++ class but I get tons of errors like unknown types (but are valid in C++)
The linker problems was because I haven’t added GameKit.framework in the project and the unknown type problem is because I am importing the cocos2d.h file ( which is a C++ file ) into an Obj-C file.
Adding Game Center requires a bit of knowledge in Objective-C as well as wrapping it on a C*+ class.
I don’t have the time right now but here are some places you might want to look at: http://ganbarugames.com/2011/07/cocos2d-game-center/
Just wanted to add another resource for dealing with Game Center that I have found specially helpful. It is in Japanese, but you just need to add the code that is told.
Thanks for the link. I’m wondering what cocos2d-x team members think about including such things as GameCenter wrapped around with cocos2d-x c++ method for easier use. GameCenter etc. seems like something very common to implement in cocos2d-x games so I think it would be nice if cocos2d-x had some methods for this for easier use.
Yes, that is true. But I don’t see a problem to make the wrapper in such way that it just do nothing on other platforms which do not support GameCenter.