SDKBOX GPG How to submit a new high score?

Hi,

New to SDKBOX, and finally Got it compiling.

I just want to do a simple submit a score to the high score table (google leaderboard).

The Sample Project is quite large and I couldn’t see where the _ game_services was set up or how to make it.

 void LeaderboardScene::ldbSubmitScore(cocos2d::Ref *sender)
{
    if ( _game_services ) {
        // submit score has no result callback.
        _game_services->Leaderboards().SubmitScore("CgkI6KjppNEWEAIQAg", 15001);
        _txtStat->setString( "Score submitted" );
    }
}

Looking at the code that SDKBOX has added to my project I see a

sdkbox::PluginGPG::init();

I tried something like

GameServices * gpg = sdkbox::PluginGPG::gpg();
gpg->SubmitScore("CgoilkvT_49SDJDGQAA", 101);

But got lots of errors, really some kind of how to and api reference would be great!

But the GPG API is a little bit empty

And the C++ SDKBOX GPG Document links to Google’s Java API for leaderboards.

Can someone help please?

thanks

LB

Sorry about the confusion about the documentation, we’ll improve it to make it more clean and clear. GPG requires a lot of documentation and it’s on going.

Do you just want to use leaderboard and achievements? or you want to implement things like cloud save and multiplayer as well?

  • If you just want to use leaderboard and achievements, I would recommend using sdkboxplay since it will be way easier.

  • If you want to use the features like cloud save, and multiplayer then you should use gpg.

Regarding how to get google play service. check out this sample