(function() { "use strict"; var Libs = function(canvas) { this.initialize(canvas); } var p = Libs.prototype; p.canvas = null; p.kongregate = null; p.playAsGuest = false; p.initialize = function(canvas) { this.canvas = canvas; } p.loadLibs = function() { this._loadKongregate(); } p.submitScore = function(score) { if (this.kongregate) { if (!this.playAsGuest && this.kongregate.services.isGuest()) { this.kongregate.services.showRegistrationBox(); this.playAsGuest = true; } this.kongregate.stats.submit("best_score", score); } } p._loadKongregate = function() { if (typeof(kongregateAPI) === 'undefined') return; var _this = this; kongregateAPI.loadAPI(function() { _this._onLoadKongregate(); }); } p._onLoadKongregate = function() { this.kongregate = kongregateAPI.getAPI(); } window.Libs = Libs; }());