Skip to content

Instantly share code, notes, and snippets.

@minhlucvan
Last active April 27, 2017 04:51
Show Gist options
  • Save minhlucvan/ed5c71ced6b33ba795ba422e723fc590 to your computer and use it in GitHub Desktop.
Save minhlucvan/ed5c71ced6b33ba795ba422e723fc590 to your computer and use it in GitHub Desktop.
(function (Phaser, spilgameads) {
if( !Phaser || !spilgameads){
console.warn("HHAdsPlugin require Phaser and spilgameads.");
}
var HHAdsPlugin = function (game, parent, option) {
Phaser.Plugin.call(this, game, parent);
this.events = new Phaser.Signal();
};
HHAdsPlugin.prototype = Object.create(Phaser.Plugin.prototype);
HHAdsPlugin.prototype.constructor = Phaser.Plugin.SamplePlugin;
HHAdsPlugin.const = {};
HHAdsPlugin.const.REQUEST_REWARD_VIDEO = 'REQUEST_REWARD_VIDEO',
HHAdsPlugin.const.START_REWARD_VIDEO = 'START_REWARD_VIDEO',
HHAdsPlugin.const.STOP_REWARD_VIDEO = 'STOP_REWARD_VIDEO',
HHAdsPlugin.const.ENABLE_REWARD_VIDE0 = 'ENABLE_REWARD_VIDE0',
HHAdsPlugin.const.DISABLE_REWARD_VIDEO = 'DISABLE_REWARD_VIDEO'
HHAdsPlugin.prototype.update = function () {
//console.log('update from plugin');
}
HHAdsPlugin.prototype.eventHandler = function( event ){
}
HHAdsPlugin.prototype.enable = function(){
}
HHAdsPlugin.prototype.disable = function(){
}
HHAdsPlugin.prototype.playRewardVideo = function(){
}
// private functions
function requestRewardVideo(socket, data){
}
Phaser.Plugin.HHAdsPlugin = HHAdsPlugin;
}(Phaser, spilgameads));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment