4. Add Logo

// the API logo Object extends Display Object and can be handled as such// it already has its click handler from GameAPI implementedvar logo:Logo = GameAPI.getInstance().Branding.getLogo();
logo.x = stage.width-250;addChild(logo);

5. Add Promotional Buttons

Promotional Buttons are buttons that the players can click and lead to the mobile app of the game, social media of the game, offered more games or to other games of your game series. The table below sums up the possibilities. Of course you can create your own (Facebook,twitter) in coordination with your Spil Game Producer.

Button

Shall I include it to my game?

Code tag

More games

Yes

more_games

App Store

If the game is also on App Store

app_store

Google Play

If the game is also on Google Play

google_play

Facebook

If the game has a link to a Facebook page

facebook_like

Twitter

If the game is also on Google Play

twitter_share

My game 1

If your game is a part of a game series, make buttons to link to the rest of your games for example: Snail Bob 1, Snail Bob 2, Snail Bob 3 and so on or
Let’s Fish 1, Let’s Fish 2 or
König der Türme 1, König der Türme 2.

Note: The tags should be all lower case. Do not use special characters or apostrophes even if it’s part of the title.

my_game_X

for example: snail_bob_1,
snail_bob_2 or
lets_fish_1,
lets_fish_2 or
konig_der_turme_1,
konig_der_turme_2

//for more games button you have to create an image yourself//when the button is pressed you can trigger with the call below
GameAPI.getInstance().Branding.getLink("more_games").action();

// if your game has promotional links set up in Spil Games backend with// images configured, you can use the GameAPIBtn class just like the API logovar appstore:Sprite = GameAPI.getInstance().Branding.getLink("app_store");
appstore.x = stage.width-250;
appstore.y = 100;addChild(appstore);

// if your game don't have images for a promotional button set on Spil Games backend// you can still trigger its action by calling it directly, similar to more games button
GameAPI.getInstance().Branding.getLink("app_store").action();

6. Game breaks request

During a natural pause in the game flow such as a level change you can add the GameBreak.request call. When a GameBreak is accepted from our side, we are able to pause the game and display external content such as in-game ad, game suggestions or walkthroughs. We make sure that users aren’t exposed to too much advertising and get the most relevant ads.

The call requires two arguments, a method to pause the game and another to resume it. This is in order to ensure that the game will not continue its flow if there is content displayed on top of it. Keep in mind that the resume method will always be called by the API where the pause will only be triggered if there is actual content to be displayed.

import com.spilgames.gameapi.GameAPI;

//Before calling the GameAPI.GameBreak.request method the API must be loaded and ready for use

// This method will be called only if there is content to be displayed on top of the gameprivatefunction pauseGame():void{// add here the logic to stop the game flow, sound and animations}

// This method will always be calledprivatefunction resumeGame():void{// add here the logic to resume the game flow, sound and animations}

7. Send Scores

// make sure that GameAPI is initialised and readyif(GameAPI.getInstance().isReady){
GameAPI.getInstance().Score.submit(100);}

8. Grant Awards

In order to grant awards for a player in Spil Games’ network it is necessary to submit a tag for each award. The tags that are acceptable from Spil Games back-end are award1, award2, award3 and so on. The Spil game producer that you are in contact will make sure that these tags match your awards. The tag should be passed as a String parameter to the method call.

import com.spilgames.gameapi.GameAPI;

// make sure that GameAPI is initialised and readyif(GameAPI.getInstance().isReady){// Grant the first award of your game like the example below.
GameAPI.getInstance().Award.submit("award1");}

9. Testing your integration

Once you’ve finished implementing all the required features for your game you can test it on the TEST TOOL and remember to place your GAME ID at the end of the URL to get the correct configurations. Make sure that you meet our requirements before you send us your final build for QA.