Google Play Games - Leaderboard & Achievements

1

Stats

6,759 visits, 11,385 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 11 May, 2014. Last updated 19 Feb, 2019

IMPORTANT

CocoonJS is not longer available! Please switch to cocoon.io. You will find guides here.

CocoonIO - Guides

OUTDATED

Hi guys,

I will show you how to setup the new Google Play Games features inluding in the latest beta version of C2.

But first i want to apologize for my bad english, but i will give my best to make it understandable.

Download Tutorial as PDF

CocoonJS - Guide (PDF)

#Demo capx file (new version)

C2 - Leaderboard Basement

Google Play Developer Account

You need an account at Google Play Developer Console and you need to upload your game first before you can add a leaderboard or achievements.

Life-Demo: https://play.google.com/store/apps/details?id=com.supermarioclone.wdbase

If you don't know how to set it up in the Google Play Store check out my Docs for my customers.

Checkout Docs

Leaderboard

Note:

*The plugin is very buggy at the moment.

*This only works if you have at least the personal license of C2

*You need a free premium account at Ludei's Cloud Compiler

*You need the latest Beta version or you have to update manually

Known Bugs:

- Auto login on Startup ("request login" action is pointless at the moment, but ludei is aware of this issue and they try to locate and fix it.)

- Full-Screen Ads Bug (About to be fixed)

First you have to add the "CocoonJSAds" plugin to your project (you also need the browser plugin)

Go to the project bar and choose the CocoonJSAds object and enable Google Play Games in the properties bar.

Add following global variables to your event sheet. (Every achievement has his own ID)

Then create a new sprite and call it "btn_leaderboard" (or like you want :P) and add the instance variable (boolean) "IsLoggedIn" to it.

Switch to your event sheet and setup this function. It's really important to use the "isonCocoonJS" condition.

Now we will setup the achievements. This is a really simple "code". If the player reachs the needed point level the achievement will be unlocked. Then the "Achievement" variable will be increased by 1. This will unlock the next achievement.

Now you just have to set up the events and actions for your point system. If you want a complete game basement with In-App Purchase, Google Leaderboard & Highscore, check out this link. Otherwise download the Demo.capx file.

Support

If you need help or if you've found any issues, feel free to comment this tutorial. Thanks a lot :)

  • 0 Comments

Want to leave a comment? Login or Register an account!