Download GameBreakBeta.js

Download the gameBreakBeta.js file using the following link: Download GameBreakBeta.js

Setup Ads

Add the following line to your index.html file:

<script src="gameBreakBeta.js"></script>

If you are an AFP partner, replace the AdSense ID and set activateAFP to true in the gameBreakBeta.js

var AdsenseId = "YOUR_ADSENSE_ID";
var activateAFP = true;

If you are not an AFP partner, replace the Channel ID and Set activateAFP to false

var ChannelId = "YOUR_CHANNEL_ID";
var activateAFP = false;

Contact us if you want to become an AFP partner or if you need a Channel ID.

Display Ads

// show interstitial ads.
nextAds();

// show rewarded ads.
showReward();

// Pause the game.
pauseGame()

//Resume the game.
resumeGame() 

//Trigger rewards after completing an ad.
rewardAdsCompleted() 

//Call if no rewarded ads are available.
NoRewardedAdsTryLater()

//Trigger if the user cancels the rewarded ad.
rewardAdsCanceled() 

Testing

// Set testAdsOn to false when the game is ready to go live
var testAdsOn = true;

Example

Call nextAds() when you want to display ads like between game stages.

Remember to pause the game (including sounds) by using pauseGame() before displaying ads.

Use resumeGame() to resume the game.

function pauseGame()
{
	console.log("pauseGame");
}

function resumeGame()
{
	console.log("resumeGame");
}