/* (c) 2013-2022 GameMix Inc. All rights reserved. */ !function(){var t,u,a,o,c,p,m,f,g,y,i,s,w,e=document.getElementById("gameCanvas"),n=e.getContext("2d");function v(t,e){return i.call(t,e)}function r(t,e){var i,s,n,a,o,r,h,l,d,u,c=e&&e.split("/"),p=g.map,m=p&&p["*"]||{};if(t&&"."===t.charAt(0))if(e){for(c=c.slice(0,c.length-1),e=(t=t.split("/")).length-1,g.nodeIdCompat&&w.test(t[e])&&(t[e]=t[e].replace(w,"")),t=c.concat(t),l=0;l>>0;if("function"!=typeof t)throw new TypeError;for(i=0;i>>0;if("function"!=typeof t)throw new TypeError;for(i=0;it.x?this:t).x,this.y=(this.y>t.y?this:t).y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthSquared:function(){return this.x*this.x+this.y*this.y},normalize:function(){var t,e=Math.sqrt(this.x*this.x+this.y*this.y);return ethis.right&&(t=this.left,this.left=this.right,this.right=t),this.top>this.bottom&&(t=this.top,this.top=this.bottom,this.bottom=t)},translate:function(t,e){this.translateX(t),this.translateY(e)},translateX:function(t){this.left+=t,this.right+=t},translateY:function(t){this.top+=t,this.bottom+=t},getWidth:function(){return this.right-this.left},getHeight:function(){return this.bottom-this.top},setWidth:function(t){this.right=this.left+t},setHeight:function(t){this.bottom=this.top+t},containsPoint:function(t,e){return t>=this.left&&t=this.top&&e=o.GAMEOVERROTATEDELAY&&(e.rotate(),this.lastGameOverAdRotate=t,this.dispatch(o.events.GAMEOVERADREFRESHED,{ad:e})))},showGameOverAd:function(t){this.enabled&&this.gameOverAdScreen&&(this.gameOverHideCallback=t,a.addClass(this.gameOverAdScreen,"show"),this.dispatch(o.events.GAMEOVERADSHOWN,{ad:this.currentGameOverAd}))},hideGameOverAd:function(){this.gameOverAdScreen&&a.removeClass(this.gameOverAdScreen,"show"),this.gameOverHideCallback&&(this.gameOverHideCallback(),this.gameOverHideCallback=null),this.dispatch(o.events.GAMEOVERADHIDDEN,{ad:this.currentGameOverAd})},shouldShowGameOverAd:function(){var t;return!!this.enabled&&(!!(t=this.getGameOverAd())&&t.shouldShow())},getGameOverAd:function(){if(this.enabled&&!this.currentGameOverAd)for(var t=s.getCurrentPlatform(),e=0;e=i.startTime&&e=i.endTime&&(i.step(1,e),i.end(),this.currentIndex+=1,n=!0)),n;);},end:function(){a.prototype.end.call(this),this.currentIndex=this.anims.length},stop:function(){var t;for(a.prototype.stop.call(this),this.currentIndex=this.anims.length,t=0;t=this.children.length?(t.parent=this).children.push(t):this.children.splice(i,0,t),-1===i&&(t.dispatch(s.events.added,{parent:this}),this.dispatch(n.events.childAdded,{child:t}),this.dispatchAnyChildAdded(t)),this.children.length},removeChild:function(t){var e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatch(s.events.removed,{parent:this}),this.dispatch(n.events.childRemoved,{child:t}),this.dispatchAnyChildRemoved(t),!0)},removeChildAt:function(t){var e;return tt*t&&(this.velocity.normalize(),this.velocity.multiply(t))},limitAccel:function(t){this.maxAccelt*t&&(this.accel.normalize(),this.accel.multiply(t))},limitAngularVelocity:function(t){this.maxAngularSpeedt&&(this.angularVelocity=0o.minAngle&&(this.sprite.angle+=o.flappingAngularVelocity*e),0=o.maxAngle&&(this.sprite.angle=o.maxAngle))}}),o}),n("j13e/display/J13DisplayImg",["require","exports","module","./J13DisplayItem","../math/J13Rect","../utils/J13Utils"],function(t,e,i){"use strict";var s=t("./J13DisplayItem"),n=t("../math/J13Rect"),t=t("../utils/J13Utils");function a(t){var e=t||{};s.call(this,t),this.image=e.image||e.img||null,this.sourceRect=e.sourceRect||null,this.destRect=e.destRect||null,this.sourceRect&&!n.isJ13Rect(this.sourceRect,!0)&&n.canBeJ13Rect(this.sourceRect)&&(this.sourceRect=new n(this.sourceRect)),this.destRect&&!n.isJ13Rect(this.destRect,!0)&&n.canBeJ13Rect(this.destRect)&&(this.destRect=new n(this.destRect)),!this.sourceRect&&this.image&&(this.sourceRect=new n({left:0,top:0,right:this.image.width,bottom:this.image.height})),!this.destRect&&this.image&&(this.destRect=this.sourceRect.copy())}return a.prototype=t.inherit(new s,{render:function(t,e,i,s){s=s.canvasContext;try{s.drawImage(this.image,this.sourceRect.left,this.sourceRect.top,this.sourceRect.getWidth(),this.sourceRect.getHeight(),this.destRect.left,this.destRect.top,this.destRect.getWidth(),this.destRect.getHeight())}catch(t){console.log(t.message),console.log(this)}},setSourceRectFromImage:function(t){this.sourceRect.setPosition(0,0),this.sourceRect.setWidth(t.width),this.sourceRect.setHeight(t.height)},setDestRectFromImage:function(t){this.destRect.setPosition(0,0),this.destRect.setWidth(t.width),this.destRect.setHeight(t.height)}}),a}),n("src/viewports/playparts/Pipe",["require","exports","module","src/Resources","j13e/math/J13Rect","j13e/display/J13DisplayImg","j13e/utils/J13Utils"],function(t,e,i){"use strict";var s=t("src/Resources"),n=t("j13e/math/J13Rect"),a=t("j13e/display/J13DisplayImg"),o=t("j13e/utils/J13Utils");function r(t){var t=t||{},e=(this.side=t.side||r.sides.left,this.leftWallX=t.leftWallX||0,this.rightWallX=t.rightWallX||0,s.loadedImages[s.images.pipe]);a.call(this,o.extendObj({img:e,anchorY:e.height,scaleY:-1},t)),this.side===r.sides.left?(this.anchorX=0,this.scaleX=1,this.x=this.leftWallX,this.hitRect=new n({x:0,y:this.y,width:e.width,height:e.height})):this.side===r.sides.right&&(this.anchorX=0,this.scaleX=-1,this.x=this.rightWallX,this.hitRect=new n({x:this.rightWallX-e.width,y:this.y,width:e.width,height:e.height}))}return r.sides={left:1,right:2},r.prototype=o.inherit(new a,{}),r}),n("j13e/display/J13DisplayCircle",["require","exports","module","../utils/J13Utils","./J13DisplayItem","./J13DisplayDrawOptions"],function(t,e,i){"use strict";var s=t("../utils/J13Utils"),n=t("./J13DisplayItem"),a=t("./J13DisplayDrawOptions");function o(t){var e=t||{};n.call(this,t),this.radius=e.radius||5,this.startAngle=e.hasOwnProperty("startAngle")?e.startAngle:0,this.endAngle=e.hasOwnProperty("endAngle")?e.endAngle:2*Math.PI,this.counterclockwise=!!e.hasOwnProperty("counterclockwise")&&e.counterclockwise,this.closeLoop=!e.hasOwnProperty("closeLoop")||e.closeLoop,e.hasOwnProperty("ccw")&&(this.counterclockwise=e.ccw),this.drawOptions=e.drawOptions||new a(t),this.drawFlags=e.drawFlags||a.drawFlags.FILL}return o.prototype=s.inherit(new n,{render:function(t,e,i,s){s=s.canvasContext;this.drawOptions.applyOptions(s),s.beginPath(),s.arc(0,0,this.radius,this.startAngle,this.endAngle,this.counterclockwise),this.closeLoop&&s.closePath(),this.drawOptions.applyPostPathOptions(s),0<(this.drawFlags&a.drawFlags.OUTLINE_BEHIND)&&s.stroke(),0<(this.drawFlags&a.drawFlags.FILL)&&s.fill(),0<(this.drawFlags&a.drawFlags.OUTLINE_FRONT)&&s.stroke(),this.closeLoop||s.closePath()}}),o}),n("j13e/anim/J13AnimGroup",["require","exports","module","./J13Anim","../utils/J13Utils"],function(t,e,i){"use strict";var s=t("./J13Anim"),t=t("../utils/J13Utils");function n(t){var e=t||{};s.call(this,t),this.anims=e.anims||[],this.applyDuration=e.hasOwnProperty("applyDuration")||-1,this.recalculateDuration()}return n.prototype=t.inherit(new s,{recalculateDuration:function(){var t,e,i=0;if(-1!==this.applyDuration)for(this.duration=this.applyDuration,t=0;ti&&(i=e.duration);this.duration=i}},preStart:function(){for(var t=0;t=this.width&&(this.bird.flip(),this.bird.x=this.width-(this.bird.hitRect.right-this.width)-this.bird._hitRect.right,this.incrementBounce(),this.setUpPipes(l.sides.left),this.bird.updateDisplayItem())}else if(this.bird.velocity.x<0){for(n=0;n=t.score||r===l.order.ASC&&n<=t.score)&&(i.splice(e,0,{time:s,score:n}),0===e&&(o=!0),a=!0),!a}),!a&&this.entries.lengththis.maxEntries;)this.entries.pop();return t||(t=JSON.stringify({entries:this.entries}),h.set(this.cookieSettings.name,t,this.cookieSettings.expires)),o}},l}),n("j13e/display/J13DisplayRoundedRect",["require","exports","module","./J13DisplayRect","../utils/J13Utils","./J13DisplayDrawOptions"],function(t,e,i){"use strict";var s=t("./J13DisplayRect"),n=t("../utils/J13Utils"),a=t("./J13DisplayDrawOptions");function o(t){var e=t||{};s.call(this,t),this.tlRadius=e.tlRadius||e.topLeftRadius||0,this.trRadius=e.trRadius||e.topRightRadius||0,this.blRadius=e.blRadius||e.bottomLeftRadius||0,this.brRadius=e.brRadius||e.bottomRightRadius||0,e.hasOwnProperty("r")?this.setRadius(e.r):e.hasOwnProperty("radius")&&this.setRadius(e.radius)}return o.prototype=n.inherit(new s,{setRadius:function(t){this.tlRadius=this.trRadius=this.blRadius=this.brRadius=t},render:function(t,e,i,s){s=s.canvasContext;this.drawOptions.applyOptions(s),s.beginPath(),s.moveTo(this.rect.left+this.tlRadius,this.rect.top),s.lineTo(this.rect.right-this.trRadius,this.rect.top),s.arc(this.rect.right-this.trRadius,this.rect.top+this.trRadius,this.trRadius,1.5*Math.PI,2*Math.PI),s.lineTo(this.rect.right,this.rect.bottom-this.brRadius),s.arc(this.rect.right-this.brRadius,this.rect.bottom-this.brRadius,this.brRadius,0,.5*Math.PI),s.lineTo(this.rect.left+this.blRadius,this.rect.bottom),s.arc(this.rect.left+this.blRadius,this.rect.bottom-this.blRadius,this.blRadius,.5*Math.PI,Math.PI),s.lineTo(this.rect.left,this.rect.top+this.tlRadius),s.arc(this.rect.left+this.tlRadius,this.rect.top+this.tlRadius,this.tlRadius,Math.PI,1.5*Math.PI),s.closePath(),this.drawOptions.applyPostPathOptions(s),0<(this.drawFlags&a.drawFlags.OUTLINE_BEHIND)&&s.stroke(),0<(this.drawFlags&a.drawFlags.FILL)&&s.fill(),0<(this.drawFlags&a.drawFlags.OUTLINE_FRONT)&&s.stroke()}}),o}),n("src/scenes/HiScoreScene",["require","exports","module","src/Resources","src/Settings","src/utils/HiScoreManager","j13e/utils/J13Utils","j13e/display/J13DisplayText","j13e/display/J13DisplayItemContainer","j13e/display/J13DisplayImg","j13e/display/J13DisplayImgButton","j13e/display/J13DisplaySpriteButton","j13e/math/J13Rect","j13e/display/J13DisplayRoundedRect","j13e/anim/J13Anim","j13e/display/J13DisplayRect"],function(t,e,i){"use strict";var s=t("src/Resources"),n=t("src/Settings"),a=t("src/utils/HiScoreManager"),o=t("j13e/utils/J13Utils"),r=t("j13e/display/J13DisplayText"),h=t("j13e/display/J13DisplayItemContainer"),l=(t("j13e/display/J13DisplayImg"),t("j13e/display/J13DisplayImgButton")),d=t("j13e/display/J13DisplaySpriteButton"),u=(t("j13e/math/J13Rect"),t("j13e/display/J13DisplayRoundedRect"),t("j13e/anim/J13Anim"));t("j13e/display/J13DisplayRect");function c(t){var e=t||{},i=this,t=(h.call(this,t),this.game=e.game||null,this.width=e.width||0,this.height=e.height||0,this.opacity=0,this.hiScoreManager=new a({cookieSettings:{name:"gmbouncyflappy_hsl",expires:63072e3},order:a.order.DESC,maxEntries:1}),this.youScoredText=new r({font:"30px Pixel5x5",x:this.width/2,y:200,text:"YOU SCORED",textAlign:"center",textBaseline:"top",fillStyle:"#ffffff"}),this.addChild(this.youScoredText),this.scoreText=new r({font:"70px Pixel5x5",x:this.width/2,y:250,text:"0",textAlign:"center",textBaseline:"top",fillStyle:"#ffffff"}),this.addChild(this.scoreText),this.avoidThePipesText=new r({font:"30px Pixel5x5",x:this.width/2,y:120,text:"AVOID THE PIPES!",textAlign:"center",textBaseline:"top",fillStyle:"#ffffff",visible:!1}),this.addChild(this.avoidThePipesText),this.retryButton=new l({id:s.buttons.retry,img:s.loadedImages[s.images.retryButton],clickFunction:e.retryButtonCallback||function(){},visible:!0,y:340,width:215,height:66}),this.retryButton.x=this.width/2-this.retryButton.image.width/2,this.addChild(this.retryButton),this.rankButton=new l({id:s.buttons.rank,img:s.loadedImages[s.images.rankButton],clickFunction:this.showGmapiLeaderboard.bind(this),y:430,width:215,height:66}),this.rankButton.x=this.width/2-this.rankButton.image.width/2,this.addChild(this.rankButton),this.kikButton=new l({id:s.buttons.kik,img:s.loadedImages[s.images.kikButton],clickFunction:e.kikButtonCallback||function(){},visible:n.kik,y:520,width:215,height:66}),this.kikButton.x=this.width/2-this.kikButton.image.width/2,this.addChild(this.kikButton),this.crazyGamesBackButton=new l({image:s.loadedImages[s.images.crazyGamesBackButton],x:10,y:40,width:s.loadedImages[s.images.crazyGamesBackButton].width,height:s.loadedImages[s.images.crazyGamesBackButton].height,visible:n.crazyGames,clickFunction:this.game.crazyGamesBackButtonCallback.bind(this.game)})),e=(this.addChild(t),s.volumeSheet.getSprite("main"));this.volumeButton=new d(o.extendObj(e.options,{id:s.buttons.volume,x:this.width-e.destRect.getWidth()-10,y:39,clickFunction:this.volumeButtonCallback.bind(this)})),this.addChild(this.volumeButton),this.volumeButton.addListener(this.volumeButton.events.UP,this.onVolumeButtonUp.bind(this)),this.volumeButton.addListener(this.volumeButton.events.DOWN,this.onVolumeButtonDown.bind(this)),this.showAnim=new u({startValue:0,endValue:1,duration:500,startCallback:function(){i.visible=!0},stepCallback:function(t){i.opacity=t}})}return c.DEFAULT_BUTTON_SPACING=50,c.MIN_SCORE=2,c.prototype=o.inherit(new h,{showGmapiLeaderboard:function(){window.gmapi&&window.gmapi(function(t){t.game.leaderboard.show()})},updateHiScoreList:function(e){var t=(new Date).getTime();e&&c.MIN_SCORE<=e&&(this.hiScoreManager.addScore(t,e),window.gmapi&&window.gmapi(function(t){t.game.leaderboard.sendScore(e)})),this.scoreText.text=e.toString()},volumeButtonCallback:function(t){s.soundManager.toggleMute(),this.updateVolumeButton()},onVolumeButtonDown:function(t){this.volumeButton.anchorY=-5},onVolumeButtonUp:function(t){this.volumeButton.anchorY=0},updateVolumeButton:function(){s.soundManager.isMuted()?this.volumeButton.setFrameId("off"):this.volumeButton.setFrameId("on")},show:function(t,e){if(t&&t.hasOwnProperty("score")){var i=this.avoidThePipesText;if(this.updateHiScoreList(t.score),n.kik&&window.points&&window.points.offer&&window.points.offer.complete&&15<=t.score&&window.points.offer.complete(function(t){t?console.log("kpErr: status="+t.status+"; msg="+t.msg):(i.font="25px Pixel5x5",i.text="CONGRATS! YOU GOT KIK POINTS!")}),t.score<5&&t.hasOwnProperty("hitType"))switch(i.font="30px Pixel5x5",i.visible=!0,t.hitType){case s.hitTypes.ceiling:i.text="AVOID THE CEILING!";break;case s.hitTypes.floor:i.text="AVOID THE FLOOR!";break;case s.hitTypes.pipe:i.text="AVOID THE PIPES!"}else this.avoidThePipesText.visible=!1}this.showAnim.endCallback=e||function(){},this.updateVolumeButton(),s.animManager.restartAnim(this.showAnim)},hide:function(){this.visible=!1,this.opacity=0}}),c}),n("src/screens/PlayScreen",["require","exports","module","src/Resources","src/utils/Updatable","src/viewports/PlayViewport","src/scenes/MainMenuScene","src/scenes/HiScoreScene","j13e/math/J13Rect","j13e/utils/J13Utils","j13e/display/J13DisplayRect","j13e/display/J13DisplayItemContainer"],function(t,e,i){"use strict";var s=t("src/Resources"),n=t("src/utils/Updatable"),a=t("src/viewports/PlayViewport"),o=t("src/scenes/MainMenuScene"),r=t("src/scenes/HiScoreScene"),h=t("j13e/math/J13Rect"),l=t("j13e/utils/J13Utils"),d=t("j13e/display/J13DisplayRect"),u=t("j13e/display/J13DisplayItemContainer");function c(t){var e=t||{};u.call(this,t),this.game=e.game||null,this.width=e.width||0,this.height=e.height||0,this.numPlays=0,this.playViewport=new a({width:this.width,height:this.height}),this.addChild(this.playViewport),this.mainMenuScene=new o({game:this.game,width:this.width,height:this.height,visible:!1,startButtonCallback:this.startButtonCallback.bind(this)}),this.addChild(this.mainMenuScene),this.hiScoreScene=new r({game:this.game,width:this.width,height:this.height,visible:!1,kikButtonCallback:e.kikButtonCallback,retryButtonCallback:this.retryButtonCallback.bind(this)}),this.addChild(this.hiScoreScene),this.transitionOverlay=new d({rect:new h({width:this.width,height:this.height}),visible:!1,opacity:0}),this.addChild(this.transitionOverlay),this.playViewport.addListener(a.events.dying,this.onDying.bind(this)),s.mouseManager.addListener(s.mouseManager.events.DOWN,this.onMouseDown.bind(this))}return c.prototype=l.inherit(new u,n.prototype,{retryButtonCallback:function(t){s.gsm.transitioning||(this.playViewport.hideAllPipes(),s.gsm.toState(s.gameStates.mainMenu),s.soundManager.play(s.soundNames.menu))},onDying:function(t){s.gsm.toState(s.gameStates.gameOver,{score:this.playViewport.bounces,hitType:t&&t.data?t.data.hitType:null})},onMouseDown:function(t){s.gsm.getCurrentStateId()===s.gameStates.level&&this.playViewport.flap()},startButtonCallback:function(t){s.gsm.getCurrentStateId()===s.gameStates.mainMenu&&(s.gsm.toState(s.gameStates.level),this.numPlays+=1,this.playViewport.flap())},update:function(t,e,i,s){this.playViewport.update(t,e,i,s)},show:function(t){t&&t.hasOwnProperty("reset")&&this.reset(),this.visible=!0},reset:function(){this.playViewport.reset()},hide:function(){this.visible=!1}}),c}),n("j13e/utils/J13Loader",["require","exports","module","./J13Utils","./J13EventDispatcher"],function(t,e,i){"use strict";var s=t("./J13Utils"),t=t("./J13EventDispatcher");function n(t){t=t||{};this.loaded=0,this.total=0,this.errors=0,this.includeInPreload=!!t.hasOwnProperty("includeInPreload")&&t.includeInPreload,this.strictLoad=!t.hasOwnProperty("strictLoad")||t.strictLoad}return n.events={load:"load",allLoad:"allload",error:"error"},n.prototype=s.inherit(new t,{events:n.events,startLoading:function(){throw new Error('"startLoading" function not overriden in a J13Loader subclass (or should not be called by subclass)')},onLoad:function(t){this.loaded+=1,this.dispatch(this.events.load,{loaded:this.strictLoad?this.loaded:this.loaded+this.errors,total:this.total,errors:this.errors,originalEvent:t}),(this.strictLoad&&this.loaded>=this.total||!this.strictLoad&&this.loaded+this.errors>=this.total)&&this.onAllLoad(t)},onError:function(t){this.dispatch(this.events.error,{loaded:this.strictLoad?this.loaded:this.loaded+this.errors,total:this.total,errors:this.errors,originalEvent:t})},onAllLoad:function(t){this.dispatch(this.events.allLoad,{loaded:this.strictLoad?this.loaded:this.loaded+this.errors,total:this.total,errors:this.errors,originalEvent:t})}}),n});var l,d={},C=null,A=!0,I=!1;try{"undefined"!=typeof AudioContext?C=new AudioContext:"undefined"!=typeof webkitAudioContext?C=new webkitAudioContext:A=!1}catch(t){A=!1}if(!A)if("undefined"!=typeof Audio)try{new Audio}catch(t){I=!0}else I=!0;function x(t){this._volume=1,this._muted=!1,this.usingWebAudio=A,this.ctx=C,this.noAudio=I,this._howls=[],this._codecs=t,this.iOSAutoEnable=!0}function O(t){var e=this;e._autoplay=t.autoplay||!1,e._buffer=t.buffer||!1,e._duration=t.duration||0,e._format=t.format||null,e._loop=t.loop||!1,e._loaded=!1,e._sprite=t.sprite||{},e._src=t.src||"",e._pos3d=t.pos3d||[0,0,-.5],e._volume=void 0!==t.volume?t.volume:1,e._urls=t.urls||[],e._rate=t.rate||1,e._model=t.model||null,e._onload=[t.onload||function(){}],e._onloaderror=[t.onloaderror||function(){}],e._onend=[t.onend||function(){}],e._onpause=[t.onpause||function(){}],e._onplay=[t.onplay||function(){}],e._onendTimer=[],e._webAudio=A&&!e._buffer,e._audioNode=[],e._webAudio&&e._setupAudioNode(),void 0!==C&&C&&D.iOSAutoEnable&&D._enableiOSAudio(),D._howls.push(e),e.load()}A&&((l=void 0===C.createGain?C.createGainNode():C.createGain()).gain.value=1,l.connect(C.destination)),x.prototype={volume:function(t){var e=this;if(0<=(t=parseFloat(t))&&t<=1){for(var i in e._volume=t,A&&(l.gain.value=t),e._howls)if(e._howls.hasOwnProperty(i)&&!1===e._howls[i]._webAudio)for(var s=0;sFPS-time: "+Math.round(1e3/t)+"
FPS-render: "+Math.round(a/(r/1e3))+"
FPS-logic: "+Math.round(o/(r/1e3)),this.lastFrameCapture=this.frameCount,this.lastRenderFrameCapture=this.renderFrameCount,this.lastLogicFrameCapture=this.logicFrameCount,this.lastFrameCaptureTime=i)),this.frameCount+=1},updateRenderFrameCount:function(){this.renderFrameCount+=1},updateLogicFrameCount:function(){this.logicFrameCount+=1}},n}),n("j13e/anim/J13AnimManager",["require","exports","module","./J13Anim","../utils/J13Utils","../utils/J13EventDispatcher"],function(t,e,i){"use strict";var s=t("./J13Anim"),n=t("../utils/J13Utils"),t=t("../utils/J13EventDispatcher");function a(t){var e,i=t||{};if(this.anims={},i.anims)for(e in i.anims)i.anims.hasOwnProperty(e)&&(this.anims[e]=i.anims[e],this.anims[e].manager=this);this.activeAnims=[],this.animIndexesToRemove=[],this.animsToStart=[]}return a.prototype=n.inherit(new t,{addAnim:function(t){(this.anims[t.id]=t).manager=this},removeAnim:function(t){t=this.anims["string"==typeof t?t:t.id];t&&(this.anims[t.id]=void 0,t.manager=null)},update:function(t,e,i,s){var n,a;if(1=a.startTime&&i=a.endTime&&(a.step(1,i),a.end(),this.animIndexesToRemove.push(r))},createAnim:function(t){new s(n.extendObj(t,{manager:this}))},getAnim:function(t){return this.anims[t]},startAnimById:function(t){this.startAnim(this.anims[t])},startAnim:function(t){t.manager=this,t.preStart(),this.animsToStart.push(t)},stopAnimById:function(t){this.stopAnim(this.anims[t])},stopAnim:function(t){var e=this.activeAnims.indexOf(t);t.stop(),-1!==e&&this.animIndexesToRemove.push(e)},restartAnimById:function(t){this.restartAnim(this.anims[t])},restartAnim:function(t){-1!==this.activeAnims.indexOf(t)?t.requestRestart():this.startAnim(t)}}),a}),n("j13e/utils/J13AppCacheManager",["require","exports","module","./J13Utils","./J13EventDispatcher"],function(t,e,i){"use strict";var s=t("./J13Utils"),t=t("./J13EventDispatcher");function n(t){t=t||{};this.appCache=t.appCache,this.reloadOnNewUpdate=t.reloadOnNewUpdate,this.finished=!1}return n.events={CHECKING:"checking",LOADNORMALLY:"loadnormally",UPDATINGCACHE:"updatingcache",UPDATEPROGRESS:"updateprogress",UPDATEREADY:"updateready"},n.prototype=s.inherit(new t,{events:n.events,init:function(){if(this.appCache)if(this.appCache.status===this.appCache.UNCACHED)this.loadNormally();else switch(this.appCache.status){case this.appCache.IDLE:case this.appCache.DOWNLOADING:case this.appCache.CHECKING:this.appCache.addEventListener("checking",this.checking.bind(this),!1),this.appCache.addEventListener("noupdate",this.loadNormally.bind(this),!1),this.appCache.addEventListener("obsolete",this.loadNormally.bind(this),!1),this.appCache.addEventListener("error",this.loadNormally.bind(this),!1),this.appCache.addEventListener("cached",this.loadNormally.bind(this),!1),this.appCache.addEventListener("downloading",this.updatingCache.bind(this),!1),this.appCache.addEventListener("progress",this.updateProgress.bind(this),!1),this.appCache.addEventListener("updateready",this.updateReady.bind(this),!1);try{this.appCache.update()}catch(t){this.loadNormally()}break;case this.appCache.UPDATEREADY:this.updateReady();break;case this.appCache.OBSOLETE:this.loadNormally()}else this.loadNormally()},checking:function(t){this.finished||this.dispatch(this.events.CHECKING,{appCache:this.appCache,originalEvent:t})},loadNormally:function(t){this.finished||(this.finished=!0,this.dispatch(this.events.LOADNORMALLY,{appCache:this.appCache,originalEvent:t}))},updateProgress:function(t){this.finished||this.dispatch(this.events.UPDATEPROGRESS,{appCache:this.appCache,originalEvent:t,lengthComputable:t.lengthComputable,total:t.total,loaded:t.loaded})},updatingCache:function(t){this.finished||this.dispatch(this.events.UPDATINGCACHE,{appCache:this.appCache,originalEvent:t})},updateReady:function(t){if(!this.finished){this.finished=!0,this.dispatch(this.events.UPDATEREADY,{appCache:this.appCache,originalEvent:t});try{this.appCache.swapCache()}catch(t){}this.reloadOnNewUpdate&&location.reload()}}}),n}),n("j13e/display/J13DisplayStage",["require","exports","module","./J13DisplayItemContainer","../utils/J13Utils"],function(t,e,i){"use strict";var s=t("./J13DisplayItemContainer"),t=t("../utils/J13Utils");function n(t){var e=t||{};s.call(this,t),this.engine=e.engine||null,this.mainStage=e.mainStage||!1,this.addListener(s.events.childAdded,this.onAnyChildAdded.bind(this)),this.addListener(s.events.childRemoved,this.onAnyChildRemoved.bind(this))}return n.events={},n.prototype=t.inherit(new s,{events:n.events,onAnyChildAdded:function(t){t.data.child.dispatchAddedToStage(this)},onAnyChildRemoved:function(t){t.data.child.dispatchRemovedFromStage(this)},isOnStage:function(){return this.parent?this.parent.isOnStage():this.mainStage},isVisibleOnStage:function(){return this.parent?this.visible&&this.parent.isVisibleOnStage():this.mainStage}}),n}),n("j13e/input/J13KeyboardManager",["require","exports","module","../utils/J13EventDispatcher","../utils/J13Utils"],function(t,e,i){"use strict";var s=t("../utils/J13EventDispatcher"),t=t("../utils/J13Utils");function n(t){this.keyMap={},this.keys=n.keys,window.addEventListener("keydown",this.keyDown.bind(this),!1),window.addEventListener("keyup",this.keyUp.bind(this),!1),window.addEventListener("keypress",this.keyPress.bind(this),!1)}return n.events={DOWN:"down",UP:"up",PRESS:"press"},n.keys={ENTER:8,SHIFT:16,CTRL:17,ALT:18,TAB:9,BACKSPACE:8,SPACE:32,CAPSLOCK:20,ESCAPE:27,";":186,SEMICOLON:186,"=":187,EQUALS:187,",":188,COMMA:188,"-":189,DASH:189,".":190,PERIOD:190,"/":191,FORWARDSLASH:191,"`":192,GRAVEACCENT:192,"[":219,OPENBRACKET:219,"\\":220,BACKSLASH:220,"]":221,CLOSEBRACKET:221,"'":222,SINGLEQUOTE:222,NUMPAD0:96,NUMPAD1:97,NUMPAD2:98,NUMPAD3:99,NUMPAD4:100,NUMPAD5:101,NUMPAD6:102,NUMPAD7:103,NUMPAD8:104,NUMPAD9:105,MULTIPLY:106,ADD:107,SUBTRACT:109,DECIMALPOINT:110,DIVIDE:111,0:48,ZERO:48,1:49,ONE:49,2:50,TWO:50,3:51,THREE:51,4:52,FOUR:52,5:53,FIVE:53,6:54,SIX:54,7:55,SEVEN:55,8:56,EIGHT:56,9:57,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,ARROWLEFT:37,ARROWUP:38,ARROWRIGHT:39,ARROWDOWN:40},n.prototype=t.inherit(new s,{events:n.events,keys:n.keys,keyDown:function(t){this.keyMap[t.keyCode]||(this.keyMap[t.keyCode]=!0,this.dispatch(this.events.DOWN,{keyCode:t.keyCode,keyMap:this.keyMap,originalEvent:t}))},keyUp:function(t){this.keyMap[t.keyCode]&&(this.keyMap[t.keyCode]=!1,this.dispatch(this.events.UP,{keyCode:t.keyCode,keyMap:this.keyMap,originalEvent:t}))},keyPress:function(t){this.dispatch(this.events.PRESS,{keyCode:t.keyCode,keyMap:this.keyMap,originalEvent:t})},isKeyDown:function(t){return this.keyMap[t]||!1},isKeyUp:function(t){return!this.keyMap[t]}}),n}),n("j13e/input/J13MouseManager",["require","exports","module","../utils/J13Utils","../utils/J13EventDispatcher"],function(t,e,i){"use strict";var s=t("../utils/J13Utils"),t=t("../utils/J13EventDispatcher");function n(t){t=t||{};this.element=t.element,this.element.addEventListener("mousedown",this.mouseDown.bind(this),!1),this.element.addEventListener("mousemove",this.mouseMove.bind(this),!1),this.element.addEventListener("mouseup",this.mouseUp.bind(this),!1),this.element.addEventListener("click",this.mouseClick.bind(this),!1),this.element.addEventListener("touchstart",this.touchStart.bind(this),!1),this.element.addEventListener("touchmove",this.touchMove.bind(this),!1),this.element.addEventListener("touchend",this.touchEnd.bind(this),!1),this.enableMouseInputs=!0,this.enableTouchInputs=!0,this.numTouch=0,this.skipMouseDown=0,this.skipMouseUp=0,this.skipMouseClicks=0,this.mouseX=0,this.mouseY=0,this.scaledMouseX=0,this.scaledMouseY=0,this.scaleX=1,this.scaleY=1,this.zealousTouchDetect=!!t.hasOwnProperty("zealousTouchDetect")&&t.zealousTouchDetect,this.touchDetected=!1}return n.events={DOWN:"down",MOVE:"move",UP:"up",CLICK:"click",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEUP:"mouseup",MOUSECLICK:"mouseclick",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend"},n.prototype=s.inherit(new t,{events:n.events,resize:function(t){},resetSkips:function(){this.skipMouseDown=0,this.skipMouseUp=0},updateMousePos:function(t){var e=t.target.getBoundingClientRect(),i=e.left,e=e.top,s=0,n=0;switch(t.type){case"touchstart":case"touchmove":case"touchend":s=t.changedTouches[0].pageX,n=t.changedTouches[0].pageY;break;case"mousedown":case"mousemove":case"mouseup":case"click":s=t.pageX,n=t.pageY}n-=e,this.mouseX=s-=i,this.mouseY=n,this.scaledMouseX=Math.round(s*this.scaleX),this.scaledMouseY=Math.round(n*this.scaleY)},mouseDown:function(t){t.preventDefault(),t.stopPropagation(),this.enableMouseInputs&&(this.updateMousePos(t),this.dispatch(this.events.MOUSEDOWN,{originalEvent:t,x:this.mouseX,y:this.mouseY,scaledX:this.scaledMouseX,scaledY:this.scaledMouseY}),0this.maxFrameDelay?this.maxFrameDelay:t)/1e3,this.engineContext.dtm=t,this.engineContext.dts=e,this.engineContext.time=s,this.logicLoopEnabled)for(this.fixedAccumulator+=t,i=0;this.fixedAccumulator>=this.fixedDTM&&iu.height)&&(l=a,h=Math.floor(o*l)):(iu.width)&&(h=n,l=Math.floor(h/o)),this.canvasCon.style.width=h+"px",this.canvasCon.style.height=l+"px",d.mouseManager.scaleX=d.mouseManager.scaleY=u.width/h)},start:function(t){d.loadedImages=d.imgManager.imgs,d.birdSheet=new w({image:d.loadedImages[d.images.flappyYellowSprite],spriteMap:d.spriteMap.birds}),d.volumeSheet=new w({image:d.loadedImages[d.images.volumeSprite],spriteMap:d.spriteMap.volume}),this.playScreen=new m({game:this,width:u.width,height:u.height,visible:!1,kikButtonCallback:this.kikShare.bind(this)}),this.stage.addChild(this.playScreen),this.gsm.toState(d.gameStates.mainMenu)},openMenu:function(t){this.gsm.getCurrentStateId()!==d.gameStates.mainMenu&&this.gsm.toState(d.gameStates.mainMenu)},logicLoop:function(t){var t=t.data,e=t.fixedDTM,i=t.fixedDTS,s=t.time;(new Date).getTime();t.started&&this.playScreen.update(e,i,s,t);(new Date).getTime();this.lastLogicTime=(new Date).getTime()},enterRenderLoop:function(t){this.debugRenderStartTime=(new Date).getTime()},exitRenderLoop:function(t){this.debugRenderEndTime=(new Date).getTime();this.debugRenderEndTime,this.debugRenderEndTime},getNumPlays:function(){return this.playScreen.numPlays},kikShare:function(t){window.cards&&window.cards.kik&&window.kik.send({title:"I got "+this.playScreen.playViewport.bounces+" bounces on Bouncy Flappy!",text:"Do you think you can bounce more?",pic:"/imgs/favicon-96.png",data:{score:this.playScreen.playViewport.bounces,date:Date.now()}})},crazyGamesBackButtonCallback:function(){window.location.href=this.initialUrlQuery.back_url||"http://crazygames.com"},trace:function(t){this.engine.debugManager&&this.engine.debugManager.output&&(this.engine.debugManager.output.innerHTML=t||"")}}),I}),n("src/analytics",["require","src/Settings","cocoonjs/CocoonInclude"],function(t){var i,s,n,e,a,o,r,h,l=t("src/Settings"),d=t("cocoonjs/CocoonInclude");return l.cocoon?window.cordova||(i=!1,s=[],n=function(){for(var t;t=s.shift();)t=t,console.log("Sending "+t+" to the Webview"),d.App.forwardAsync(t)},window.gaInterfaceIsReady=function(){d.App.forwardAsync("CocoonJS.App.show(0, 0, "+window.innerWidth*window.devicePixelRatio+","+window.innerHeight*window.devicePixelRatio+");",function(){i=!0,n()})},console.log("Creating GAI interface"),d.App.loadInTheWebView("https://more.gamemix.com/cocoonoverlay.html?currentGame=undeadescape"),window.ga=function(){for(var t="",e=0;e