Jet Rush

1. Link to the api from the index
<script type="text/javascript" src="//lagged.com/api/v2/lagged_dev.js?v=1"></script>
<script type="text/javascript" src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
2. Call the init function on the menu or after everything is loaded
LaggedAPI.init('jet_rushgma_inints','lagdevaF3001');

High Scores (submit on game over)

3. To call a high score just replace SCORE_VAR (integer)
var boardinfo={};
boardinfo.score=SCORE_VAR;
boardinfo.board='jet_rushgm_hsrrbds';
LaggedAPI.Scores.save(boardinfo, function(response) {
if(response.success) {
console.log('high score saved')
}else {
console.log(response.errormsg);
}
});

Ads (call on game over)

4. to call an ad use the code below:
if(typeof prerollStart === 'undefined'){
console.log('skip ad, prerollStart not found');
}else{
LaggedAPI.APIAds.show('interstitial','jet-rush','jet-rush-game.png',function(response) {
if(response.success) {
console.log('ad done');
}else {
console.log('ad error, continue');
}
});
}

Testing

5. You can test the game locally or online