!function(){function e(e,n){function r(){}r.prototype=n.prototype;e.superClass_=n.prototype;e.prototype=new r;e.prototype.constructor=e;return e}function n(e,n){for(var r in n){{n[r].bind(e)}gmx_foreach(r.split(","),function(t){switch(t){case"loading":case"loaded":break;case"keydown":case"keyup":break;case"acceleration":break;default:qyengine.EventsOnQyObj.indexOf(t)>=0?e.selfListen(t,n[r]):e.spriteListen(t,n[r])}})}}function r(e,r){var t=qyengine.guardType(r);if(t){var o=t.baseType,i=t.evHandlers,c=t.defaultOpt;o&&o.call(this,qyengine.merge(c,e));i&&n(this,i)}}function t(e,n,r){n||(n=r&&r.layer?qyengine.guardId(r.layer):e.layerName?qyengine.guardId(e.layerName):current_scene.defaultLayer);e.layer=n;var t=e.currentSprite;if(t){var o;o=0;n.addChild(t,o);t&&!t.started&&t.start&&t.start()}}function o(e,n){var r=window.current_scene,t=qyengine.guardType(e);if(!t)return r;r&&r.destroy();r=new t(n);cc.director.runScene(r);r.dispatchEvent("create");return r}window.current_game||(window.current_game={});window.gmx_||(window.gmx_={});window.qyengine||(window.qyengine={});qyengine.cloneObject=window.cloneObject=function(e){if(!e)return e;var n=typeof e;if("object"==n){if(e.clone)return e.clone();var r=e instanceof Array?[]:{};for(var t in e)r[t]=cloneObject(e[t]);return r}return e};qyengine.merge=function(e,n){var r=null!=e?qyengine.cloneObject(e):{};if(!n||"object"!=typeof n)return r;for(var t in n)n.hasOwnProperty(t)&&(void 0==r[t]?r[t]=n[t]:r[t]instanceof Array?array_extend(r[t],n[t]):"object"==typeof r[t]&&"object"==typeof n[t]?qyengine.addToObj(r[t],n[t]):r[t]=n[t]);return r};qyengine.define_type=function(n,t,o,i,c){if(i instanceof Array){c=i;i=null}var a=qyengine.guardType(n);a=e(a,t);gmx_[n]=a;a.baseType=t.prototype.ctor;a.defaultOpt=o;a.evHandlers=i;a.prototype.classId=n;a.prototype.init_=r;a.classId=n;window[n]=a;if(c){c.sort(function(e,n){return e[0]>=n[0]?1:-1});a.prototype.stepDefs_=c;a.prototype.stepMax_=c[c.length-1][0]+1}};qyengine.guardType=function(e){if("string"!=typeof e)return e;var n=gmx_[e];n||console.log("type "+e+" is not defined.");return n};qyengine.addToObj=function(e,n){if(!e||"object"!=typeof e)return n;if(!n||"object"!=typeof n)return e;for(var r in n)n.hasOwnProperty(r)&&(void 0==e[r]||"object"!=typeof e[r]||"object"!=typeof n[r]?e[r]=n[r]:qyengine.addToObj(e[r],n[r]));return e};qyengine.guardId=function(e){var n=window[e];n||console.log("id "+JSON.stringify(e)+" is not defined.");return n};qyengine.switchScene=function(e,n){o(e,n)};qyengine.createInstance=function(e,n,r){var o=qyengine.guardType(e.type);if(!o)return null;var i=new o(e),c=e.id;c&&(window[c]=i,i.id=c);t(i,n,e);r||e.no_c_d_evt||i.dispatchEvent("create");return i}}();!function(){qyengine.reset=function(){window.current_scene&&current_scene.destroy();current_game.director&&current_game.director.popScene();!qyengine.audioUnlocked&&qyengine.unlockAudio_&&unlockAudio();qyengine.preloadedScenes={};qyengine.preloadedSounds={}};qyengine.start=function(e){qyengine.reset();e||(e=window.json||window.gamejson);window.gamejson=e;qyengine.preloadLoadingScene(e)};qyengine.preloadLoadingScene=function(){cc.LoaderScene.preload(current_game.sceneRes[current_game.start_scene].files,function(){qyengine.switchScene(current_game.start_scene)},this)}}();