this.renderSession={},this.renderSession.game=this.game,this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.blendModeManager=this.blendModeManager,this.renderSession.spriteBatch=this.spriteBatch,this.renderSession.stencilManager=this.stencilManager,this.renderSession.renderer=this,this.renderSession.resolution=this.resolution,this.initContext(),this.mapBlendModes()},b.WebGLRenderer.prototype.constructor=b.WebGLRenderer,b.WebGLRenderer.prototype.initContext=function(){vara=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=a,!a)thrownewError("This browser does not support webGL. Try using the canvas renderer");this.glContextId=a.id=b.WebGLRenderer.glContextId++,b.glContexts[this.glContextId]=a,b.instances[this.glContextId]=this,a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.enable(a.BLEND),this.shaderManager.setContext(a),this.spriteBatch.setContext(a),this.maskManager.setContext(a),this.filterManager.setContext(a),this.blendModeManager.setContext(a),this.stencilManager.setContext(a),this.renderSession.gl=this.gl,this.resize(this.width,this.height)},b.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){a.updateTransform();varb=this.gl;b.viewport(0,0,this.width,this.height),b.bindFramebuffer(b.FRAMEBUFFER,null),this.game.clearBeforeRender&&(b.clearColor(a._bgColor.r,a._bgColor.g,a._bgColor.b,a._bgColor.a),b.clear(b.COLOR_BUFFER_BIT)),this.offset.x=this.game.camera._shake.x,this.offset.y=this.game.camera._shake.y,this.renderDisplayObject(a,this.projection)}},b.WebGLRenderer.prototype.renderDisplayObject=function(a,c,d,e){this.renderSession.blendModeManager.setBlendMode(b.blendModes.NORMAL),this.renderSession.drawCount=0,this.renderSession.flipY=d?-1:1,this.renderSession.projection=c,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,d),a._renderWebGL(this.renderSession,e),this.spriteBatch.end()},b.WebGLRenderer.prototype.resize=function(a,b){this.width=a*this.resolution,this.height=b*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px"),this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2/this.resolution,this.projection.y=-this.height/2/this.resolution},b.WebGLRenderer.prototype.updateTexture=function(a){if(!a.hasLoaded)return!1;varc=this.gl;returna._glTextures[c.id]||(a._glTextures[c.id]=c.createTexture()),c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultipliedAlpha),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a.mipmap&&b.isPowerOfTwo(a.width,a.height)?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR_MIPMAP_LINEAR:c.NEAREST_MIPMAP_NEAREST),c.generateMipmap(c.TEXTURE_2D)):c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),a._dirty[c.id]=!1,!0},b.WebGLRenderer.prototype.destroy=function(){b.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null,b.CanvasPool.remove(this),b.instances[this.glContextId]=null,b.WebGLRenderer.glContextId--},
this.onStateChange.dispatch(this.current,a),this.current!==this._pendingState)return;this._pendingState=null,this.onPreloadCallback?(this.game.load.reset(!0),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()&&0===this.game.load.totalQueuedPacks()?this.loadComplete():this.game.load.start()):this.loadComplete()}},clearCurrentState:function(){this.current&&(this.onShutDownCallback&&this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this.game.scale.reset(this._clearWorld),this.game.debug&&this.game.debug.reset(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache&&this.game.cache.destroy()))},checkState:function(a){returnthis.states[a]?this.states[a].preload||this.states[a].create||this.states[a].update||this.states[a].render?!0:(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):(console.warn("Phaser.StateManager - No state found with the key: "+a),!1)},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics,this.states[a].key=a},unlink:function(a){this.states[a]&&(this.states[a].game=null,this.states[a].add=null,this.states[a].make=null,this.states[a].camera=null,this.states[a].cache=null,this.states[a].input=null,this.states[a].load=null,this.states[a].math=null,this.states[a].sound=null,this.states[a].scale=null,this.states[a].state=null,this.states[a].stage=null,this.states[a].time=null,this.states[a].tweens=null,this.states[a].world=null,this.states[a].particles=null,this.states[a].rnd=null,this.states[a].physics=null)},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onResizeCallback=this.states[a].resize||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onPauseUpdateCallback=this.states[a].pauseUpdate||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,""!==this.current&&this.game.physics.reset(),this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),a===this._pendingState&&(this._args=[]),this.game._kickstart=!0},getCurrentState:function(){returnthis.states[this.current]},loadComplete:function(){this._created===!1&&this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game),this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created?this.onUpdateCallback&&this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game
if(Array.isArray(f))for(varh=0,i=0;i<e.length;i++)i>0&&(h+=f[i-1]),g=b+h,d?this.context.fillText(e[i],g,c):this.context.strokeText(e[i],g,c);elsefor(vari=0;i<e.length;i++){varj=Math.ceil(this.context.measureText(e[i]).width);g=this.game.math.snapToCeil(b,f),d?this.context.fillText(e[i],g,c):this.context.strokeText(e[i],g,c),b=g+j}},c.Text.prototype.updateShadow=function(a){a?(this.context.shadowOffsetX=this.style.shadowOffsetX,this.context.shadowOffsetY=this.style.shadowOffsetY,this.context.shadowColor=this.style.shadowColor,this.context.shadowBlur=this.style.shadowBlur):(this.context.shadowOffsetX=0,this.context.shadowOffsetY=0,this.context.shadowColor=0,this.context.shadowBlur=0)},c.Text.prototype.updateLine=function(a,b,c){for(vard=0;d<a.length;d++){vare=a[d];if(this.fontWeights.length>0||this.fontStyles.length>0){varf=this.fontToComponents(this.context.font);this.fontStyles[this._charCount]&&(f.fontStyle=this.fontStyles[this._charCount]),this.fontWeights[this._charCount]&&(f.fontWeight=this.fontWeights[this._charCount]),this.context.font=this.componentsToFont(f)}this.style.stroke&&this.style.strokeThickness&&(this.strokeColors[this._charCount]&&(this.context.strokeStyle=this.strokeColors[this._charCount]),this.updateShadow(this.style.shadowStroke),this.context.strokeText(e,b,c)),this.style.fill&&(this.colors[this._charCount]&&(this.context.fillStyle=this.colors[this._charCount]),this.updateShadow(this.style.shadowFill),this.context.fillText(e,b,c)),b+=this.context.measureText(e).width,this._charCount++}},c.Text.prototype.clearColors=function(){returnthis.colors=[],this.strokeColors=[],this.dirty=!0,this},c.Text.prototype.clearFontValues=function(){returnthis.fontStyles=[],this.fontWeights=[],this.dirty=!0,this},c.Text.prototype.addColor=function(a,b){returnthis.colors[b]=a,this.dirty=!0,this},c.Text.prototype.addStrokeColor=function(a,b){returnthis.strokeColors[b]=a,this.dirty=!0,this},c.Text.prototype.addFontStyle=function(a,b){returnthis.fontStyles[b]=a,this.dirty=!0,this},c.Text.prototype.addFontWeight=function(a,b){returnthis.fontWeights[b]=a,this.dirty=!0,this},c.Text.prototype.precalculateWordWrap=function(a){this.texture.baseTexture.resolution=this._res,this.context.font=this.style.font;varb=this.runWordWrap(a);returnb.split(/(?:\r\n|\r|\n)/)},c.Text.prototype.runWordWrap=function(a){returnthis.useAdvancedWrap?this.advancedWordWrap(a):this.basicWordWrap(a)},c.Text.prototype.advancedWordWrap=function(a){for(varb=this.context,c=this.style.wordWrapWidth,d="",e=a.replace(/ +/gi," ").split(/\r?\n/gi),f=e.length,g=0;f>g;g++){varh=e[g],i="";h=h.replace(/^ *|\s*$/gi,"");varj=b.measureText(h).width;if(c>j)d+=h+"\n";else{for(vark=c,l=h.split(" "),m=0;m<l.length;m++){varn=l[m],o=n+" ",p=b.measureText(o).width;if(p>k){if(0===m){for(varq=o;q.length&&(q=q.slice(0,-1),p=b.measureText(q).width,!(k>=p)););if(!q.length)thrownewError("This text's wordWrapWidth setting is less than a single character!");varr=n.substr(q.length);l[m]=r,i+=q}vars=l[m].length?m:m+1,t=l.slice(s).join(" ").replace(/[ \n]*$/gi,"");e[g+1]=t+" "+(e[g+1]||""),f=e.length;break}i+=o,k-=p}d+=i.replace(/[ \n]*$/gi,"")+"\n"}}returnd=d.replace(/[\s|\n]*$/gi,"")},c.Text.prototype.basicWordWrap=function(a){for(varb="",c=a.split("\n"),d=0;d<c.length;d++){for(vare=this.style.wordWrapWidth,f=c[d].split(" "),g=0;g<f.length;g++){varh=this.context.measureText(f[g]).width,i=h+this.context.measureText(" ").width;i>e?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d<c.length-1&&(b+="\n")}returnb},c.Text.prototype.updateFont=function(a){varb=this.componentsToFont(a);this.style.font!==b&&(this.style.font=b,this.dirty=!0,this.parent&&this.updateTransform())},c.Text.prototype.fontToComponents=function(a){varb=a.match(/^\s*(?:\b(normal|italic|oblique|inherit)?\b)\s*(?:\b(normal|small-caps|inherit)?\b)\s*(?:\b(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit)?\b)\s*(?:\b(xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller|0|\d*(?:[.]\d*)?(?:%|[a-z]{2,5}))?\b)\s*(.*)\s*$/);if(b){v
if(l.fullscreen)for(varc=0;c<d.length;c++)if(document[d[c]]){l.cancelFullscreen=d[c];break}window.Element&&Element.ALLOW_KEYBOARD_INPUT&&(l.fullscreenKeyboard=!0)}functione(){vara=navigator.userAgent;if(/Arora/.test(a)?l.arora=!0:/Edge\/\d+/.test(a)?l.edge=!0:/Chrome\/(\d+)/.test(a)&&!l.windowsPhone?(l.chrome=!0,l.chromeVersion=parseInt(RegExp.$1,10)):/Epiphany/.test(a)?l.epiphany=!0:/Firefox\D+(\d+)/.test(a)?(l.firefox=!0,l.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(a)&&l.iOS?l.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(a)?(l.ie=!0,l.ieVersion=parseInt(RegExp.$1,10)):/Midori/.test(a)?l.midori=!0:/Opera/.test(a)?l.opera=!0:/Safari\/(\d+)/.test(a)&&!l.windowsPhone?(l.safari=!0,/Version\/(\d+)\./.test(a)&&(l.safariVersion=parseInt(RegExp.$1,10))):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(a)&&(l.ie=!0,l.trident=!0,l.tridentVersion=parseInt(RegExp.$1,10),l.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(a)&&(l.silk=!0),navigator.standalone&&(l.webApp=!0),"undefined"!=typeofwindow.cordova&&(l.cordova=!0),"undefined"!=typeofprocess&&"undefined"!=typeofrequire&&(l.node=!0),l.node&&"object"==typeofprocess.versions&&(l.nodeWebkit=!!process.versions["node-webkit"],l.electron=!!process.versions.electron),navigator.isCocoonJS&&(l.cocoonJS=!0),l.cocoonJS)try{l.cocoonJSApp="undefined"!=typeofCocoonJS}catch(b){l.cocoonJSApp=!1}"undefined"!=typeofwindow.ejecta&&(l.ejecta=!0),/Crosswalk/.test(a)&&(l.crosswalk=!0)}functionf(){vara=document.createElement("video"),b=!1;try{(b=!!a.canPlayType)&&(a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(l.oggVideo=!0),a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(l.h264Video=!0,l.mp4Video=!0),a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(l.webmVideo=!0),a.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(l.vp9Video=!0),a.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(l.hlsVideo=!0))}catch(c){}}functiong(){l.audioData=!!window.Audio,l.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);vara=document.createElement("audio"),b=!1;try{if((b=!!a.canPlayType)&&(a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(l.ogg=!0),(a.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||a.canPlayType("audio/opus;").replace(/^no$/,""))&&(l.opus=!0),a.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(l.mp3=!0),a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(l.wav=!0),(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;").replace(/^no$/,""))&&(l.m4a=!0),a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(l.webm=!0),""!==a.canPlayType('audio/mp4;codecs="ec-3"')))if(l.edge)l.dolby=!0;elseif(l.safari&&l.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){varc=parseInt(RegExp.$1,10),d=parseInt(RegExp.$2,10);(10===c&&d>=11||c>10)&&(l.dolby=!0)}}catch(e){}}functionh(){l.pixelRatio=window.devicePixelRatio||1,l.iPhone=-1!=navigator.userAgent.toLowerCase().indexOf("iphone"),l.iPhone4=2==l.pixelRatio&&l.iPhone,l.iPad=-1!=navigator.userAgent.toLowerCase().indexOf("ipad"),"undefined"!=typeofInt8Array?l.typedArray=!0:l.typedArray=!1,"undefined"!=typeofArrayBuffer&&"undefined"!=typeofUint8Array&&"undefined"!=typeofUint32Array&&(l.littleEndian=i(),l.LITTLE_ENDIAN=l.littleEndian),l.support32bit="undefined"!=typeofArrayBuffer&&"undefined"!=typeofUint8ClampedArray&&"undefined"!=typeofInt32Array&&null!==l.littleEndian&&j(),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(l.vibration=!0)}functioni(){vara=newArrayBuffer(4),b=newUint8Array(a),c=newUint32Array(a);returnb[0]=161,b[1]=178,b[2]=195,b[3]=212,3569595041==c[0]?!0:2712847316==c[0]?!1:null}functionj(){if(void0===Uint8ClampedArray)return!1;vara=PIXI.CanvasPool.create(this,1,1),b=a.getContext("2d");if(!b)return!1;varc=b.createImageData(1,1);returnPIXI.CanvasPool.remove(this),c.datainstanceofUint8ClampedArray}functionk(){vara,b=document.createElement("p"),c={webkitTransform:"-webkit-t
c.data.load())},reloadSoundComplete:function(a){varb=this.getSound(a);b&&(b.locked=!1,this.onSoundUnlock.dispatch(a))},updateSound:function(a,b,c){vard=this.getSound(a);d&&(d[b]=c)},decodedSound:function(a,b){varc=this.getSound(a);c.data=b,c.decoded=!0,c.isDecoding=!1},isSoundDecoded:function(a){varb=this.getItem(a,c.Cache.SOUND,"isSoundDecoded");returnb?b.decoded:void0},isSoundReady:function(a){varb=this.getItem(a,c.Cache.SOUND,"isSoundDecoded");returnb?b.decoded&&!this.game.sound.touchLocked:void0},checkKey:function(a,b){returnthis._cacheMap[a][b]?!0:!1},checkURL:function(a){returnthis._urlMap[this._resolveURL(a)]?!0:!1},checkCanvasKey:function(a){returnthis.checkKey(c.Cache.CANVAS,a)},checkImageKey:function(a){returnthis.checkKey(c.Cache.IMAGE,a)},checkTextureKey:function(a){returnthis.checkKey(c.Cache.TEXTURE,a)},checkSoundKey:function(a){returnthis.checkKey(c.Cache.SOUND,a)},checkTextKey:function(a){returnthis.checkKey(c.Cache.TEXT,a)},checkPhysicsKey:function(a){returnthis.checkKey(c.Cache.PHYSICS,a)},checkTilemapKey:function(a){returnthis.checkKey(c.Cache.TILEMAP,a)},checkBinaryKey:function(a){returnthis.checkKey(c.Cache.BINARY,a)},checkBitmapDataKey:function(a){returnthis.checkKey(c.Cache.BITMAPDATA,a)},checkBitmapFontKey:function(a){returnthis.checkKey(c.Cache.BITMAPFONT,a)},checkJSONKey:function(a){returnthis.checkKey(c.Cache.JSON,a)},checkXMLKey:function(a){returnthis.checkKey(c.Cache.XML,a)},checkVideoKey:function(a){returnthis.checkKey(c.Cache.VIDEO,a)},checkShaderKey:function(a){returnthis.checkKey(c.Cache.SHADER,a)},checkRenderTextureKey:function(a){returnthis.checkKey(c.Cache.RENDER_TEXTURE,a)},getItem:function(a,b,c,d){returnthis.checkKey(b,a)?void0===d?this._cacheMap[b][a]:this._cacheMap[b][a][d]:(c&&console.warn("Phaser.Cache."+c+': Key "'+a+'" not found in Cache.'),null)},getCanvas:function(a){returnthis.getItem(a,c.Cache.CANVAS,"getCanvas","canvas")},getImage:function(a,b){(void0===a||null===a)&&(a="__default"),void0===b&&(b=!1);vard=this.getItem(a,c.Cache.IMAGE,"getImage");returnnull===d&&(d=this.getItem("__missing",c.Cache.IMAGE,"getImage")),b?d:d.data},getTextureFrame:function(a){returnthis.getItem(a,c.Cache.TEXTURE,"getTextureFrame","frame")},getSound:function(a){returnthis.getItem(a,c.Cache.SOUND,"getSound")},getSoundData:function(a){returnthis.getItem(a,c.Cache.SOUND,"getSoundData","data")},getText:function(a){returnthis.getItem(a,c.Cache.TEXT,"getText","data")},getPhysicsData:function(a,b,d){vare=this.getItem(a,c.Cache.PHYSICS,"getPhysicsData","data");if(null===e||void0===b||null===b)returne;if(e[b]){varf=e[b];if(!f||!d)returnf;for(varginf)if(g=f[g],g.fixtureKey===d)returng;console.warn('Phaser.Cache.getPhysicsData: Could not find given fixtureKey: "'+d+" in "+a+'"')}elseconsole.warn('Phaser.Cache.getPhysicsData: Invalid key/object: "'+a+" / "+b+'"');returnnull},getTilemapData:function(a){returnthis.getItem(a,c.Cache.TILEMAP,"getTilemapData")},getBinary:function(a){returnthis.getItem(a,c.Cache.BINARY,"getBinary")},getBitmapData:function(a){returnthis.getItem(a,c.Cache.BITMAPDATA,"getBitmapData","data")},getBitmapFont:function(a){returnthis.getItem(a,c.Cache.BITMAPFONT,"getBitmapFont")},getJSON:function(a,b){vard=this.getItem(a,c.Cache.JSON,"getJSON","data");returnd?b?c.Utils.extend(!0,d):d:null},getXML:function(a){returnthis.getItem(a,c.Cache.XML,"getXML","data")},getVideo:function(a){returnthis.getItem(a,c.Cache.VIDEO,"getVideo")},getShader:function(a){returnthis.getItem(a,c.Cache.SHADER,"getShader","data")},getRenderTexture:function(a){returnthis.getItem(a,c.Cache.RENDER_TEXTURE,"getRenderTexture")},getBaseTexture:function(a,b){returnvoid0===b&&(b=c.Cache.IMAGE),this.getItem(a,b,"getBaseTexture","base")},getFrame:function(a,b){returnvoid0===b&&(b=c.Cache.IMAGE),this.getItem(a,b,"getFrame","frame")},getFrameCount:function(a,b){varc=this.getFrameData(a,b);returnc?c.total:0},getFrameData:function(a,b){returnvoid0===b&&(b=c.Cache.IMAGE),this.getItem(a,b,"getFrameData","frameData")},hasFrameData:function(a,b){returnvoid0===b&&(b
returnc.Color.blendOverlay(b,a)},blendColorDodge:function(a,b){return255===b?b:Math.min(255,(a<<8)/(255-b))},blendColorBurn:function(a,b){return0===b?b:Math.max(0,255-(255-a<<8)/b)},blendLinearDodge:function(a,b){returnc.Color.blendAdd(a,b)},blendLinearBurn:function(a,b){returnc.Color.blendSubtract(a,b)},blendLinearLight:function(a,b){return128>b?c.Color.blendLinearBurn(a,2*b):c.Color.blendLinearDodge(a,2*(b-128))},blendVividLight:function(a,b){return128>b?c.Color.blendColorBurn(a,2*b):c.Color.blendColorDodge(a,2*(b-128))},blendPinLight:function(a,b){return128>b?c.Color.blendDarken(a,2*b):c.Color.blendLighten(a,2*(b-128))},blendHardMix:function(a,b){returnc.Color.blendVividLight(a,b)<128?0:255},blendReflect:function(a,b){return255===b?b:Math.min(255,a*a/(255-b))},blendGlow:function(a,b){returnc.Color.blendReflect(b,a)},blendPhoenix:function(a,b){returnMath.min(a,b)-Math.max(a,b)+255}},c.Physics=function(a,b){b=b||{},this.game=a,this.config=b,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.matter=null,this.parseConfig()},c.Physics.ARCADE=0,c.Physics.P2JS=1,c.Physics.NINJA=2,c.Physics.BOX2D=3,c.Physics.CHIPMUNK=4,c.Physics.MATTERJS=5,c.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&this.config.arcade!==!0||!c.Physics.hasOwnProperty("Arcade")||(this.arcade=newc.Physics.Arcade(this.game)),this.config.hasOwnProperty("ninja")&&this.config.ninja===!0&&c.Physics.hasOwnProperty("Ninja")&&(this.ninja=newc.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&this.config.p2===!0&&c.Physics.hasOwnProperty("P2")&&(this.p2=newc.Physics.P2(this.game,this.config)),this.config.hasOwnProperty("box2d")&&this.config.box2d===!0&&c.Physics.hasOwnProperty("BOX2D")&&(this.box2d=newc.Physics.BOX2D(this.game,this.config)),this.config.hasOwnProperty("matter")&&this.config.matter===!0&&c.Physics.hasOwnProperty("Matter")&&(this.matter=newc.Physics.Matter(this.game,this.config))},startSystem:function(a){a===c.Physics.ARCADE?this.arcade=newc.Physics.Arcade(this.game):a===c.Physics.P2JS?null===this.p2?this.p2=newc.Physics.P2(this.game,this.config):this.p2.reset():a===c.Physics.NINJA?this.ninja=newc.Physics.Ninja(this.game):a===c.Physics.BOX2D?null===this.box2d?this.box2d=newc.Physics.Box2D(this.game,this.config):this.box2d.reset():a===c.Physics.MATTERJS&&(null===this.matter?this.matter=newc.Physics.Matter(this.game,this.config):this.matter.reset())},enable:function(a,b,d){void0===b&&(b=c.Physics.ARCADE),void0===d&&(d=!1),b===c.Physics.ARCADE?this.arcade.enable(a):b===c.Physics.P2JS&&this.p2?this.p2.enable(a,d):b===c.Physics.NINJA&&this.ninja?this.ninja.enableAABB(a):b===c.Physics.BOX2D&&this.box2d?this.box2d.enable(a):b===c.Physics.MATTERJS&&this.matter?this.matter.enable(a):console.warn(a.key+" is attempting to enable a physics body using an unknown physics system.")},preUpdate:function(){this.p2&&this.p2.preUpdate(),this.box2d&&this.box2d.preUpdate(),this.matter&&this.matter.preUpdate()},update:function(){this.p2&&this.p2.update(),this.box2d&&this.box2d.update(),this.matter&&this.matter.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld(),this.box2d&&this.box2d.setBoundsToWorld(),this.matter&&this.matter.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear(),this.box2d&&this.box2d.clear(),this.matter&&this.matter.clear()},reset:function(){this.p2&&this.p2.reset(),this.box2d&&this.box2d.reset(),this.matter&&this.matter.reset()},destroy:function(){this.p2&&this.p2.destroy(),this.box2d&&this.box2d.destroy(),this.matter&&this.matter.destroy(),this.arcade=null,this.ninja=null,this.p2=null,this.box2d=null,this.matter=null}},c.Physics.prototype.constructor=c.Physics,c.Particles=function(a){this.game=a,this.emitters={},this.ID=0},c.Particles.prototype={add:function(a){returnthis.emitters[a.name]=a,a},remove:function(a){deletethis.emitters[a.name]},update:function(){for(varainthis.emitters)this.emitters[a].exists&&this.emitters[a].update()}},