Google Play Game Services and Cocos2dx

I'll publish a more comprehensive post on this at some point as I've just manage to get Google Play Game Services leaderboards and achievements working in my Cocos2dx game.

It's not that straight forward, but here are a few pointers:

1) Follow this tutorial:

The instructions for setting up the helpers etc worked perfectly for me.

So in the end, your game will be extending:

 public class YourGame extends BaseGameActivity

rather than

public class YourGame extends Cocos2dxActivity

2) This bit isn't obvious - you need to link your app twice under Linked Apps in Google Play Developer Console one for debug, and one for release.

For the debug one, get the key from Eclipse: Preferences > Android > Build.

For the release one, the easiest way is to create an APK in the usual way in Eclipse - it will tell you the key when you publish.

3) Use EasyNDK to call the Java API from C++. It's the same library that I use to call Admob ads from C++. Have a look at this post:

No comments:

Post a Comment