var e,t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},t(e,n)};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function n(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}function i(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{p(i.next(e))}catch(e){r(e)}}function a(e){try{p(i.throw(e))}catch(e){r(e)}}function p(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}p((i=i.apply(e,t||[])).next())}))}function o(e,t){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){s.label=r[1];break}if(6===r[0]&&s.label<o[1]){s.label=o[1],o=r;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(r);break}o[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}!function(e){var t,n,r={},s={},a={},p={},h={},c={};function u(e){if(p[e])return new Promise((function(e){e()}));if(h[e])return h[e];var t=function(e){var t=f(e);if(!t)return null;if(t.atlas){var n=[e+".json"];return t.keys&&(n=n.concat(t.keys.split(",").filter((function(e){return".png"!=e.substr(-4)})))),n}return t.keys?t.keys.split(","):null}(e);if(!t||!t.length)return p[e]=!0,new Promise((function(e){e()}));var n=new Promise((function(n,i){!function(e,t){var n=0,i=t.length;i||e(!0);for(var o=!0,r=0;r<i;r++){l(t[r],(function(t,r){t||(o=!1),++n==i&&e(o)}),this)}}((function(t){delete h[e],t?(p[e]=!0,n()):i()}),t)}));return h[e]=n,n}function l(t,n,i){var o=t.substring(t.lastIndexOf(".")+1,t.length);if("png"==o||"jpg"==o){var a=r[t]||FYGE.TextureCache[t];if(a)return n&&n.call(i,a,t),new Promise((function(e){e(a)}));if(c[t])return y(t,n,i);if((m=g(t))&&"jpg"!=o){var p=f(m);if(p&&p.atlas){var h=m+".json";return c[h]?c[h].then((function(e){var o=r[t]||FYGE.TextureCache[t];return n&&n.call(i,o,t),o}),(function(){return n&&n.call(i,null,t),null})):l(h).then((function(){var e=r[t]||FYGE.TextureCache[t];return n&&n.call(i,e,t),e}),(function(){return n&&n.call(i,null,t),null}))}}var u=m?e.resPath+m+"/"+t:t,d=new Promise((function(e,o){FYGE.GlobalLoader.loadImage((function(s,a){if(delete c[t],s){var p=FYGE.Texture.from(a);r[t]=p,FYGE.Texture.addToCache(p,t),n&&n.call(i,p,t),e(p)}else n&&n.call(i,null,t),o()}),u)}));return c[t]=d,d}if("svga"==o){if(s[t])return n&&n.call(i,s[t],t),new Promise((function(e){e(s[t])}));if(c[t])return y(t,n,i);u=(m=g(t))?e.resPath+m+"/"+t:t,d=new Promise((function(e,o){SvgaParser.loadSvga(u,(function(o){delete c[t],s[t]=o,n&&n.call(i,o,t),e(o)}),(function(e){delete c[t],n&&n.call(i,null,t),o(e)}))}));return c[t]=d,d}if("json"==o){if(c[t])return y(t,n,i);var m;u=(m=g(t))?e.resPath+m+"/"+t:t,d=new Promise((function(e,o){var s=f(m).atlas;FYGE.GlobalLoader.loadImage((function(a,p){if(a){var h=FYGE.createTextureSheet(new FYGE.BaseTexture(p),s);for(var u in h)r[u]=h[u];n&&n.call(i,h,t),e(h)}else delete c[t],n&&n.call(i,null,t),o()}),u.replace("json","png"))}));return c[t]=d,d}}function d(e){if(!e)return null;var t=e.substring(e.lastIndexOf(".")+1,e.length);return"png"==t||"jpg"==t?r[e]||FYGE.TextureCache[e]||null:"svga"==t?s[e]||null:"mp3"==t?a[e]||null:void 0}function g(e){for(var n=0;n<t.groups.length;n++){var i=t.groups[n],o=i.keys;if(o&&o.split(",").indexOf(e)>-1)return i.name;if(i.atlas&&i.name+".json"==e)return i.name}return null}function f(e){for(var n,i=t.groups,o=0;o<i.length;o++)if(i[o].name===e){n=i[o];break}return n}function y(e,t,n){return c[e].then((function(i){t&&t.call(n,i,e)}),(function(){t&&t.call(n,null,e)})),c[e]}function m(e,t){if(void 0===t&&(t=n),!t||!t.children||!t.children.length)return null;for(var i=0;i<t.children.length;i++){var o=t.children[i];if(o.name==e&&("container"==o.type||"item"==o.type))return o;var r=m(e,o);if(r)return r}return null}function v(e){var t;switch(e.type){case"container":t=new FYGE.Container;break;case"button":t=new FYGE.Button(d(e.props.tUp),e.props.tDown?d(e.props.tDown):null,e.props.tDisable?d(e.props.tDisable):null);break;case"text":for(var n in t=new FYGE.TextField,e.props)t[n]=e.props[n];break;case"sprite":t=new FYGE.Sprite(d(e.props.source));break;case"rect":(t=new FYGE.Shape).beginFill(FYGE.string2hex(e.props.fillColor)),t.drawRect(0,0,e.props.width,e.props.height),t.endFill()}return t.name=e.name,t.alpha=e.alpha||1,t.position.set(e.x,e.y),t}e.loadConfig=function(n){t=n,e.resPath=n.path},e.loadGroup=u,e.getResAsync=l,e.getResByUrl=function(){},e.getRes=d,e.loadAllGroup=function(){var e=t.groups,n=[];return e.forEach((function(e){n.push(u(e.name))})),Promise.all(n)},e.loadAllGroupForProgress=function(){var e=this;return new Promise((function(n){var r=t.groups,s=0;r.forEach((function(t){return i(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,u(t.name)];case 1:return e.sent(),s++,ie.dispatchEvent("loadPer",s/(r.length-1)),s==r.length-1&&n(0),[2]}}))}))}))}))},e.loadSkinConfig=function(e){n=e},e.initSkinDisplay=function e(t,n,i){var o="string"==typeof n?m(n):n;if(o.children&&o.children.length)for(var r=0;r<o.children.length;r++){var s=o.children[r];if("item"!=s.type){var a=t.addChild(v(s));i&&s.id&&(i[s.id]=a),"container"==s.type&&e(a,s,i)}}},e.getSkinDataByName=m,e.destroyGroup=function(e){var t=f(e);if(t){var n=[];t.keys&&(n=t.keys.split(","));for(var i=[],o=0;o<n.length;o++){var s=d(n[o]);s&&(-1==i.indexOf(s.baseTexture)&&(s.baseTexture.destroy(),i.push(s.baseTexture)),s.destroy()),delete r[n[o]]}}}}(e||(e={}));var r,s,a,p,h,c,u=!1,l=function(e){!function(){if(!u){u=!0;var e=new g;s=b.topLayer,r=e;var t=(b.stageWidth-160)/2,n=(b.stageHeight-r.height)/2;r.x=b.stageOffsetX-s.x+t,r.y=b.stageOffsetY-s.y+n;var i=(new FYGE.Graphics).beginFill(0).drawRect(-t,-n,b.stageWidth,b.stageHeight).endFill();i.alpha=0,r.addChildAt(i,0)}}(),r.show(e),s.addChild(r)},d=function(){s.removeChild(r)},g=function(t){function i(){var n=t.call(this)||this,i=e.getRes("waitingBg.png"),o=new FYGE.Sprite(i);n.addChild(o);var r=e.getRes("waitingRot.png"),s=new FYGE.Sprite(r);s.x=(i.width-r.width)/2,s.y=47,s.anchorX=r.width/2,s.anchorY=r.height/2,n.addChild(s);var a=0;return s.addEventListener(FYGE.Event.ENTER_FRAME,(function(){++a%30==0&&(s.rotation+=45)}),n),n.msg=new FYGE.TextField,n.msg.y=125,n.msg.textWidth=i.width,n.msg.textAlign=FYGE.TEXT_ALIGN.CENTER,n.msg.size=26,n.msg.fillColor="#ffffff",n.addChild(n.msg),n}return n(i,t),i.prototype.show=function(e){void 0===e&&(e="加载中"),this.msg.text=e},i.prototype.destroy=function(){t.prototype.destroy.call(this),this.msg=null},i}(FYGE.Container),f=!1,y=function(e){!function(){if(!f){f=!0,a=new m,p=b.toastLayer,a.alpha=0,a.x=b.stageOffsetX-p.x+(b.stageWidth-a.width)/2;var e=a.height,t=b.stageOffsetY-p.y;h=t-e,c=t+(b.stageHeight-e)/2}}(),a.show(e),p.addChild(a),FYGE.Tween.removeTweens(a),FYGE.Tween.get(a).set({y:h,alpha:1}).to({y:c},500,FYGE.Ease.quartOut).wait(800).to({alpha:0},300).call((function(){p.removeChild(a)}))},m=function(t){function i(){var n=t.call(this)||this;n.PADDING=40,n.mouseChildren=!1,n.mouseEnable=!1;var i=e.getRes("toastBg.png");return n.bg=new FYGE.Sprite(i),n.addChild(n.bg),n.msg=new FYGE.TextField,n.msg.size=28,n.msg.fillColor="0xffffff",n.msg.text="",n.msg.verticalAlign=FYGE.VERTICAL_ALIGN.MIDDLE,n.msg.textHeight=i.height,n.msg.textAlign=FYGE.TEXT_ALIGN.CENTER,n.addChild(n.msg),n}return n(i,t),i.prototype.show=function(e){this.msg.text=e,this.msg.x=(this.bg.width-this.msg.textWidth)/2},i.prototype.destroy=function(){FYGE.Tween.removeTweens(this),t.prototype.destroy.call(this),this.msg=null,this.bg=null},i}(FYGE.Container),v=function(){function e(){this.stacks=[]}return Object.defineProperty(e,"instance",{get:function(){return e._instance||(e._instance=new e)},enumerable:!1,configurable:!0}),e.prototype.init=function(e){this._parent=e;var t=new FYGE.Shape;t.beginFill(0),t.drawRect(b.stageOffsetX-e.x,b.stageOffsetY-e.y,b.stageWidth,b.stageHeight),t.endFill(),t.hitTestByPixel=!1,t.visible=!1,this._parent.addChild(t),this._bg=t},e.prototype.closeAll=function(){this.stacks.forEach((function(e){return e.hidePanel()}))},e.prototype.show=function(e,t){var n=this;l();var i=new e(t);return this.add(i),this.stacks.push(i),i.onLoaded=function(){i.y=-(1624-b.stageHeight>>1),d(),n.updateView(!1),i.start(t),i.visible&&i.showAni()},i.onLoadError=function(){d(),y("资源加载失败"),i.removeEventListener("onDestroy",n.onPanelHide,n),n.remove(i)},i},e.prototype.updateView=function(e){var t=this;void 0===e&&(e=!0),this.stacks.length?(this._parent.visible=!0,"hide"==this.bgAni&&(this.bgAni="show",FYGE.Tween.removeTweens(this._bg),this._bg.alpha=.7),!1===this._bg.visible&&(this._bg.visible=!0,this._bg.alpha=0,FYGE.Tween.get(this._bg).to({alpha:.7},200,FYGE.Ease.cubicOut))):this._bg.visible&&(this.bgAni="hide",FYGE.Tween.removeTweens(this._bg),FYGE.Tween.get(this._bg).to({alpha:0},200,FYGE.Ease.cubicOut).call((function(){t._bg.visible=!1,t._current=null,t._parent.visible=!1})));for(var n=0;n<this.stacks.length;n++)n<this.stacks.length-1?this.stacks[n].visible=!1:(this.stacks[n].visible=!0,e&&this.stacks[n].showAni(),this._current=this.stacks[n])},e.prototype.add=function(e){this._parent.addChild(e),e.addEventListener("onDestroy",this.onPanelHide,this)},e.prototype.remove=function(e){this._parent.removeChild(e),this.stacks=this.stacks.filter((function(t){return t!=e}))},e.prototype.onPanelHide=function(e){var t=e.target;t.removeEventListener("onDestroy",this.onPanelHide,this),this.remove(t),this.updateView()},Object.defineProperty(e.prototype,"currentPanel",{get:function(){return this._current},enumerable:!1,configurable:!0}),e.prototype.closeCurrent=function(){this._current&&this._current.hidePanel()},e.prototype.destroy=function(){e._instance=null,this.stacks=null,this._current=null,this._parent=null,FYGE.Tween.removeTweens(this._bg),this._bg=null},e}(),w=function(){function e(){}return Object.defineProperty(e,"instance",{get:function(){return e._instance||(e._instance=new e)},enumerable:!1,configurable:!0}),e.prototype.init=function(e){this._parent=e},e.prototype.change=function(e,t){var n=this,i=new e(t);i.visible=!1,l();var o=this._currentScene;i.onLoaded=function(){d(),i.showAni((function(){o&&o.destroy()})),i.visible=!0,i.start(t)},i.onLoadError=function(){d(),y("资源加载失败"),n._currentScene=o||null,n._parent.removeChild(i)},this._currentScene=i,this._parent.addChild(i)},Object.defineProperty(e.prototype,"currentScene",{get:function(){return this._currentScene},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){e._instance=null,this._currentScene=null,this._parent=null},e}(),b=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.init=function(e){e.addChild(this);for(var t=["_bottomLayer","_sceneLayer","_popupLayer","_toastLayer","_topLayer","_shareLayer"],n=0;n<t.length;n++)this[t[n]]=new FYGE.Container,this.addChild(this[t[n]]);this.shareLayer.y=-this.stageOffsetY,w.instance.init(this.sceneLayer),v.instance.init(this.popupLayer)},Object.defineProperty(t.prototype,"bottomLayer",{get:function(){return this._bottomLayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sceneLayer",{get:function(){return this._sceneLayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"popupLayer",{get:function(){return this._popupLayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toastLayer",{get:function(){return this._toastLayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topLayer",{get:function(){return this._topLayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shareLayer",{get:function(){return this._shareLayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stageHeight",{get:function(){return this.stage?this.stage.viewRect.height:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stageWidth",{get:function(){return this.stage?this.stage.viewRect.width:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stageOffsetX",{get:function(){return this.stage?this.stage.viewRect.x:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stageOffsetY",{get:function(){return this.stage?this.stage.viewRect.y:0},enumerable:!1,configurable:!0}),t}(FYGE.Container));var x;function E(e,t){void 0===t&&(t=!0),e&&(FYGE.Tween.removeTweens(e),t&&e.children&&e.children.length&&e.children.forEach((function(e){E(e)})))}function _(){f&&a&&!a.destroyed&&(a.destroy(),a=null,p=null,f=!1),u&&r&&!r.destroyed&&(r.destroy(),r=null,s=null,u=!1),v.instance.destroy(),w.instance.destroy()}!function(e){e.ON_SHOW="onShow",e.ON_HIDE="onHide",e.UPDATE_TASK="onUpdateTask",e.UPDATE_SCENE="onUpdateScene"}(x||(x={}));var G=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.showAni=function(e){e()},t.prototype.updateScene=function(){},t}(function(t){function i(e){var n=t.call(this)||this;return n.data=e,n.init(),n}return n(i,t),i.prototype.init=function(){var t=this;this.preLoadRes().then((function(){t.skinName&&e.initSkinDisplay(t,t.skinName,t),t.initUi(),t.onLoaded&&t.onLoaded()}),(function(){t.onLoadError&&t.onLoadError()}))},i.prototype.preLoadRes=function(){var t=this;return new Promise((function(n,i){if(t.groupNames&&t.groupNames.length){for(var o=[],r=0;r<t.groupNames.length;r++)o.push(e.loadGroup(t.groupNames[r]));Promise.all(o).then(n,i)}else n()}))},i.prototype.initUi=function(){},Object.defineProperty(i.prototype,"groupNames",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"skinName",{get:function(){return null},enumerable:!1,configurable:!0}),i.prototype.start=function(e){this.initEvents()},i.prototype.initEvents=function(){},i.prototype.removeEvents=function(){},i.prototype.enableMouseEvt=function(e){this.mouseEnable=e,this.mouseChildren=e},i.prototype.btnDelay=function(e,t){void 0===t&&(t=2e3),e.mouseEnable=!1,e.mouseChildren=!1,setTimeout((function(){e.mouseEnable=!0,e.mouseChildren=!0}),t)},i.prototype.destroy=function(){E(this),this.removeEvents(),this.dispatchEvent("onDestroy"),t.prototype.destroy.call(this)},i}(FYGE.Container)),T=FYGE.Container,F=FYGE.FrameAni,S=function(t){function r(){var e=t.call(this)||this;return e.failStep=4,e.jumpStep=18,e.player=null,e.isGameOver=!1,e.initUi(),e}return n(r,t),r.prototype.initUi=function(){return i(this,void 0,void 0,(function(){var t;return o(this,(function(n){return t=[e.getRes("redbird_upflap.png"),e.getRes("redbird_midflap.png"),e.getRes("redbird_downflap.png")],this.player=new F(t),this.player.play(0),this.addChild(this.player),[2]}))}))},r.prototype.birdRotation=function(){this.failStep>0?this.rotation=Math.min(80,2*this.failStep):this.failStep<0?this.rotation=-25:this.rotation=0},r.prototype.fail=function(e){this.isGameOver||(this.failStep+=.4*e,this.y=Math.max(this.y+this.failStep*e,0),0==this.y&&this.reset(),this.birdRotation())},r.prototype.jump=function(e){this.isGameOver||this.y<=0||(this.failStep-=this.jumpStep)},r.prototype.reset=function(){this.failStep=4,this.jumpStep=18},r.prototype.gameOver=function(){this.reset(),this.isGameOver=!0,this.rotation=0,this.player.reset()},r.prototype.destroy=function(){t.prototype.destroy.call(this)},r}(T),C=FYGE.Container,O=FYGE.Sprite;var P,Y,L,k,R=function(t){function i(e){var n=t.call(this)||this;return n.pipeType="",n.pipeType=e,n.init(),n}return n(i,t),i.prototype.init=function(){this.addChild(new O(e.getRes("down"===this.pipeType?"pipe_green_down.png":"pipe_green.png")))},i.prototype.destroy=function(){t.prototype.destroy.call(this)},i}(C),A=function(){function e(e,t,n){this.upPipes=[],this.downPipes=[],this.pipes=[],this.stage=null,this.minGap=372,this.maxGap=432,this.speed=3,this.timer=null,this.player=null,this.deep=0,this.stage=e,this.player=t,this.deep=n}return e.prototype.startGame=function(){var e=this;this.timer=setTimeout((function(){e.createGroupPipe(),e.startGame()}),2e3)},e.prototype.createGroupPipe=function(){console.log(this.deep);var e=this.downPipes.length?this.downPipes.pop():new R("down"),t=this.upPipes.length?this.upPipes.pop():new R("up");e.x=750,t.x=750;var n,i,o=(n=this.minGap,i=this.maxGap,Math.floor(Math.random()*(i-n))+n),r=Math.random();e.y=-812-r*o,t.y=t.height-812+(1-r)*o,this.stage.height,this.pipes.push({up:t,down:e}),this.stage.addChildAt(e,this.deep-1),this.stage.addChildAt(t,this.deep-1)},e.prototype.enterFrame=function(e){for(var t=0;t<this.pipes.length;t++)if(this.pipes[t]){var n=this.pipes[t],i=n.up,o=n.down;i.x-=this.speed*e,o.x-=this.speed*e,(i.x<=-300||o.x<=-400)&&(this.upPipes.push(i),this.stage.removeChild(i),this.downPipes.push(o),this.stage.removeChild(o),this.pipes[t]=null);var r=this.player,s=r.x;s+r.width/2>=i.x&&s-r.width/2<=i.x+i.width&&(i.y<=r.y&&this.stage.gameOver(),o.y+o.height+r.height/2>=r.y&&this.stage.gameOver())}},e.prototype.destroy=function(){clearTimeout(this.timer)},e}(),I=FYGE.Container,B=FYGE.Sprite,j=function(t){function i(){var e=t.call(this)||this;return e.bg1=null,e.bg2=null,e.speed=10,e.init(),e}return n(i,t),i.prototype.init=function(){var t=this;Array(2).fill("").forEach((function(n,i){var o=t["bg".concat(i+1)]=new I;o.addChild(new B(e.getRes("com_bg.jpg")));var r=new B(e.getRes("base.png"));o.addChild(r),r.width=750,r.height=250,r.y=1624-r.height,o.x=750*i,t.addChild(o)}))},i.prototype.enterFrame=function(e){var t=this;[this.bg1,this.bg2].forEach((function(n,i){n.x-=t.speed*e,n.x<=-750&&(n.x+=1500)}))},i.prototype.destroy=function(){t.prototype.destroy.call(this)},i}(I),D=FYGE.TEXT_ALIGN,N=FYGE.TextField,M=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.bird=null,t.isGameOver=!1,t.isGameStart=!1,t.slideBg=null,t.pipeMannage=null,t.prevTime=0,t.rate=1,t.scoreText=null,t.score=0,t.timer=null,t}return n(t,e),Object.defineProperty(t.prototype,"groupNames",{get:function(){return["index"]},enumerable:!1,configurable:!0}),t.prototype.initUi=function(){return i(this,void 0,void 0,(function(){var e;return o(this,(function(t){return this.slideBg=new j,this.addChild(this.slideBg),(e=this.bird=new S).x=100,e.y=800,this.addChild(e),this.scoreText=new N,this.addChild(this.scoreText),this.pipeMannage=new A(this,e,this.getChildIndex(this.scoreText)),this.scoreText.text="".concat(this.score),this.scoreText.size=58,this.scoreText.textAlign=D.CENTER,this.scoreText.fillColor="#ff5432",this.scoreText.position.set((750-this.scoreText.width)/2,200),this._initEvents(),[2]}))}))},t.prototype._countDown=function(){var e=this;this.timer=setTimeout((function(){e.score+=1,e.scoreText.text="".concat(e.score),e._countDown()}),1e3)},t.prototype._initEvents=function(){this.addEventListener(FYGE.Event.ENTER_FRAME,this._enterFrame,this),this.addEventListener(FYGE.MouseEvent.CLICK,this.birdJump,this)},t.prototype._checkRmove=function(){this.bird.y>=this.stage.stageHeight&&this.gameOver()},t.prototype._enterFrame=function(){var e=Date.now(),t=1;if(this.prevTime){var n=e-this.prevTime;this.rate=t=n/16.7}this.prevTime=e,this.isGameOver||(this.slideBg.enterFrame(t),this.pipeMannage.enterFrame(t),this.isGameStart&&(this.bird.fail(t),this._checkRmove()))},t.prototype.gameOver=function(){this.isGameOver=!0,this.isGameStart=!1,this.bird.gameOver(),this.pipeMannage.destroy(),clearTimeout(this.timer),window.alert("GameOver\n得分："+this.score)},t.prototype.birdJump=function(){this.isGameOver&&window.location.reload(),this.isGameStart?this.bird.jump(this.rate):this.startGame()},t.prototype.startGame=function(){this._countDown(),this.isGameOver&&(this.bird.y=500,this.bird.reset()),this.isGameStart=!0,this.isGameOver=!1,this.pipeMannage.startGame()},t.prototype.destroy=function(){this.pipeMannage.destroy(),e.prototype.destroy.call(this)},t}(G),H={groups:[{keys:"5cab5037-81fc-4246-96e5-b1353f339275.png,7458bc9a-d07d-4a7c-972b-4de7ed7c040d.png,7e4500a1-83be-4686-a46b-67147ed44ddd.png,845ae874-998e-4f68-8e79-641eb77466f3.png,a122de8a-beed-4442-9252-8c047986f371.png,ad9681a6-9eb2-40ad-8c2c-0b3ad121a00d.png,b48ee079-b3d7-4371-b294-944200eccba9.png,cd1a775d-36c9-4c8e-9c67-8191070068e9.png",name:"LoadingEffect",atlas:{"5cab5037-81fc-4246-96e5-b1353f339275.png":{x:2,y:2,w:516,h:108,ox:0,oy:0,sw:516,sh:108,ro:!1},"b48ee079-b3d7-4371-b294-944200eccba9.png":{x:2,y:112,w:137,h:74,ox:0,oy:0,sw:137,sh:74,ro:!1},"a122de8a-beed-4442-9252-8c047986f371.png":{x:141,y:112,w:134,h:24,ox:0,oy:0,sw:134,sh:24,ro:!1},"cd1a775d-36c9-4c8e-9c67-8191070068e9.png":{x:2,y:188,w:123,h:104,ox:0,oy:0,sw:123,sh:104,ro:!1},"7458bc9a-d07d-4a7c-972b-4de7ed7c040d.png":{x:127,y:188,w:48,h:30,ox:0,oy:0,sw:48,sh:30,ro:!0},"ad9681a6-9eb2-40ad-8c2c-0b3ad121a00d.png":{x:141,y:138,w:23,h:36,ox:0,oy:0,sw:23,sh:36,ro:!1},"845ae874-998e-4f68-8e79-641eb77466f3.png":{x:127,y:238,w:24,h:25,ox:0,oy:0,sw:24,sh:25,ro:!1},"7e4500a1-83be-4686-a46b-67147ed44ddd.png":{x:141,y:176,w:5,h:6,ox:0,oy:0,sw:5,sh:6,ro:!1}}},{keys:"overBtn.png,overPrizeBg.png",name:"OverPanel",atlas:{"overPrizeBg.png":{x:2,y:2,w:581,h:843,ox:0,oy:0,sw:581,sh:843,ro:!1},"overBtn.png":{x:585,y:2,w:418,h:102,ox:0,oy:0,sw:418,sh:102,ro:!0}}},{keys:"reviveBg.png,reviveCancel.png,reviveOk.png",name:"RevivePanel",atlas:{"reviveBg.png":{x:2,y:2,w:581,h:508,ox:0,oy:0,sw:581,sh:508,ro:!1},"reviveOk.png":{x:2,y:512,w:233,h:89,ox:0,oy:0,sw:233,sh:89,ro:!1},"reviveCancel.png":{x:237,y:512,w:224,h:85,ox:0,oy:0,sw:224,sh:85,ro:!1}}},{keys:"base.png,pipe_green.png,pipe_green_down.png,redbird_downflap.png,redbird_midflap.png,redbird_upflap.png",name:"bird",atlas:{"pipe_green.png":{x:2,y:2,w:141,h:1462,ox:0,oy:0,sw:141,sh:1462,ro:!1},"pipe_green_down.png":{x:145,y:2,w:141,h:1462,ox:0,oy:0,sw:141,sh:1462,ro:!1},"base.png":{x:288,y:2,w:750,h:377,ox:0,oy:0,sw:750,sh:377,ro:!0},"redbird_downflap.png":{x:288,y:754,w:89,h:63,ox:0,oy:0,sw:89,sh:63,ro:!1},"redbird_midflap.png":{x:379,y:754,w:89,h:63,ox:0,oy:0,sw:89,sh:63,ro:!1},"redbird_upflap.png":{x:470,y:754,w:89,h:63,ox:0,oy:0,sw:89,sh:63,ro:!1}}},{keys:"comCloseBtn.png,com_bg.jpg,toastBg.png,waitingBg.png,waitingRot.png",name:"common",atlas:{"toastBg.png":{x:2,y:2,w:460,h:130,ox:0,oy:0,sw:460,sh:130,ro:!1},"waitingBg.png":{x:2,y:134,w:160,h:180,ox:0,oy:0,sw:160,sh:180,ro:!0},"comCloseBtn.png":{x:184,y:134,w:58,h:58,ox:0,oy:0,sw:58,sh:58,ro:!1},"waitingRot.png":{x:184,y:194,w:56,h:56,ox:0,oy:0,sw:56,sh:56,ro:!1}}},{keys:"gameMusicOff.png,gameMusicOn.png,gameScore+.png,gameScore0.png,gameScore1.png,gameScore2.png,gameScore3.png,gameScore4.png,gameScore5.png,gameScore6.png,gameScore7.png,gameScore8.png,gameScore9.png,guide.png",name:"game",atlas:{"guide.png":{x:2,y:2,w:320,h:416,ox:0,oy:0,sw:320,sh:416,ro:!1},"gameMusicOff.png":{x:324,y:2,w:82,h:82,ox:0,oy:0,sw:82,sh:82,ro:!1},"gameMusicOn.png":{x:324,y:86,w:82,h:82,ox:0,oy:0,sw:82,sh:82,ro:!1},"gameScore0.png":{x:324,y:170,w:44,h:56,ox:2,oy:0,sw:47,sh:56,ro:!0},"gameScore1.png":{x:324,y:216,w:28,h:56,ox:2,oy:0,sw:32,sh:56,ro:!0},"gameScore2.png":{x:324,y:246,w:44,h:56,ox:2,oy:0,sw:47,sh:56,ro:!0},"gameScore3.png":{x:324,y:292,w:44,h:56,ox:2,oy:0,sw:47,sh:56,ro:!0},"gameScore4.png":{x:324,y:338,w:44,h:56,ox:2,oy:0,sw:48,sh:56,ro:!1},"gameScore5.png":{x:408,y:2,w:44,h:56,ox:2,oy:0,sw:47,sh:56,ro:!1},"gameScore6.png":{x:408,y:60,w:44,h:56,ox:2,oy:0,sw:47,sh:56,ro:!1},"gameScore7.png":{x:408,y:118,w:44,h:56,ox:2,oy:0,sw:47,sh:56,ro:!1},"gameScore8.png":{x:382,y:176,w:44,h:56,ox:2,oy:0,sw:47,sh:56,ro:!0},"gameScore9.png":{x:382,y:222,w:44,h:56,ox:2,oy:0,sw:47,sh:56,ro:!0},"gameScore+.png":{x:382,y:268,w:42,h:40,ox:2,oy:8,sw:46,sh:56,ro:!1}}},{keys:"btnTipBg.png,prizeBtn.png,progressBg.png,progressFill.png,progressLabel.png,rankBtn.png,ruleBtn.png,startBtn.png,taskBtn.png",name:"index",atlas:{"progressBg.png":{x:2,y:2,w:750,h:188,ox:0,oy:0,sw:750,sh:188,ro:!1},"progressFill.png":{x:2,y:192,w:615,h:20,ox:0,oy:0,sw:615,sh:20,ro:!1},"startBtn.png":{x:2,y:214,w:490,h:111,ox:0,oy:0,sw:490,sh:111,ro:!1},"prizeBtn.png":{x:494,y:214,w:153,h:51,ox:0,oy:0,sw:153,sh:51,ro:!1},"taskBtn.png":{x:494,y:267,w:151,h:51,ox:0,oy:0,sw:151,sh:51,ro:!1},"btnTipBg.png":{x:2,y:327,w:147,h:36,ox:0,oy:0,sw:147,sh:36,ro:!1},"ruleBtn.png":{x:649,y:192,w:102,h:42,ox:0,oy:0,sw:102,sh:42,ro:!1},"rankBtn.png":{x:494,y:320,w:98,h:43,ox:0,oy:0,sw:98,sh:43,ro:!1},"progressLabel.png":{x:151,y:327,w:87,h:31,ox:0,oy:0,sw:87,sh:31,ro:!1}}},{keys:"loading_effect.png,loading_title.png",name:"loading",atlas:{"loading_effect.png":{x:2,y:2,w:665,h:121,ox:0,oy:0,sw:665,sh:121,ro:!1},"loading_title.png":{x:2,y:125,w:531,h:146,ox:0,oy:0,sw:531,sh:146,ro:!1}}}],path:"https://yun.duiba.com.cn/db_games/activity/template/1676519680/resource/"},U={x:0,y:0,type:"container",children:[]};!function(e){e.addData="surge.addStat",e.getActivityBaseInfoById="feileJump.getActivityBaseInfoById",e.getGameInfo="feileJump.getGameInfo",e.startGame="feileJump.startGame",e.doHelp="feileJump.doHelp",e.getVipInfo="feileJump.getVipInfo",e.submitGame="feileJump.submitGame",e.continueGame="feileJump.continueGame",e.getRankList="feileJump.getRankList",e.getPrizeList="feileJump.getPrizeList",e.getRankRewards="feileJump.getRankRewards",e.getMyRankPrize="feileJump.getMyRankPrize",e.receiveEnamePrize="feileJump.receiveEnamePrize",e.openMember="mine.openMember",e.openTask="mine.openTask",e.authorize="mine.authorize",e.favorShop="mine.favorShop",e.getUserAddress="mine.getUserAddress",e.getAdoptName="mine.getAdoptName",e.getAppData="mine.getAppData",e.navigateToOutside="mine.navigateToOutside",e.navigateTo="mine.navigateTo",e.navigateBack="mine.navigateBack",e.showSharePanel="mine.showSharePanel",e.openDetail="mine.openDetail",e.reportAnalytics="mine.reportAnalytics",e.openMusic="mine.openMusic"}(P||(P={})),function(e){e.AD="ad",e.TASK_ICON="taskIcon",e.FOLLOW_SHOP="followShop",e.INVITE_FRIEND="inviteFriend",e.BROWSE_PRODUCT="browseProduct",e.COLLECTION_PRODUCT="collectionProduct",e.BUY_PRODUCT="buyProduct",e.IMPROVE_INFORMATION="improveInformation",e.SECRET_ORDER="secretOrder",e.SIGN_ICON="signIcon",e.BAG_ICON="bagIcon"}(Y||(Y={})),function(e){e[e.ENAME=1]="ENAME",e[e.CREDITS=2]="CREDITS",e[e.OBJECT=3]="OBJECT",e[e.THANKS=5]="THANKS"}(L||(L={})),function(e){e.index="/projectx/{projectId}/game/index.do",e.join="/projectx/{projectId}/game/join.do",e.queryResult="/projectx/{projectId}/game/queryResult.do",e.projectRule="/projectx/{projectId}/projectRule.query"}(k||(k={}));var J,z,W=location.href.indexOf(".com.cn/projectx")>=0;!function(e){if(W){var t=document.getElementsByTagName("head")[0],n=document.createElement("script");n.src="getTokenKey?_="+Date.now(),n.onload=function(){t.removeChild(n),e&&e(!0)},n.onerror=function(){t.removeChild(n),e&&e(!1)},t.appendChild(n)}else e&&e(!0)}(),function(e){e.EXPOSURE="exposure",e.CLICK="click"}(J||(J={})),function(e){e.getAppData="mine.getAppData",e.getVoiceType="mine.getVoiceType"}(z||(z={}));var q=window.my;"web"==FYGE.getEnv()&&q&&(q.onMessage=function(e){console.log("返回数据",e.netName,e.data),ie.dispatchEvent(e.netName,e.data)});var V=FYGE.Tween,X=FYGE.EventDispatcher,K=FYGE.Stage,Q=FYGE.RENDERER_TYPE,Z=FYGE.Event,$=FYGE.getEnv,ee=FYGE.Texture,te=new X,ne=function(){function t(e,t,n,i,o,r,s,a,p){void 0===t&&(t=750),void 0===n&&(n=1624),void 0===r&&(r=Q.WEBGL),void 0===s&&(s=!0),void 0===a&&(a=!1);var h,c=this;this.loop=function(){c._pause||(V.flush(),c.stage.flush()),"tb"==$()?c.requestID=c.canvas.requestAnimationFrame(c.loop):c.requestID=window.requestAnimationFrame(c.loop)},window||(FYGE.initedByCanvas(e),h=my.getSystemInfoSync()),i=i||(null==h?void 0:h.windowWidth)||document.body.clientWidth,o=o||(null==h?void 0:h.windowHeight)||document.body.clientHeight,p=p||(null==h?void 0:h.pixelRatio)||window.devicePixelRatio||1;var u=this.stage=new K(e,t,n,i,o,r,s,a,p);this.canvas=e,u.addEventListener(Z.INIT_STAGE,this.onAddToStage,this),this.loop()}return t.prototype.onAddToStage=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return b.init(this.stage),console.log("初始化层级完成"),e.loadConfig(H),console.log("初始化资源配置完成"),e.loadSkinConfig(U),console.log("初始化皮肤配置完成"),[4,e.loadGroup("common")];case 1:return t.sent(),console.log("通用资源加载完成"),[4,e.loadGroup("bird")];case 2:return t.sent(),console.log("bird资源加载完成"),"web"==$()&&document.getElementById("__loading__")&&(document.getElementById("__loading__").style.display="none"),[4,Promise.all([ee.fromUrl("https://yun.duiba.com.cn/aurora/assets/923bcdee2d54f39797fb1cc5a79ab84da1bbe972.jpg"),ee.fromUrl("https://yun.duiba.com.cn/aurora/assets/92856abbb6293e863708fa2c0ea3556cf9b2afaa.jpg"),ee.fromUrl("https://yun.duiba.com.cn/aurora/assets/d660b9e12c66ad2c42fca23c57bf33db5009fedf.jpg"),ee.fromUrl("https://yun.duiba.com.cn/aurora/assets/a6903842083d8015e2e81d2dc652370574be6774.jpg")])];case 3:return t.sent(),n=M,i={from:"main"},w.instance.change(n,i),[2]}var n,i}))}))},t.prototype.initWebEvent=function(){var e=this.stage.onMouseEvent.bind(this.stage);this.canvas.addEventListener("touchstart",e,!1),this.canvas.addEventListener("touchmove",e,!1),this.canvas.addEventListener("touchend",e,!1)},t.prototype.run=function(){this._pause=!1,V._lastTime=null,te.dispatchEvent({type:x.ON_SHOW})},t.prototype.pause=function(){te.dispatchEvent({type:x.ON_HIDE})},t.prototype.addGlobalEvent=function(e,t,n,i){void 0===i&&(i=!1),i?te.once(e,t,n):te.addEventListener(e,t,n)},t.prototype.dispatchGlobalEvent=function(e,t){te.dispatchEvent(e,t)},t.prototype.removeGlobalEvent=function(e,t,n){te.removeEventListener(e,t,n)},t.prototype.destroy=function(){V.removeAllTweens(),"tb"==FYGE.getEnv()?this.canvas.cancelAnimationFrame(this.requestID):window.cancelAnimationFrame(this.requestID),b.removeChildren(),b.parent&&b.parent.removeChild(b),_(),this.stage.destroy(),te.removeAllEventListener()},t}(),ie=new(0,FYGE.EventDispatcher);export{ie as GDispatcher,ne as Game};
//# sourceMappingURL=output.module.js.map
