Tutorial
Scirra has added the support of the Google Play Games plugin for Crosswalk/Phonegap to the latest beta version (beta r185) of Construct 2. This tutorial shows you how to set it up and how to use it in your HTML5 and your Android games using Intel XDK.
Google Play
Add the ‘Google Play’ Plugin to your project
Make sure that you are using at least the beta version r185 or higher. Otherwise the updated plugin isn’t included in the C2 editor.
Configure the Plugin
Now select the ‘Google Play’ Plugin in the project bar (left side of Construct 2 editor).
Then you’ll get all plugin properties at the left side.
You need to add the 3 ID’s under ‘Properties’.
- Application ID
- Client ID
- Client Secret
Find your ID’s
Application ID
For Android: https://play.google.com/apps/publish/
Go to ‘Google Play Developer Console’ – ‘Game Services’ – [specific app] – the Application ID is the number next to the game name (e.g. “My Super Game – 12345678”,. The Application ID in this case is 12345678.)
Client ID
In order to get this ID you need to connect your Game with your Play Service. Login to your Google Play Developer Console, click ‘Game Service’ and choose your Game.
- (1) – Click on ‘Game Service’ and choose your game.
- (2) – Click on ‘Associated Apps’ and add a new one.
- (3) – Select ‘Web’ platform.
- (4) – Enter your target URL where your game is located (Use the full path to it!).
- (5) – Click Save and proceed to the next step.
- (6) – Authorize your app
Add ‘www.’ to your URL. Otherwise you get an error. No further steps are needed. Just click ‘Create Client’.
As result you get your Client ID and your Secret ID.
- (7) – Copy the Cliend ID and insert it at the Google Play ‘Properties’ section.
- (8) – Visit the link to your API Console and copy your Secret ID and insert it at the Google Play ‘Properties’ section.
Test your game (Web App)
Now upload your game to the path you have entered (javascript origin) and open the link. Now you should be able to use it.
Demo: Zombie Resurrection
Note: It will take a while till your added Web Platform work. It’s normally that you get an error if you try it right after you have created it. Just give it a few hours. Then it will work.