var PIXI=PIXI||{};var Phaser=Phaser||{VERSION:"1.0.0",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2};PIXI.InteractionManager=function(c){};Phaser.Utils={isPlainObject:function(d){if(typeof(d)!=="object"||d.nodeType||d===d.window){return false}try{if(d.constructor&&!hasOwn.call(d.constructor.prototype,"isPrototypeOf")){return false}}catch(c){return false}return true},extend:function(){var n,e,c,d,k,l,j=arguments[0]||{},h=1,f=arguments.length,m=false;if(typeof j==="boolean"){m=j;j=arguments[1]||{};h=2}if(f===h){j=this;--h}for(;h>16&255)/255,(c>>8&255)/255,(c&255)/255]}if(typeof Function.prototype.bind!="function"){Function.prototype.bind=(function(){var c=Array.prototype.slice;return function(d){var h=this,i=c.call(arguments,1);if(typeof h!="function"){throw new TypeError()}function e(){var j=i.concat(c.call(arguments));h.apply(this instanceof e?this:d,j)}e.prototype=(function f(j){j&&(f.prototype=j);if(!(this instanceof f)){return new f}})(h.prototype);return e}})()}function determineMatrixArrayType(){PIXI.Matrix=(typeof Float32Array!=="undefined")?Float32Array:Array;return PIXI.Matrix}determineMatrixArrayType();PIXI.mat3={};PIXI.mat3.create=function(){var c=new PIXI.Matrix(9);c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=1;c[5]=0;c[6]=0;c[7]=0;c[8]=1;return c};PIXI.mat3.identity=function(c){c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=1;c[5]=0;c[6]=0;c[7]=0;c[8]=1;return c};PIXI.mat4={};PIXI.mat4.create=function(){var c=new PIXI.Matrix(16);c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=0;c[5]=1;c[6]=0;c[7]=0;c[8]=0;c[9]=0;c[10]=1;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c};PIXI.mat3.multiply=function(t,j,k){if(!k){k=t}var A=t[0],z=t[1],w=t[2],i=t[3],h=t[4],f=t[5],q=t[6],p=t[7],o=t[8],n=j[0],m=j[1],l=j[2],v=j[3],u=j[4],s=j[5],e=j[6],d=j[7],c=j[8];k[0]=n*A+m*i+l*q;k[1]=n*z+m*h+l*p;k[2]=n*w+m*f+l*o;k[3]=v*A+u*i+s*q;k[4]=v*z+u*h+s*p;k[5]=v*w+u*f+s*o;k[6]=e*A+d*i+c*q;k[7]=e*z+d*h+c*p;k[8]=e*w+d*f+c*o;return k};PIXI.mat3.clone=function(d){var c=new PIXI.Matrix(9);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];return c};PIXI.mat3.transpose=function(e,d){if(!d||e===d){var h=e[1],f=e[2],c=e[5];e[1]=e[3];e[2]=e[6];e[3]=h;e[5]=e[7];e[6]=f;e[7]=c;return e}d[0]=e[0];d[1]=e[3];d[2]=e[6];d[3]=e[1];d[4]=e[4];d[5]=e[7];d[6]=e[2];d[7]=e[5];d[8]=e[8];return d};PIXI.mat3.toMat4=function(d,c){if(!c){c=PIXI.mat4.create()}c[15]=1;c[14]=0;c[13]=0;c[12]=0;c[11]=0;c[10]=d[8];c[9]=d[7];c[8]=d[6];c[7]=0;c[6]=d[5];c[5]=d[4];c[4]=d[3];c[3]=0;c[2]=d[2];c[1]=d[1];c[0]=d[0];return c};PIXI.mat4.create=function(){var c=new PIXI.Matrix(16);c[0]=1;c[1]=0;c[2]=0;c[3]=0;c[4]=0;c[5]=1;c[6]=0;c[7]=0;c[8]=0;c[9]=0;c[10]=1;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c};PIXI.mat4.transpose=function(f,e){if(!e||f===e){var k=f[1],i=f[2],h=f[3],c=f[6],j=f[7],d=f[11];f[1]=f[4];f[2]=f[8];f[3]=f[12];f[4]=k;f[6]=f[9];f[7]=f[13];f[8]=i;f[9]=c;f[11]=f[14];f[12]=h;f[13]=j;f[14]=d;return f}e[0]=f[0];e[1]=f[4];e[2]=f[8];e[3]=f[12];e[4]=f[1];e[5]=f[5];e[6]=f[9];e[7]=f[13];e[8]=f[2];e[9]=f[6];e[10]=f[10];e[11]=f[14];e[12]=f[3];e[13]=f[7];e[14]=f[11];e[15]=f[15];return e};PIXI.mat4.multiply=function(s,k,m){if(!m){m=s}var A=s[0],z=s[1],v=s[2],t=s[3];var j=s[4],h=s[5],e=s[6],c=s[7];var q=s[8],p=s[9],o=s[10],n=s[11];var C=s[12],B=s[13],w=s[14],u=s[15];var l=k[0],i=k[1],f=k[2],d=k[3];m[0]=l*A+i*j+f*q+d*C;m[1]=l*z+i*h+f*p+d*B;m[2]=l*v+i*e+f*o+d*w;m[3]=l*t+i*c+f*n+d*u;l=k[4];i=k[5];f=k[6];d=k[7];m[4]=l*A+i*j+f*q+d*C;m[5]=l*z+i*h+f*p+d*B;m[6]=l*v+i*e+f*o+d*w;m[7]=l*t+i*c+f*n+d*u;l=k[8];i=k[9];f=k[10];d=k[11];m[8]=l*A+i*j+f*q+d*C;m[9]=l*z+i*h+f*p+d*B;m[10]=l*v+i*e+f*o+d*w;m[11]=l*t+i*c+f*n+d*u;l=k[12];i=k[13];f=k[14];d=k[15];m[12]=l*A+i*j+f*q+d*C;m[13]=l*z+i*h+f*p+d*B;m[14]=l*v+i*e+f*o+d*w;m[15]=l*t+i*c+f*n+d*u;return m};PIXI.Point=function(c,d){this.x=c||0;this.y=d||0};PIXI.Point.prototype.clone=function(){return new PIXI.Point(this.x,this.y)};PIXI.Point.prototype.constructor=PIXI.Point;PIXI.Rectangle=function(d,f,e,c){this.x=d||0;this.y=f||0;this.width=e||0;this.height=c||0};PIXI.Rectangle.prototype.clone=function(){return new PIXI.Rectangle(this.x,this.y,this.width,this.height)};PIXI.Rectangle.prototype.contains=function(c,f){if(this.width<=0||this.height<=0){return false}var d=this.x;if(c>=d&&c<=d+this.width){var e=this.y;if(f>=e&&f<=e+this.height){return true}}return false};PIXI.Rectangle.prototype.constructor=PIXI.Rectangle;PIXI.DisplayObject=function(){this.last=this;this.first=this;this.position=new PIXI.Point();this.scale=new PIXI.Point(1,1);this.pivot=new PIXI.Point(0,0);this.rotation=0;this.alpha=1;this.visible=true;this.hitArea=null;this.buttonMode=false;this.renderable=false;this.parent=null;this.stage=null;this.worldAlpha=1;this._interactive=false;this.worldTransform=PIXI.mat3.create();this.localTransform=PIXI.mat3.create();this.color=[];this.dynamic=true;this._sr=0;this._cr=1};PIXI.DisplayObject.prototype.constructor=PIXI.DisplayObject;PIXI.DisplayObject.prototype.setInteractive=function(c){this.interactive=c};Object.defineProperty(PIXI.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(c){this._interactive=c;if(this.stage){this.stage.dirty=true}}});Object.defineProperty(PIXI.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(c){this._mask=c;if(c){this.addFilter(c)}else{this.removeFilter()}}});PIXI.DisplayObject.prototype.addFilter=function(l){if(this.filter){return}this.filter=true;var c=new PIXI.FilterBlock();var f=new PIXI.FilterBlock();c.mask=l;f.mask=l;c.first=c.last=this;f.first=f.last=this;c.open=true;var e=c;var h=c;var k;var j;j=this.first._iPrev;if(j){k=j._iNext;e._iPrev=j;j._iNext=e}else{k=this}if(k){k._iPrev=h;h._iNext=k}var e=f;var h=f;var k=null;var j=null;j=this.last;k=j._iNext;if(k){k._iPrev=h;h._iNext=k}e._iPrev=j;j._iNext=e;var d=this;var i=this.last;while(d){if(d.last==i){d.last=f}d=d.parent}this.first=c;if(this.__renderGroup){this.__renderGroup.addFilterBlocks(c,f)}l.renderable=false};PIXI.DisplayObject.prototype.removeFilter=function(){if(!this.filter){return}this.filter=false;var e=this.first;var i=e._iNext;var j=e._iPrev;if(i){i._iPrev=j}if(j){j._iNext=i}this.first=e._iNext;var f=this.last;var i=f._iNext;var j=f._iPrev;if(i){i._iPrev=j}j._iNext=i;var h=f._iPrev;var d=this;while(d.last==f){d.last=h;d=d.parent;if(!d){break}}var c=e.mask;c.renderable=true;if(this.__renderGroup){this.__renderGroup.removeFilterBlocks(e,f)}};PIXI.DisplayObject.prototype.updateTransform=function(){if(this.rotation!==this.rotationCache){this.rotationCache=this.rotation;this._sr=Math.sin(this.rotation);this._cr=Math.cos(this.rotation)}var u=this.localTransform;var h=this.parent.worldTransform;var c=this.worldTransform;u[0]=this._cr*this.scale.x;u[1]=-this._sr*this.scale.y;u[3]=this._sr*this.scale.x;u[4]=this._cr*this.scale.y;var p=this.pivot.x;var o=this.pivot.y;var k=u[0],j=u[1],i=this.position.x-u[0]*p-o*u[1],t=u[3],s=u[4],q=this.position.y-u[4]*o-p*u[3],n=h[0],m=h[1],l=h[2],f=h[3],e=h[4],d=h[5];u[2]=i;u[5]=q;c[0]=n*k+m*t;c[1]=n*j+m*s;c[2]=n*i+m*q+l;c[3]=f*k+e*t;c[4]=f*j+e*s;c[5]=f*i+e*q+d;this.worldAlpha=this.alpha*this.parent.worldAlpha;this.vcount=PIXI.visibleCount};PIXI.visibleCount=0;PIXI.DisplayObjectContainer=function(){PIXI.DisplayObject.call(this);this.children=[]};PIXI.DisplayObjectContainer.prototype=Object.create(PIXI.DisplayObject.prototype);PIXI.DisplayObjectContainer.prototype.constructor=PIXI.DisplayObjectContainer;PIXI.DisplayObjectContainer.prototype.addChild=function(k){if(k.parent!=undefined){k.parent.removeChild(k)}k.parent=this;this.children.push(k);if(this.stage){var h=k;do{if(h.interactive){this.stage.dirty=true}h.stage=this.stage;h=h._iNext}while(h)}var f=k.first;var e=k.last;var i;var j;if(this.filter){j=this.last._iPrev}else{j=this.last}i=j._iNext;var d=this;var c=j;while(d){if(d.last==c){d.last=k.last}d=d.parent}if(i){i._iPrev=e;e._iNext=i}f._iPrev=j;j._iNext=f;if(this.__renderGroup){if(k.__renderGroup){k.__renderGroup.removeDisplayObjectAndChildren(k)}this.__renderGroup.addDisplayObjectAndChildren(k)}};PIXI.DisplayObjectContainer.prototype.addChildAt=function(d,h){if(h>=0&&h<=this.children.length){if(d.parent!=undefined){d.parent.removeChild(d)}d.parent=this;if(this.stage){var f=d;do{if(f.interactive){this.stage.dirty=true}f.stage=this.stage;f=f._iNext}while(f)}var e=d.first;var i=d.last;var l;var k;if(h==this.children.length){k=this.last;var c=this;var j=this.last;while(c){if(c.last==j){c.last=d.last}c=c.parent}}else{if(h==0){k=this}else{k=this.children[h-1].last}}l=k._iNext;if(l){l._iPrev=i;i._iNext=l}e._iPrev=k;k._iNext=e;this.children.splice(h,0,d);if(this.__renderGroup){if(d.__renderGroup){d.__renderGroup.removeDisplayObjectAndChildren(d)}this.__renderGroup.addDisplayObjectAndChildren(d)}}else{throw new Error(d+" The index "+h+" supplied is out of bounds "+this.children.length)}};PIXI.DisplayObjectContainer.prototype.swapChildren=function(d,c){return};PIXI.DisplayObjectContainer.prototype.getChildAt=function(c){if(c>=0&&c=this.textures.length){this.gotoAndStop(this.textures.length-1);if(this.onComplete){this.onComplete()}}}};PIXI.Stage=function(d,c){PIXI.DisplayObjectContainer.call(this);this.worldTransform=PIXI.mat3.create();this.interactive=c;this.interactionManager=new PIXI.InteractionManager(this);this.dirty=true;this.__childrenAdded=[];this.__childrenRemoved=[];this.stage=this;this.stage.hitArea=new PIXI.Rectangle(0,0,100000,100000);this.setBackgroundColor(d);this.worldVisible=true};PIXI.Stage.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Stage.prototype.constructor=PIXI.Stage;PIXI.Stage.prototype.updateTransform=function(){this.worldAlpha=1;this.vcount=PIXI.visibleCount;for(var d=0,c=this.children.length;d1){k=1}var e=Math.sqrt(d.x*d.x+d.y*d.y);var h=this.texture.height/2;d.x/=e;d.y/=e;d.x*=h;d.y*=h;c[j]=o.x+d.x;c[j+1]=o.y+d.y;c[j+2]=o.x-d.x;c[j+3]=o.y-d.y;n=o}PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)};PIXI.Rope.prototype.setTexture=function(c){this.texture=c;this.updateFrame=true};PIXI.Spine=function(d){PIXI.DisplayObjectContainer.call(this);this.spineData=PIXI.AnimCache[d];if(!this.spineData){throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+d)}this.skeleton=new spine.Skeleton(this.spineData);this.skeleton.updateWorldTransform();this.stateData=new spine.AnimationStateData(this.spineData);this.state=new spine.AnimationState(this.stateData);this.slotContainers=[];for(var h=0,l=this.skeleton.drawOrder.length;h>>1;while(true){if(d[(h+1)*e]<=i){c=h+1}else{f=h}if(c==f){return(c+1)*e}h=(c+f)>>>1}};spine.linearSearch=function(c,h,f){for(var d=0,e=c.length-f;d<=e;d+=f){if(c[d]>h){return d}}return -1};spine.Curves=function(c){this.curves=[];this.curves.length=(c-1)*6};spine.Curves.prototype={setLinear:function(c){this.curves[c*6]=0},setStepped:function(c){this.curves[c*6]=-1},setCurve:function(l,o,v,n,u){var p=1/10;var k=p*p;var j=k*p;var e=3*p;var d=3*k;var c=6*k;var w=6*j;var t=-o*2+n;var s=-v*2+u;var h=(o-n)*3+1;var f=(v-u)*3+1;var q=l*6;var m=this.curves;m[q]=o*e+t*d+h*j;m[q+1]=v*e+s*d+f*j;m[q+2]=t*c+h*w;m[q+3]=s*c+f*w;m[q+4]=h*w;m[q+5]=f*w},getCurvePercent:function(f,m){m=m<0?0:(m>1?1:m);var k=f*6;var s=this.curves;var c=s[k];if(!c){return m}if(c==-1){return 0}var t=s[k+1];var q=s[k+2];var p=s[k+3];var j=s[k+4];var h=s[k+5];var o=c,n=t;var l=10-2;while(true){if(o>=m){var e=o-c;var d=n-t;return d+(n-d)*(m-e)/(o-e)}if(l==0){break}l--;c+=q;t+=p;q+=j;p+=h;o+=c;n+=t}return n+(1-n)*(m-o)/(1-o)}};spine.RotateTimeline=function(c){this.curves=new spine.Curves(c);this.frames=[];this.frames.length=c*2};spine.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(e,c,d){e*=2;this.frames[e]=c;this.frames[e+1]=d},apply:function(e,d,f){var l=this.frames;if(d=l[l.length-2]){var h=m.data.rotation+l[l.length-1]-m.rotation;while(h>180){h-=360}while(h<-180){h+=360}m.rotation+=h*f;return}var c=spine.binarySearch(l,d,2);var i=l[c-1];var k=l[c];var j=1-(d-k)/(l[c-2]-k);j=this.curves.getCurvePercent(c/2-1,j);var h=l[c+1]-i;while(h>180){h-=360}while(h<-180){h+=360}h=m.data.rotation+(i+h*j)-m.rotation;while(h>180){h-=360}while(h<-180){h+=360}m.rotation+=h*f}};spine.TranslateTimeline=function(c){this.curves=new spine.Curves(c);this.frames=[];this.frames.length=c*3};spine.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(f,d,c,e){f*=3;this.frames[f]=d;this.frames[f+1]=c;this.frames[f+2]=e},apply:function(e,d,f){var l=this.frames;if(d=l[l.length-3]){m.x+=(m.data.x+l[l.length-2]-m.x)*f;m.y+=(m.data.y+l[l.length-1]-m.y)*f;return}var c=spine.binarySearch(l,d,3);var i=l[c-2];var h=l[c-1];var k=l[c];var j=1-(d-k)/(l[c+-3]-k);j=this.curves.getCurvePercent(c/3-1,j);m.x+=(m.data.x+i+(l[c+1]-i)*j-m.x)*f;m.y+=(m.data.y+h+(l[c+2]-h)*j-m.y)*f}};spine.ScaleTimeline=function(c){this.curves=new spine.Curves(c);this.frames=[];this.frames.length=c*3};spine.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(f,d,c,e){f*=3;this.frames[f]=d;this.frames[f+1]=c;this.frames[f+2]=e},apply:function(e,d,f){var l=this.frames;if(d=l[l.length-3]){m.scaleX+=(m.data.scaleX-1+l[l.length-2]-m.scaleX)*f;m.scaleY+=(m.data.scaleY-1+l[l.length-1]-m.scaleY)*f;return}var c=spine.binarySearch(l,d,3);var i=l[c-2];var h=l[c-1];var k=l[c];var j=1-(d-k)/(l[c+-3]-k);j=this.curves.getCurvePercent(c/3-1,j);m.scaleX+=(m.data.scaleX-1+i+(l[c+1]-i)*j-m.scaleX)*f;m.scaleY+=(m.data.scaleY-1+h+(l[c+2]-h)*j-m.scaleY)*f}};spine.ColorTimeline=function(c){this.curves=new spine.Curves(c);this.frames=[];this.frames.length=c*5};spine.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(f,d,c,e){f*=5;this.frames[f]=d;this.frames[f+1]=r;this.frames[f+2]=g;this.frames[f+3]=b;this.frames[f+4]=a},apply:function(h,f,j){var q=this.frames;if(f=q[q.length-5]){var k=q.length-1;v.r=q[k-3];v.g=q[k-2];v.b=q[k-1];v.a=q[k];return}var d=spine.binarySearch(q,f,5);var u=q[d-4];var e=q[d-3];var l=q[d-2];var n=q[d-1];var p=q[d];var o=1-(f-p)/(q[d-5]-p);o=this.curves.getCurvePercent(d/5-1,o);var c=u+(q[d+1]-u)*o;var m=e+(q[d+2]-e)*o;var s=l+(q[d+3]-l)*o;var t=n+(q[d+4]-n)*o;if(j<1){v.r+=(c-v.r)*j;v.g+=(m-v.g)*j;v.b+=(s-v.b)*j;v.a+=(t-v.a)*j}else{v.r=c;v.g=m;v.b=s;v.a=t}}};spine.AttachmentTimeline=function(c){this.curves=new spine.Curves(c);this.frames=[];this.frames.length=c;this.attachmentNames=[];this.attachmentNames.length=c};spine.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(e,d,c){this.frames[e]=d;this.attachmentNames[e]=c},apply:function(f,e,d){var h=this.frames;if(e=h[h.length-1]){i=h.length-1}else{i=spine.binarySearch(h,e,1)-1}var c=this.attachmentNames[i];f.slots[this.slotIndex].setAttachment(!c?null:f.getAttachmentBySlotIndex(this.slotIndex,c))}};spine.SkeletonData=function(){this.bones=[];this.slots=[];this.skins=[];this.animations=[]};spine.SkeletonData.prototype={defaultSkin:null,findBone:function(e){var c=this.bones;for(var d=0,f=c.length;d0){var c=this.queue[0];if(this.currentTime>=c.delay){this._setAnimation(c.animation,c.loop);this.queue.shift()}}},apply:function(d){if(!this.current){return}if(this.previous){this.previous.apply(d,this.previousTime,this.previousLoop);var c=this.mixTime/this.mixDuration;if(c>=1){c=1;this.previous=null}this.current.mix(d,this.currentTime,this.currentLoop,c)}else{this.current.apply(d,this.currentTime,this.currentLoop)}},clearAnimation:function(){this.previous=null;this.current=null;this.queue.length=0},_setAnimation:function(d,c){this.previous=null;if(d&&this.current){this.mixDuration=this.data.getMix(this.current,d);if(this.mixDuration>0){this.mixTime=0;this.previous=this.current;this.previousTime=this.currentTime;this.previousLoop=this.currentLoop}}this.current=d;this.currentLoop=c;this.currentTime=0},setAnimationByName:function(d,c){var e=this.data.skeletonData.findAnimation(d);if(!e){throw"Animation not found: "+d}this.setAnimation(e,c)},setAnimation:function(d,c){this.queue.length=0;this._setAnimation(d,c)},addAnimationByName:function(e,c,d){var f=this.data.skeletonData.findAnimation(e);if(!f){throw"Animation not found: "+e}this.addAnimation(f,c,d)},addAnimation:function(h,c,e){var f={};f.animation=h;f.loop=c;if(!e||e<=0){var d=this.queue.length==0?this.current:this.queue[this.queue.length-1].animation;if(d!=null){e=d.duration-this.data.getMix(d,h)+(e||0)}else{e=0}}f.delay=e;this.queue.push(f)},isComplete:function(){return !this.current||this.currentTime>=this.current.duration}};spine.SkeletonJson=function(c){this.attachmentLoader=c};spine.SkeletonJson.prototype={scale:1,readSkeletonData:function(u){var c=new spine.SkeletonData();var B=u.bones;for(var z=0,s=B.length;z=this.lines.length){return null}return this.lines[this.index++]},readValue:function(){var c=this.readLine();var d=c.indexOf(":");if(d==-1){throw"Invalid line: "+c}return this.trim(c.substring(d+1))},readTuple:function(d){var e=this.readLine();var h=e.indexOf(":");if(h==-1){throw"Invalid line: "+e}var f=0,j=h+1;for(;f<3;f++){var c=e.indexOf(",",j);if(c==-1){if(f==0){throw"Invalid line: "+e}break}d[f]=this.trim(e.substr(j,c-j));j=c+1}d[f]=this.trim(e.substring(j));return f+1}};spine.AtlasAttachmentLoader=function(c){this.atlas=c};spine.AtlasAttachmentLoader.prototype={newAttachment:function(f,d,c){switch(d){case spine.AttachmentType.region:var e=this.atlas.findRegion(c);if(!e){throw"Region not found in atlas: "+c+" ("+d+")"}var h=new spine.RegionAttachment(c);h.rendererObject=e;h.setUVs(e.u,e.v,e.u2,e.v2,e.rotate);h.regionOffsetX=e.offsetX;h.regionOffsetY=e.offsetY;h.regionWidth=e.width;h.regionHeight=e.height;h.regionOriginalWidth=e.originalWidth;h.regionOriginalHeight=e.originalHeight;return h}throw"Unknown attachment type: "+d}};PIXI.AnimCache={};spine.Bone.yDown=true;PIXI.TilingSprite=function(e,d,c){PIXI.DisplayObjectContainer.call(this);this.texture=e;this.width=d;this.height=c;this.tileScale=new PIXI.Point(1,1);this.tilePosition=new PIXI.Point(0,0);this.renderable=true;this.blendMode=PIXI.blendModes.NORMAL};PIXI.TilingSprite.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.TilingSprite.prototype.constructor=PIXI.TilingSprite;PIXI.TilingSprite.prototype.setTexture=function(c){this.texture=c;this.updateFrame=true};PIXI.TilingSprite.prototype.onTextureUpdate=function(c){this.updateFrame=true};PIXI.FilterBlock=function(c){this.graphics=c;this.visible=true;this.renderable=true};PIXI.MaskFilter=function(c){this.graphics};PIXI.Graphics=function(){PIXI.DisplayObjectContainer.call(this);this.renderable=true;this.fillAlpha=1;this.lineWidth=0;this.lineColor="black";this.graphicsData=[];this.currentPath={points:[]}};PIXI.Graphics.prototype=Object.create(PIXI.DisplayObjectContainer.prototype);PIXI.Graphics.prototype.constructor=PIXI.Graphics;PIXI.Graphics.prototype.lineStyle=function(c,d,e){if(this.currentPath.points.length==0){this.graphicsData.pop()}this.lineWidth=c||0;this.lineColor=d||0;this.lineAlpha=(e==undefined)?1:e;this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:PIXI.Graphics.POLY};this.graphicsData.push(this.currentPath)};PIXI.Graphics.prototype.moveTo=function(c,d){if(this.currentPath.points.length==0){this.graphicsData.pop()}this.currentPath=this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:PIXI.Graphics.POLY};this.currentPath.points.push(c,d);this.graphicsData.push(this.currentPath)};PIXI.Graphics.prototype.lineTo=function(c,d){this.currentPath.points.push(c,d);this.dirty=true};PIXI.Graphics.prototype.beginFill=function(c,d){this.filling=true;this.fillColor=c||0;this.fillAlpha=(d==undefined)?1:d};PIXI.Graphics.prototype.endFill=function(){this.filling=false;this.fillColor=null;this.fillAlpha=1};PIXI.Graphics.prototype.drawRect=function(d,f,e,c){if(this.currentPath.points.length==0){this.graphicsData.pop()}this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[d,f,e,c],type:PIXI.Graphics.RECT};this.graphicsData.push(this.currentPath);this.dirty=true};PIXI.Graphics.prototype.drawCircle=function(d,e,c){if(this.currentPath.points.length==0){this.graphicsData.pop()}this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[d,e,c,c],type:PIXI.Graphics.CIRC};this.graphicsData.push(this.currentPath);this.dirty=true};PIXI.Graphics.prototype.drawElipse=function(d,f,e,c){if(this.currentPath.points.length==0){this.graphicsData.pop()}this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[d,f,e,c],type:PIXI.Graphics.ELIP};this.graphicsData.push(this.currentPath);this.dirty=true};PIXI.Graphics.prototype.clear=function(){this.lineWidth=0;this.filling=false;this.dirty=true;this.clearDirty=true;this.graphicsData=[]};PIXI.Graphics.POLY=0;PIXI.Graphics.RECT=1;PIXI.Graphics.CIRC=2;PIXI.Graphics.ELIP=3;PIXI.CanvasGraphics=function(){};PIXI.CanvasGraphics.renderGraphics=function(A,d){var s=A.worldAlpha;for(var v=0;v1){z=1;console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object")}for(var v=0;v<1;v++){var D=B.graphicsData[v];var u=D.points;if(D.type==PIXI.Graphics.POLY){d.beginPath();d.moveTo(u[0],u[1]);for(var t=1;t0){PIXI.Texture.frameUpdates=[]}};PIXI.CanvasRenderer.prototype.resize=function(d,c){this.width=d;this.height=c;this.view.width=d;this.view.height=c};PIXI.CanvasRenderer.prototype.renderDisplayObject=function(j){var f;var h=this.context;h.globalCompositeOperation="source-over";var e=j.last._iNext;j=j.first;do{f=j.worldTransform;if(!j.visible){j=j.last._iNext;continue}if(!j.renderable){j=j._iNext;continue}if(j instanceof PIXI.Sprite){var i=j.texture.frame;if(i){h.globalAlpha=j.worldAlpha;h.setTransform(f[0],f[3],f[1],f[4],f[2],f[5]);h.drawImage(j.texture.baseTexture.source,i.x,i.y,i.width,i.height,(j.anchor.x)*-i.width,(j.anchor.y)*-i.height,i.width,i.height)}}else{if(j instanceof PIXI.Strip){h.setTransform(f[0],f[3],f[1],f[4],f[2],f[5]);this.renderStrip(j)}else{if(j instanceof PIXI.TilingSprite){h.setTransform(f[0],f[3],f[1],f[4],f[2],f[5]);this.renderTilingSprite(j)}else{if(j instanceof PIXI.CustomRenderable){j.renderCanvas(this)}else{if(j instanceof PIXI.Graphics){h.setTransform(f[0],f[3],f[1],f[4],f[2],f[5]);PIXI.CanvasGraphics.renderGraphics(j,h)}else{if(j instanceof PIXI.FilterBlock){if(j.open){h.save();var d=j.mask.alpha;var c=j.mask.worldTransform;h.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]);j.mask.worldAlpha=0.5;h.worldAlpha=0;PIXI.CanvasGraphics.renderGraphicsMask(j.mask,h);h.clip();j.mask.worldAlpha=d}else{h.restore()}}}}}}}j=j._iNext}while(j!=e)};PIXI.CanvasRenderer.prototype.renderStripFlat=function(e){var f=this.context;var h=e.verticies;var l=e.uvs;var j=h.length/2;this.count++;f.beginPath();for(var m=1;m3){PIXI.WebGLGraphics.buildPoly(e,c._webGL)}}if(e.lineWidth>0){PIXI.WebGLGraphics.buildLine(e,c._webGL)}}else{if(e.type==PIXI.Graphics.RECT){PIXI.WebGLGraphics.buildRectangle(e,c._webGL)}else{if(e.type==PIXI.Graphics.CIRC||e.type==PIXI.Graphics.ELIP){PIXI.WebGLGraphics.buildCircle(e,c._webGL)}}}}c._webGL.lastIndex=c.graphicsData.length;var f=PIXI.gl;c._webGL.glPoints=new Float32Array(c._webGL.points);f.bindBuffer(f.ARRAY_BUFFER,c._webGL.buffer);f.bufferData(f.ARRAY_BUFFER,c._webGL.glPoints,f.STATIC_DRAW);c._webGL.glIndicies=new Uint16Array(c._webGL.indices);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c._webGL.indexBuffer);f.bufferData(f.ELEMENT_ARRAY_BUFFER,c._webGL.glIndicies,f.STATIC_DRAW)};PIXI.WebGLGraphics.buildRectangle=function(s,i){var f=s.points;var n=f[0];var m=f[1];var d=f[2];var q=f[3];if(s.fill){var h=HEXtoRGB(s.fillColor);var e=s.fillAlpha;var c=h[0]*e;var j=h[1]*e;var l=h[2]*e;var o=i.points;var p=i.indices;var k=o.length/6;o.push(n,m);o.push(c,j,l,e);o.push(n+d,m);o.push(c,j,l,e);o.push(n,m+q);o.push(c,j,l,e);o.push(n+d,m+q);o.push(c,j,l,e);p.push(k,k,k+1,k+2,k+3,k+3)}if(s.lineWidth){s.points=[n,m,n+d,m,n+d,m+q,n,m+q,n,m];PIXI.WebGLGraphics.buildLine(s,i)}};PIXI.WebGLGraphics.buildCircle=function(k,w){var f=k.points;var j=f[0];var h=f[1];var o=f[2];var n=f[3];var l=40;var t=(Math.PI*2)/l;if(k.fill){var p=HEXtoRGB(k.fillColor);var d=k.fillAlpha;var m=p[0]*d;var s=p[1]*d;var u=p[2]*d;var v=w.points;var e=w.indices;var c=v.length/6;e.push(c);for(var q=0;q140*140){h=L-z;f=K-w;m=Math.sqrt(h*h+f*f);h/=m;f/=m;h*=c;f*=c;S.push(B-h,A-f);S.push(M,T,W,Q);S.push(B+h,A+f);S.push(M,T,W,Q);S.push(B-h,A-f);S.push(M,T,W,Q);q++}else{S.push(px,py);S.push(M,T,W,Q);S.push(B-(px-B),A-(py-A));S.push(M,T,W,Q)}}J=H[(u-2)*2];I=H[(u-2)*2+1];B=H[(u-1)*2];A=H[(u-1)*2+1];L=-(I-A);K=J-B;m=Math.sqrt(L*L+K*K);L/=m;K/=m;L*=c;K*=c;S.push(B-L,A-K);S.push(M,T,W,Q);S.push(B+L,A+K);S.push(M,T,W,Q);l.push(U);for(var R=0;R>16&255)/255,(c>>8&255)/255,(c&255)/255]}PIXI._defaultFrame=new PIXI.Rectangle(0,0,1,1);PIXI.gl;PIXI.WebGLRenderer=function(i,c,f,l,d){this.transparent=!!l;this.width=i||800;this.height=c||600;this.view=f||document.createElement("canvas");this.view.width=this.width;this.view.height=this.height;var h=this;this.view.addEventListener("webglcontextlost",function(e){h.handleContextLost(e)},false);this.view.addEventListener("webglcontextrestored",function(e){h.handleContextRestored(e)},false);this.batchs=[];try{PIXI.gl=this.gl=this.view.getContext("experimental-webgl",{alpha:this.transparent,antialias:!!d,premultipliedAlpha:false,stencil:true})}catch(j){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}PIXI.initPrimitiveShader();PIXI.initDefaultShader();PIXI.initDefaultStripShader();PIXI.activateDefaultShader();var k=this.gl;PIXI.WebGLRenderer.gl=k;this.batch=new PIXI.WebGLBatch(k);k.disable(k.DEPTH_TEST);k.disable(k.CULL_FACE);k.enable(k.BLEND);k.colorMask(true,true,true,this.transparent);PIXI.projection=new PIXI.Point(400,300);this.resize(this.width,this.height);this.contextLost=false;this.stageRenderGroup=new PIXI.WebGLRenderGroup(this.gl)};PIXI.WebGLRenderer.prototype.constructor=PIXI.WebGLRenderer;PIXI.WebGLRenderer.getBatch=function(){if(PIXI._batchs.length==0){return new PIXI.WebGLBatch(PIXI.WebGLRenderer.gl)}else{return PIXI._batchs.pop()}};PIXI.WebGLRenderer.returnBatch=function(c){c.clean();PIXI._batchs.push(c)};PIXI.WebGLRenderer.prototype.render=function(c){if(this.contextLost){return}if(this.__stage!==c){this.__stage=c;this.stageRenderGroup.setRenderable(c)}PIXI.WebGLRenderer.updateTextures();PIXI.visibleCount++;c.updateTransform();var e=this.gl;e.colorMask(true,true,true,this.transparent);e.viewport(0,0,this.width,this.height);e.bindFramebuffer(e.FRAMEBUFFER,null);e.clearColor(c.backgroundColorSplit[0],c.backgroundColorSplit[1],c.backgroundColorSplit[2],!this.transparent);e.clear(e.COLOR_BUFFER_BIT);this.stageRenderGroup.backgroundColor=c.backgroundColorSplit;this.stageRenderGroup.render(PIXI.projection);if(c.interactive){if(!c._interactiveEventsAdded){c._interactiveEventsAdded=true;c.interactionManager.setTarget(this)}}if(PIXI.Texture.frameUpdates.length>0){for(var d=0;d0){p=p.children[p.children.length-1];if(p.renderable){c=p}}if(c instanceof PIXI.Sprite){d=c.batch;var n=d.head;if(n==c){k=0}else{k=1;while(n.__next!=c){k++;n=n.__next}}}else{d=c}if(o==d){if(o instanceof PIXI.WebGLBatch){o.render(s,k+1)}else{this.renderSpecial(o,l)}return}e=this.batchs.indexOf(o);t=this.batchs.indexOf(d);if(o instanceof PIXI.WebGLBatch){o.render(s)}else{this.renderSpecial(o,l)}for(var f=e+1;f=2?parseInt(c[c.length-2],10):PIXI.BitmapText.fonts[this.fontName].size;this.dirty=true};PIXI.BitmapText.prototype.updateText=function(){var k=PIXI.BitmapText.fonts[this.fontName];var o=new PIXI.Point();var l=null;var n=[];var t=0;var f=[];var s=0;var h=this.fontSize/k.size;for(var j=0;j0){this.removeChild(this.getChildAt(0))}this.updateText();this.dirty=false}PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)};PIXI.BitmapText.fonts={};PIXI.Text=function(d,c){this.canvas=document.createElement("canvas");this.context=this.canvas.getContext("2d");PIXI.Sprite.call(this,PIXI.Texture.fromCanvas(this.canvas));this.setText(d);this.setStyle(c);this.updateText();this.dirty=false};PIXI.Text.prototype=Object.create(PIXI.Sprite.prototype);PIXI.Text.prototype.constructor=PIXI.Text;PIXI.Text.prototype.setStyle=function(c){c=c||{};c.font=c.font||"bold 20pt Arial";c.fill=c.fill||"black";c.align=c.align||"left";c.stroke=c.stroke||"black";c.strokeThickness=c.strokeThickness||0;c.wordWrap=c.wordWrap||false;c.wordWrapWidth=c.wordWrapWidth||100;this.style=c;this.dirty=true};PIXI.Sprite.prototype.setText=function(c){this.text=c.toString()||" ";this.dirty=true};PIXI.Text.prototype.updateText=function(){this.context.font=this.style.font;var j=this.text;if(this.style.wordWrap){j=this.wordWrap(this.text)}var h=j.split(/(?:\r\n|\r|\n)/);var e=[];var d=0;for(var k=0;kl){return m}else{return arguments.callee(k,n,m,i,l)}}else{return arguments.callee(k,n,o,m,l)}};var h=function(i,l,k){if(i.measureText(l).width<=k||l.length<1){return l}var m=f(i,l,0,l.length,k);return l.substring(0,m)+"\n"+arguments.callee(i,l.substring(m),k)};var c="";var d=j.split("\n");for(var e=0;ethis.baseTexture.width||c.y+c.height>this.baseTexture.height){throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this)}this.updateFrame=true;PIXI.Texture.frameUpdates.push(this)};PIXI.Texture.fromImage=function(d,c){var e=PIXI.TextureCache[d];if(!e){e=new PIXI.Texture(PIXI.BaseTexture.fromImage(d,c));PIXI.TextureCache[d]=e}return e};PIXI.Texture.fromFrame=function(d){var c=PIXI.TextureCache[d];if(!c){throw new Error("The frameId '"+d+"' does not exist in the texture cache "+this)}return c};PIXI.Texture.fromCanvas=function(c){var d=new PIXI.BaseTexture(c);return new PIXI.Texture(d)};PIXI.Texture.addTextureToCache=function(c,d){PIXI.TextureCache[d]=c};PIXI.Texture.removeTextureFromCache=function(d){var c=PIXI.TextureCache[d];PIXI.TextureCache[d]=null;return c};PIXI.Texture.frameUpdates=[];PIXI.RenderTexture=function(d,c){PIXI.EventTarget.call(this);this.width=d||100;this.height=c||100;this.indetityMatrix=PIXI.mat3.create();this.frame=new PIXI.Rectangle(0,0,this.width,this.height);if(PIXI.gl){this.initWebGL()}else{this.initCanvas()}};PIXI.RenderTexture.prototype=Object.create(PIXI.Texture.prototype);PIXI.RenderTexture.prototype.constructor=PIXI.RenderTexture;PIXI.RenderTexture.prototype.initWebGL=function(){var c=PIXI.gl;this.glFramebuffer=c.createFramebuffer();c.bindFramebuffer(c.FRAMEBUFFER,this.glFramebuffer);this.glFramebuffer.width=this.width;this.glFramebuffer.height=this.height;this.baseTexture=new PIXI.BaseTexture();this.baseTexture.width=this.width;this.baseTexture.height=this.height;this.baseTexture._glTexture=c.createTexture();c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTexture);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR);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);this.baseTexture.isRender=true;c.bindFramebuffer(c.FRAMEBUFFER,this.glFramebuffer);c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,this.baseTexture._glTexture,0);this.projection=new PIXI.Point(this.width/2,this.height/2);this.render=this.renderWebGL};PIXI.RenderTexture.prototype.resize=function(d,c){this.width=d;this.height=c;if(PIXI.gl){this.projection.x=this.width/2;this.projection.y=this.height/2;var e=PIXI.gl;e.bindTexture(e.TEXTURE_2D,this.baseTexture._glTexture);e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,null)}else{this.frame.width=this.width;this.frame.height=this.height;this.renderer.resize(this.width,this.height)}};PIXI.RenderTexture.prototype.initCanvas=function(){this.renderer=new PIXI.CanvasRenderer(this.width,this.height,null,0);this.baseTexture=new PIXI.BaseTexture(this.renderer.view);this.frame=new PIXI.Rectangle(0,0,this.width,this.height);this.render=this.renderCanvas};PIXI.RenderTexture.prototype.renderWebGL=function(m,k,l){var h=PIXI.gl;h.colorMask(true,true,true,true);h.viewport(0,0,this.width,this.height);h.bindFramebuffer(h.FRAMEBUFFER,this.glFramebuffer);if(l){h.clearColor(0,0,0,0);h.clear(h.COLOR_BUFFER_BIT)}var d=m.children;var c=m.worldTransform;m.worldTransform=PIXI.mat3.create();m.worldTransform[4]=-1;m.worldTransform[5]=this.projection.y*2;if(k){m.worldTransform[2]=k.x;m.worldTransform[5]-=k.y}PIXI.visibleCount++;m.vcount=PIXI.visibleCount;for(var f=0,e=d.length;f>1;if(m<3){return[]}var z=[];var k=[];for(var v=0;v3){var t=k[(v+0)%s];var q=k[(v+1)%s];var o=k[(v+2)%s];var h=l[2*t],e=l[2*t+1];var A=l[2*q],w=l[2*q+1];var d=l[2*o],c=l[2*o+1];var f=false;if(PIXI.PolyK._convex(h,e,A,w,d,c,C)){f=true;for(var u=0;u3*s){if(C){var z=[];k=[];for(var v=0;v=0)&&(o>=0)&&(p+o<1)};PIXI.PolyK._convex=function(f,e,i,h,c,j,d){return((e-h)*(c-i)+(i-f)*(j-h)>=0)==d};Phaser.Camera=function(e,i,d,h,f,c){this.game=e;this.world=e.world;this.id=0;this.view=new Phaser.Rectangle(d,h,f,c);this.screenView=new Phaser.Rectangle(d,h,f,c)};Phaser.Camera.FOLLOW_LOCKON=0;Phaser.Camera.FOLLOW_PLATFORMER=1;Phaser.Camera.FOLLOW_TOPDOWN=2;Phaser.Camera.FOLLOW_TOPDOWN_TIGHT=3;Phaser.Camera.prototype={game:null,world:null,id:0,view:null,deadzone:null,visible:true,target:null,follow:function(i,e){if(typeof e==="undefined"){e=Phaser.Camera.FOLLOW_LOCKON}this.target=i;var f;switch(e){case Phaser.Types.CAMERA_FOLLOW_PLATFORMER:var c=this.width/8;var d=this.height/3;this.deadzone=new Phaser.Rectangle((this.width-c)/2,(this.height-d)/2-d*0.25,c,d);break;case Phaser.Types.CAMERA_FOLLOW_TOPDOWN:f=Math.max(this.width,this.height)/4;this.deadzone=new Phaser.Rectangle((this.width-f)/2,(this.height-f)/2,f,f);break;case Phaser.Types.CAMERA_FOLLOW_TOPDOWN_TIGHT:f=Math.max(this.width,this.height)/8;this.deadzone=new Phaser.Rectangle((this.width-f)/2,(this.height-f)/2,f,f);break;case Phaser.Types.CAMERA_FOLLOW_LOCKON:default:this.deadzone=null;break}},focusOnXY:function(c,d){c+=(c>0)?1e-7:-1e-7;d+=(d>0)?1e-7:-1e-7;this.view.x=Math.round(c-this.view.halfWidth);this.view.y=Math.round(d-this.view.halfHeight)},update:function(){if(this.target!==null){if(this.deadzone==null){this.focusOnXY(this.target.x,this.target.y)}else{var e;var d=this.target.x+((this.target.x>0)?1e-7:-1e-7);var c=this.target.y+((this.target.y>0)?1e-7:-1e-7);e=d-this.deadzone.x;if(this.view.x>e){this.view.x=e}e=d+this.target.width-this.deadzone.x-this.deadzone.width;if(this.view.xe){this.view.y=e}e=c+this.target.height-this.deadzone.y-this.deadzone.height;if(this.view.ythis.world.bounds.right-this.width){this.view.x=(this.world.bounds.right-this.width)+1}if(this.view.ythis.world.bounds.bottom-this.height){this.view.y=(this.world.bounds.bottom-this.height)+1}this.view.floor()},setPosition:function(c,d){this.view.x=c;this.view.y=d},setSize:function(d,c){this.view.width=d;this.view.height=c}};Object.defineProperty(Phaser.Camera.prototype,"x",{get:function(){return this.view.x},set:function(c){this.view.x=c},enumerable:true,configurable:true});Object.defineProperty(Phaser.Camera.prototype,"y",{get:function(){return this.view.y},set:function(c){this.view.y=c},enumerable:true,configurable:true});Object.defineProperty(Phaser.Camera.prototype,"width",{get:function(){return this.view.width},set:function(c){this.view.width=c},enumerable:true,configurable:true});Object.defineProperty(Phaser.Camera.prototype,"height",{get:function(){return this.view.height},set:function(c){this.view.height=c},enumerable:true,configurable:true});Phaser.State=function(){};Phaser.State.prototype={link:function(c){this.game=c;this.cache=c.cache;this.load=c.load;this.math=c.math;this.time=c.time;this.tweens=c.tweens},preload:function(){},create:function(){},update:function(){},render:function(){},paused:function(){},destroy:function(){}};Phaser.StateManager=function(d,c){this.game=d;this.states={};if(c!==null){this._pendingState=c}};Phaser.StateManager.prototype={game:null,_pendingState:null,_created:false,states:{},current:"",onInitCallback:null,onPreloadCallback:null,onCreateCallback:null,onUpdateCallback:null,onRenderCallback:null,onPreRenderCallback:null,onLoadUpdateCallback:null,onLoadRenderCallback:null,onPausedCallback:null,onShutDownCallback:null,boot:function(){if(this._pendingState!==null){if(typeof this._pendingState==="string"){this.start(this._pendingState,false,false)}else{this.add("default",this._pendingState,true)}}},add:function(d,e,c){if(typeof c==="undefined"){c=false}var f;if(e instanceof Phaser.State){f=e;f.link(this.game)}else{if(typeof e==="object"){f=e}else{if(typeof e==="function"){f=new e(this.game)}}}this.states[d]=f;if(c){if(this.game.isBooted){this.start(d)}else{this._pendingState=d}}return f},remove:function(c){if(this.current==c){this.callbackContext=null;this.onInitCallback=null;this.onShutDownCallback=null;this.onPreloadCallback=null;this.onLoadRenderCallback=null;this.onLoadUpdateCallback=null;this.onCreateCallback=null;this.onUpdateCallback=null;this.onRenderCallback=null;this.onPausedCallback=null;this.onDestroyCallback=null}delete this.states[c]},start:function(d,c,e){if(typeof c==="undefined"){c=true}if(typeof e==="undefined"){e=false}if(this.game.isBooted==false){this._pendingState=d;return}if(this.checkState(d)==false){return}else{if(this.current){this.onShutDownCallback.call(this.callbackContext)}if(c){if(e==true){this.game.cache.destroy()}}this.setCurrentState(d)}if(this.onPreloadCallback){this.game.load.reset();this.onPreloadCallback.call(this.callbackContext);if(this.game.load.queueSize==0){this.game.loadComplete();if(this.onCreateCallback){this.onCreateCallback.call(this.callbackContext)}this._created=true}else{this.game.load.start()}}else{if(this.onCreateCallback){this.onCreateCallback.call(this.callbackContext)}this._created=true;this.game.loadComplete()}},dummy:function(){},checkState:function(c){if(this.states[c]){var d=false;if(this.states[c]["preload"]){d=true}if(d==false&&this.states[c]["loadRender"]){d=true}if(d==false&&this.states[c]["loadUpdate"]){d=true}if(d==false&&this.states[c]["create"]){d=true}if(d==false&&this.states[c]["update"]){d=true}if(d==false&&this.states[c]["preRender"]){d=true}if(d==false&&this.states[c]["render"]){d=true}if(d==false&&this.states[c]["paused"]){d=true}if(d==false){console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions.");return false}return true}else{console.warn("Phaser.StateManager - No state found with the key: "+c);return false}},setCurrentState:function(c){this.callbackContext=this.states[c];this.onInitCallback=this.states[c]["init"]||this.dummy;this.onPreloadCallback=this.states[c]["preload"]||null;this.onLoadRenderCallback=this.states[c]["loadRender"]||null;this.onLoadUpdateCallback=this.states[c]["loadUpdate"]||null;this.onCreateCallback=this.states[c]["create"]||null;this.onUpdateCallback=this.states[c]["update"]||null;this.onPreRenderCallback=this.states[c]["preRender"]||null;this.onRenderCallback=this.states[c]["render"]||null;this.onPausedCallback=this.states[c]["paused"]||null;this.onShutDownCallback=this.states[c]["shutdown"]||this.dummy;this.current=c;this._created=false;this.onInitCallback.call(this.callbackContext)},loadComplete:function(){if(this._created==false&&this.onCreateCallback){this.onCreateCallback.call(this.callbackContext);this._created=true}},update:function(){if(this._created&&this.onUpdateCallback){this.onUpdateCallback.call(this.callbackContext)}else{if(this.onLoadUpdateCallback){this.onLoadUpdateCallback.call(this.callbackContext)}}},preRender:function(){if(this.onPreRenderCallback){this.onPreRenderCallback.call(this.callbackContext)}},render:function(){if(this._created&&this.onRenderCallback){this.onRenderCallback.call(this.callbackContext)}else{if(this.onLoadRenderCallback){this.onLoadRenderCallback.call(this.callbackContext)}}},destroy:function(){this.callbackContext=null;this.onInitCallback=null;this.onShutDownCallback=null;this.onPreloadCallback=null;this.onLoadRenderCallback=null;this.onLoadUpdateCallback=null;this.onCreateCallback=null;this.onUpdateCallback=null;this.onRenderCallback=null;this.onPausedCallback=null;this.onDestroyCallback=null;this.game=null;this.states={};this._pendingState=null}};Phaser.LinkedList=function(){};Phaser.LinkedList.prototype={next:null,prev:null,first:null,last:null,total:0,sprite:{name:"HD"},add:function(c){if(this.total==0&&this.first==null&&this.last==null){this.first=c;this.last=c;this.next=c;c.prev=this;this.total++;return}this.last.next=c;c.prev=this.last;this.last=c;this.total++;return c},remove:function(d){if(this.first==null&&this.last==null){return}this.total--;if(this.first==d&&this.last==d){this.first=null;this.last=null;this.next=null;d.next=null;d.prev=null;return}var c=d.prev;if(d.next){d.next.prev=d.prev}c.next=d.next},dump:function(){console.log("\nNode\t\t|\t\tNext\t\t|\t\tPrev\t\t|\t\tFirst\t\t|\t\tLast");console.log("\t\t\t|\t\t\t\t\t|\t\t\t\t\t|\t\t\t\t\t|");var h="-";var j="-";var d="-";var i="-";if(this.next){h=this.next.sprite.name}if(this.prev){j=this.prev.sprite.name}if(this.first){d=this.first.sprite.name}if(this.last){i=this.last.sprite.name}if(typeof h==="undefined"){h="-"}if(typeof j==="undefined"){j="-"}if(typeof d==="undefined"){d="-"}if(typeof i==="undefined"){i="-"}console.log("HD\t\t\t|\t\t"+h+"\t\t\t|\t\t"+j+"\t\t\t|\t\t"+d+"\t\t\t|\t\t"+i);var c=this;var f=c.last.next;c=c.first;do{var e=c.sprite.name||"*";var h="-";var j="-";var d="-";var i="-";if(c.next){h=c.next.sprite.name}if(c.prev){j=c.prev.sprite.name}if(c.first){d=c.first.sprite.name}if(c.last){i=c.last.sprite.name}if(typeof h==="undefined"){h="-"}if(typeof j==="undefined"){j="-"}if(typeof d==="undefined"){d="-"}if(typeof i==="undefined"){i="-"}console.log(e+"\t\t\t|\t\t"+h+"\t\t\t|\t\t"+j+"\t\t\t|\t\t"+d+"\t\t\t|\t\t"+i);c=c.next}while(c!=f)}};Phaser.Signal=function(){this._bindings=[];this._prevParams=null;var c=this;this.dispatch=function(){Phaser.Signal.prototype.dispatch.apply(c,arguments)}};Phaser.Signal.prototype={memorize:false,_shouldPropagate:true,active:true,validateListener:function(c,d){if(typeof c!=="function"){throw new Error("listener is a required param of {fn}() and should be a Function.".replace("{fn}",d))}},_registerListener:function(h,e,f,d){var c=this._indexOfListener(h,f),i;if(c!==-1){i=this._bindings[c];if(i.isOnce()!==e){throw new Error("You cannot add"+(e?"":"Once")+"() then add"+(!e?"":"Once")+"() the same listener without removing the relationship first.")}}else{i=new Phaser.SignalBinding(this,h,e,f,d);this._addBinding(i)}if(this.memorize&&this._prevParams){i.execute(this._prevParams)}return i},_addBinding:function(c){var d=this._bindings.length;do{--d}while(this._bindings[d]&&c._priority<=this._bindings[d]._priority);this._bindings.splice(d+1,0,c)},_indexOfListener:function(d,c){var f=this._bindings.length,e;while(f--){e=this._bindings[f];if(e._listener===d&&e.context===c){return f}}return -1},has:function(d,c){return this._indexOfListener(d,c)!==-1},add:function(e,d,c){this.validateListener(e,"add");return this._registerListener(e,false,d,c)},addOnce:function(e,d,c){this.validateListener(e,"addOnce");return this._registerListener(e,true,d,c)},remove:function(e,d){this.validateListener(e,"remove");var c=this._indexOfListener(e,d);if(c!==-1){this._bindings[c]._destroy();this._bindings.splice(c,1)}return e},removeAll:function(){var c=this._bindings.length;while(c--){this._bindings[c]._destroy()}this._bindings.length=0},getNumListeners:function(){return this._bindings.length},halt:function(){this._shouldPropagate=false},dispatch:function(d){if(!this.active){return}var c=Array.prototype.slice.call(arguments),f=this._bindings.length,e;if(this.memorize){this._prevParams=c}if(!f){return}e=this._bindings.slice();this._shouldPropagate=true;do{f--}while(e[f]&&this._shouldPropagate&&e[f].execute(c)!==false)},forget:function(){this._prevParams=null},dispose:function(){this.removeAll();delete this._bindings;delete this._prevParams},toString:function(){return"[Phaser.Signal active:"+this.active+" numListeners:"+this.getNumListeners()+"]"}};Phaser.SignalBinding=function(h,f,d,e,c){this._listener=f;this._isOnce=d;this.context=e;this._signal=h;this._priority=c||0};Phaser.SignalBinding.prototype={active:true,params:null,execute:function(c){var e,d;if(this.active&&!!this._listener){d=this.params?this.params.concat(c):c;e=this._listener.apply(this.context,d);if(this._isOnce){this.detach()}}return e},detach:function(){return this.isBound()?this._signal.remove(this._listener,this.context):null},isBound:function(){return(!!this._signal&&!!this._listener)},isOnce:function(){return this._isOnce},getListener:function(){return this._listener},getSignal:function(){return this._signal},_destroy:function(){delete this._signal;delete this._listener;delete this.context},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}};Phaser.Plugin=function(c,d){this.game=c;this.parent=d;this.active=false;this.visible=false;this.hasPreUpdate=false;this.hasUpdate=false;this.hasPostUpdate=false;this.hasPreRender=false;this.hasRender=false;this.hasPostRender=false};Phaser.Plugin.prototype={preUpdate:function(){},update:function(){},postUpdate:function(){},preRender:function(){},render:function(){},postRender:function(){},destroy:function(){this.game=null;this.parent=null;this.active=false;this.visible=false}};Phaser.PluginManager=function(c,d){this.game=c;this._parent=d;this.plugins=[];this._pluginsLength=0};Phaser.PluginManager.prototype={add:function(d){var c=false;if(typeof d==="function"){d=new d(this.game,this._parent)}else{d.game=this.game;d.parent=this._parent}if(typeof d.preUpdate==="function"){d.hasPreUpdate=true;c=true}if(typeof d.update==="function"){d.hasUpdate=true;c=true}if(typeof d.postUpdate==="function"){d.hasPostUpdate=true;c=true}if(typeof d.preRender==="function"){d.hasPreRender=true;c=true}if(typeof d.render==="function"){d.hasRender=true;c=true}if(typeof d.postRender==="function"){d.hasPostRender=true;c=true}if(c){if(d.hasPreUpdate||d.hasUpdate||d.hasPostUpdate){d.active=true}if(d.hasPreRender||d.hasRender||d.hasPostRender){d.visible=true}this._pluginsLength=this.plugins.push(d);return d}else{return null}},remove:function(c){this._pluginsLength--},preUpdate:function(){if(this._pluginsLength==0){return}for(this._p=0;this._p0)},removeBetween:function(e,d){if(e>d||e<0||d>this._container.children.length){return false}for(var c=e;c0;c--){if(this["pointer"+c]===null){d=c}}if(d==0){console.warn("You can only have 10 Pointer objects");return null}else{this["pointer"+d]=new Phaser.Pointer(this.game,d);return this["pointer"+d]}},update:function(){if(this.pollRate>0&&this._pollCounter0&&this._pollCounter=this.game.input.holdRate){if(this.game.input.multiInputOverride==Phaser.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride==Phaser.Input.MOUSE_TOUCH_COMBINE||(this.game.input.multiInputOverride==Phaser.Input.TOUCH_OVERRIDES_MOUSE&&this.game.input.currentPointers==0)){this.game.input.onHold.dispatch(this)}this._holdSent=true}if(this.game.input.recordPointerHistory&&this.game.time.now>=this._nextDrop){this._nextDrop=this.game.time.now+this.game.input.recordRate;this._history.push({x:this.position.x,y:this.position.y});if(this._history.length>this.game.input.recordLimit){this._history.shift()}}}},move:function(d){if(this.game.input.pollLocked){return}if(d.button){this.button=d.button}this.clientX=d.clientX;this.clientY=d.clientY;this.pageX=d.pageX;this.pageY=d.pageY;this.screenX=d.screenX;this.screenY=d.screenY;this.x=(this.pageX-this.game.stage.offset.x)*this.game.input.scale.x;this.y=(this.pageY-this.game.stage.offset.y)*this.game.input.scale.y;this.position.setTo(this.x,this.y);this.circle.x=this.x;this.circle.y=this.y;if(this.game.input.multiInputOverride==Phaser.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride==Phaser.Input.MOUSE_TOUCH_COMBINE||(this.game.input.multiInputOverride==Phaser.Input.TOUCH_OVERRIDES_MOUSE&&this.game.input.currentPointers==0)){this.game.input.activePointer=this;this.game.input.x=this.x;this.game.input.y=this.y;this.game.input.position.setTo(this.game.input.x,this.game.input.y);this.game.input.circle.x=this.game.input.x;this.game.input.circle.y=this.game.input.y}if(this.game.paused){return this}if(this.targetObject!==null&&this.targetObject.isDragged==true){if(this.targetObject.update(this)==false){this.targetObject=null}return this}this._highestRenderOrderID=-1;this._highestRenderObject=null;this._highestInputPriorityID=-1;if(this.game.input.interactiveItems.total>0){var c=this.game.input.interactiveItems.next;do{if(c.priorityID>this._highestInputPriorityID||(c.priorityID==this._highestInputPriorityID&&c.sprite.renderOrderID>this._highestRenderOrderID)){if(c.checkPointerOver(this)){this._highestRenderOrderID=c.sprite.renderOrderID;this._highestInputPriorityID=c.priorityID;this._highestRenderObject=c}}c=c.next}while(c!=null)}if(this._highestRenderObject==null){if(this.targetObject){this.targetObject._pointerOutHandler(this);this.targetObject=null}}else{if(this.targetObject==null){this.targetObject=this._highestRenderObject;this._highestRenderObject._pointerOverHandler(this)}else{if(this.targetObject==this._highestRenderObject){if(this._highestRenderObject.update(this)==false){this.targetObject=null}}else{this.targetObject._pointerOutHandler(this);this.targetObject=this._highestRenderObject;this.targetObject._pointerOverHandler(this)}}}return this},leave:function(c){this.withinGame=false;this.move(c)},stop:function(d){if(this._stateReset){d.preventDefault();return}this.timeUp=this.game.time.now;if(this.game.input.multiInputOverride==Phaser.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride==Phaser.Input.MOUSE_TOUCH_COMBINE||(this.game.input.multiInputOverride==Phaser.Input.TOUCH_OVERRIDES_MOUSE&&this.game.input.currentPointers==0)){this.game.input.onUp.dispatch(this);if(this.duration>=0&&this.duration<=this.game.input.tapRate){if(this.timeUp-this.previousTapTime0){this.active=false}this.withinGame=false;this.isDown=false;this.isUp=true;if(this.isMouse==false){this.game.input.currentPointers--}if(this.game.input.interactiveItems.total>0){var c=this.game.input.interactiveItems.next;do{if(c){c._releasedHandler(this)}c=c.next}while(c!=null)}if(this.targetObject){this.targetObject._releasedHandler(this)}this.targetObject=null;return this},justPressed:function(c){c=c||this.game.input.justPressedRate;return(this.isDown===true&&(this.timeDown+c)>this.game.time.now)},justReleased:function(c){c=c||this.game.input.justReleasedRate;return(this.isUp===true&&(this.timeUp+c)>this.game.time.now)},reset:function(){if(this.isMouse==false){this.active=false}this.identifier=null;this.isDown=false;this.isUp=true;this.totalTouches=0;this._holdSent=false;this._history.length=0;this._stateReset=true;if(this.targetObject){this.targetObject._releasedHandler(this)}this.targetObject=null},toString:function(){return"[{Pointer (id="+this.id+" identifer="+this.identifier+" active="+this.active+" duration="+this.duration+" withinGame="+this.withinGame+" x="+this.x+" y="+this.y+" clientX="+this.clientX+" clientY="+this.clientY+" screenX="+this.screenX+" screenY="+this.screenY+" pageX="+this.pageX+" pageY="+this.pageY+")}]"}};Object.defineProperty(Phaser.Pointer.prototype,"duration",{get:function(){if(this.isUp){return -1}return this.game.time.now-this.timeDown},enumerable:true,configurable:true});Object.defineProperty(Phaser.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x},enumerable:true,configurable:true});Object.defineProperty(Phaser.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y},enumerable:true,configurable:true});Phaser.Touch=function(c){this.game=c;this.callbackContext=this.game;this.touchStartCallback=null;this.touchMoveCallback=null;this.touchEndCallback=null;this.touchEnterCallback=null;this.touchLeaveCallback=null;this.touchCancelCallback=null};Phaser.Touch.prototype={game:null,disabled:false,_onTouchStart:null,_onTouchMove:null,_onTouchEnd:null,_onTouchEnter:null,_onTouchLeave:null,_onTouchCancel:null,_onTouchMove:null,start:function(){var c=this;if(this.game.device.touch){this._onTouchStart=function(d){return c.onTouchStart(d)};this._onTouchMove=function(d){return c.onTouchMove(d)};this._onTouchEnd=function(d){return c.onTouchEnd(d)};this._onTouchEnter=function(d){return c.onTouchEnter(d)};this._onTouchLeave=function(d){return c.onTouchLeave(d)};this._onTouchCancel=function(d){return c.onTouchCancel(d)};this._documentTouchMove=function(d){return c.consumeTouchMove(d)};this.game.stage.canvas.addEventListener("touchstart",this._onTouchStart,false);this.game.stage.canvas.addEventListener("touchmove",this._onTouchMove,false);this.game.stage.canvas.addEventListener("touchend",this._onTouchEnd,false);this.game.stage.canvas.addEventListener("touchenter",this._onTouchEnter,false);this.game.stage.canvas.addEventListener("touchleave",this._onTouchLeave,false);this.game.stage.canvas.addEventListener("touchcancel",this._onTouchCancel,false);document.addEventListener("touchmove",this._documentTouchMove,false)}},consumeTouchMove:function(c){c.preventDefault()},onTouchStart:function(d){if(this.touchStartCallback){this.touchStartCallback.call(this.callbackContext,d)}if(this.game.input.disabled||this.disabled){return}d.preventDefault();for(var c=0;cd&&this._tempPoint.xe&&this._tempPoint.ythis.boundsRect.right){this.sprite.x=this.boundsRect.right-this.sprite.width}}if(this.sprite.ythis.boundsRect.bottom){this.sprite.y=this.boundsRect.bottom-this.sprite.height}}},checkBoundsSprite:function(){if(this.sprite.x(this.boundsSprite.x+this.boundsSprite.width)){this.sprite.x=(this.boundsSprite.x+this.boundsSprite.width)-this.sprite.width}}if(this.sprite.y(this.boundsSprite.y+this.boundsSprite.height)){this.sprite.y=(this.boundsSprite.y+this.boundsSprite.height)-this.sprite.height}}}};Phaser.Canvas={getOffset:function(d,c){if(typeof c==="undefined"){c=new Phaser.Point}var e=d.getBoundingClientRect();var j=d.clientTop||document.body.clientTop||0;var i=d.clientLeft||document.body.clientLeft||0;var f=window.pageYOffset||d.scrollTop||document.body.scrollTop;var h=window.pageXOffset||d.scrollLeft||document.body.scrollLeft;c.x=e.left+h-i;c.y=e.top+f-j;return c},getAspectRatio:function(c){return c.width/c.height},setBackgroundColor:function(d,c){if(typeof c==="undefined"){c="rgb(0,0,0)"}d.style.backgroundColor=c;return d},setTouchAction:function(c,d){if(typeof d==="undefined"){d="none"}c.style.msTouchAction=d;c.style["ms-touch-action"]=d;c.style["touch-action"]=d;return c},addToDOM:function(c,d,e){if(typeof d==="undefined"){d=""}if(typeof e==="undefined"){e=true}if((d!==""||d!==null)&&document.getElementById(d)){document.getElementById(d).appendChild(c);if(e){document.getElementById(d).style.overflow="hidden"}}else{document.body.appendChild(c)}return c},setTransform:function(h,j,i,e,c,f,d){h.setTransform(e,f,d,c,j,i);return h},setSmoothingEnabled:function(c,d){c.imageSmoothingEnabled=d;c.mozImageSmoothingEnabled=d;c.oImageSmoothingEnabled=d;c.webkitImageSmoothingEnabled=d;c.msImageSmoothingEnabled=d;return c},setImageRenderingCrisp:function(c){c.style["image-rendering"]="crisp-edges";c.style["image-rendering"]="-moz-crisp-edges";c.style["image-rendering"]="-webkit-optimize-contrast";c.style.msInterpolationMode="nearest-neighbor";return c},setImageRenderingBicubic:function(c){c.style["image-rendering"]="auto";c.style.msInterpolationMode="bicubic";return c}};Phaser.Events=function(c){this.parent=c;this.onAddedToGroup=new Phaser.Signal;this.onRemovedFromGroup=new Phaser.Signal;this.onKilled=new Phaser.Signal;this.onRevived=new Phaser.Signal;this.onOutOfBounds=new Phaser.Signal;this.onInputOver=null;this.onInputOut=null;this.onInputDown=null;this.onInputUp=null;this.onDragStart=null;this.onDragStop=null};Phaser.GameObjectFactory=function(c){this.game=c;this.world=this.game.world};Phaser.GameObjectFactory.prototype={game:null,world:null,sprite:function(c,f,d,e){return this.world.add(new Phaser.Sprite(this.game,c,f,d,e))},child:function(e,c,i,d,f){var h=this.world.add(new Phaser.Sprite(this.game,c,i,d,f));e.addChild(h);return h},tween:function(d,c){return this.game.tweens.create(d,c)},group:function(d,c){return new Phaser.Group(this.game,d,c)},audio:function(d,e,c){return this.game.sound.add(d,e,c)},tileSprite:function(d,i,f,c,e,h){return this.world.add(new Phaser.TileSprite(this.game,d,i,f,c,e,h))},text:function(c,f,e,d){return this.world.add(new Phaser.Text(this.game,c,f,e,d))}};Phaser.Sprite=function(d,c,h,e,f){c=c||0;h=h||0;e=e||null;f=f||null;this.game=d;this.exists=true;this.alive=true;this.group=null;this.name="";this.renderOrderID=-1;if(e){PIXI.Sprite.call(this,PIXI.TextureCache[e])}else{PIXI.Sprite.call(this)}this.events=new Phaser.Events(this);this.animations=new Phaser.AnimationManager(this);if(this.game.cache.isSpriteSheet(e)){this.animations.loadFrameData(this.game.cache.getFrameData(e));if(f!==null){if(typeof f==="string"){this.frameName=f}else{this.frame=f}}}else{this.currentFrame=this.game.cache.getFrame(e)}this.input=new Phaser.InputHandler(this);this.anchor=new Phaser.Point();this.x=c;this.y=h;this.position.x=c;this.position.y=h;this.autoCull=false;this.scale=new Phaser.Point(1,1);this.scrollFactor=new Phaser.Point(1,1);this._cache={dirty:false,a00:1,a01:0,a02:c,a10:0,a11:1,a12:h,id:1,i01:0,i10:0,idi:1,left:null,right:null,top:null,bottom:null,x:-1,y:-1,scaleX:1,scaleY:1,width:this.currentFrame.sourceSizeW,height:this.currentFrame.sourceSizeH,halfWidth:Math.floor(this.currentFrame.sourceSizeW/2),halfHeight:Math.floor(this.currentFrame.sourceSizeH/2),frameID:this.currentFrame.uuid,frameWidth:this.currentFrame.width,frameHeight:this.currentFrame.height,boundsX:0,boundsY:0,cameraVisible:true};this.offset=new Phaser.Point;this.center=new Phaser.Point(c+Math.floor(this._cache.width/2),h+Math.floor(this._cache.height/2));this.topLeft=new Phaser.Point(c,h);this.topRight=new Phaser.Point(c+this._cache.width,h);this.bottomRight=new Phaser.Point(c+this._cache.width,h+this._cache.height);this.bottomLeft=new Phaser.Point(c,h+this._cache.height);this.bounds=new Phaser.Rectangle(c,h,this._cache.width,this._cache.height);this.body=new Phaser.Physics.Arcade.Body(this)};Phaser.Sprite.prototype=Object.create(PIXI.Sprite.prototype);Phaser.Sprite.prototype.constructor=Phaser.Sprite;Phaser.Sprite.prototype.update=function(){if(!this.exists){this.renderOrderID=-1;return}this._cache.dirty=false;if(this.animations.update()){this._cache.dirty=true}this._cache.x=this.x-(this.game.world.camera.x*this.scrollFactor.x);this._cache.y=this.y-(this.game.world.camera.y*this.scrollFactor.y);if(this.position.x!=this._cache.x||this.position.y!=this._cache.y){this.position.x=this._cache.x;this.position.y=this._cache.y;this._cache.dirty=true}if(this.visible){this.renderOrderID=this.game.world.currentRenderOrderID++;if(this.worldTransform[0]!=this._cache.a00||this.worldTransform[1]!=this._cache.a01){this._cache.a00=this.worldTransform[0];this._cache.a01=this.worldTransform[1];this._cache.i01=this.worldTransform[1];this._cache.scaleX=Math.sqrt((this._cache.a00*this._cache.a00)+(this._cache.a01*this._cache.a01));this._cache.a01*=-1;this._cache.dirty=true}if(this.worldTransform[3]!=this._cache.a10||this.worldTransform[4]!=this._cache.a11){this._cache.a10=this.worldTransform[3];this._cache.i10=this.worldTransform[3];this._cache.a11=this.worldTransform[4];this._cache.scaleY=Math.sqrt((this._cache.a10*this._cache.a10)+(this._cache.a11*this._cache.a11));this._cache.a10*=-1;this._cache.dirty=true}if(this.worldTransform[2]!=this._cache.a02||this.worldTransform[5]!=this._cache.a12){this._cache.a02=this.worldTransform[2];this._cache.a12=this.worldTransform[5];this._cache.dirty=true}if(this.currentFrame.uuid!=this._cache.frameID){this._cache.frameWidth=this.texture.frame.width;this._cache.frameHeight=this.texture.frame.height;this._cache.frameID=this.currentFrame.uuid;this._cache.dirty=true}if(this._cache.dirty){this._cache.width=Math.floor(this.currentFrame.sourceSizeW*this._cache.scaleX);this._cache.height=Math.floor(this.currentFrame.sourceSizeH*this._cache.scaleY);this._cache.halfWidth=Math.floor(this._cache.width/2);this._cache.halfHeight=Math.floor(this._cache.height/2);this._cache.id=1/(this._cache.a00*this._cache.a11+this._cache.a01*-this._cache.a10);this._cache.idi=1/(this._cache.a00*this._cache.a11+this._cache.i01*-this._cache.i10);this.updateBounds()}}else{if(this._cache.dirty&&this.visible==false){this.bounds.x-=this._cache.boundsX-this._cache.x;this._cache.boundsX=this._cache.x;this.bounds.y-=this._cache.boundsy-this._cache.y;this._cache.boundsY=this._cache.y}}if(this._cache.dirty){this._cache.cameraVisible=Phaser.Rectangle.intersects(this.game.world.camera.screenView,this.bounds,0);if(this.autoCull==true){this.visible=this._cache.cameraVisible}this.body.updateBounds(this.center.x,this.center.y,this._cache.scaleX,this._cache.scaleY)}this.body.update()};Phaser.Sprite.prototype.postUpdate=function(){this.body.postUpdate()};Phaser.Sprite.prototype.updateBounds=function(){this.offset.setTo(this._cache.a02-(this.anchor.x*this._cache.width),this._cache.a12-(this.anchor.y*this._cache.height));this.getLocalPosition(this.center,this.offset.x+this._cache.halfWidth,this.offset.y+this._cache.halfHeight);this.getLocalPosition(this.topLeft,this.offset.x,this.offset.y);this.getLocalPosition(this.topRight,this.offset.x+this._cache.width,this.offset.y);this.getLocalPosition(this.bottomLeft,this.offset.x,this.offset.y+this._cache.height);this.getLocalPosition(this.bottomRight,this.offset.x+this._cache.width,this.offset.y+this._cache.height);this._cache.left=Phaser.Math.min(this.topLeft.x,this.topRight.x,this.bottomLeft.x,this.bottomRight.x);this._cache.right=Phaser.Math.max(this.topLeft.x,this.topRight.x,this.bottomLeft.x,this.bottomRight.x);this._cache.top=Phaser.Math.min(this.topLeft.y,this.topRight.y,this.bottomLeft.y,this.bottomRight.y);this._cache.bottom=Phaser.Math.max(this.topLeft.y,this.topRight.y,this.bottomLeft.y,this.bottomRight.y);this.bounds.setTo(this._cache.left,this._cache.top,this._cache.right-this._cache.left,this._cache.bottom-this._cache.top);this._cache.boundsX=this._cache.x;this._cache.boundsY=this._cache.y};Phaser.Sprite.prototype.getLocalPosition=function(d,c,e){d.x=((this._cache.a11*this._cache.id*c+-this._cache.a01*this._cache.id*e+(this._cache.a12*this._cache.a01-this._cache.a02*this._cache.a11)*this._cache.id)*this._cache.scaleX)+this._cache.a02;d.y=((this._cache.a00*this._cache.id*e+-this._cache.a10*this._cache.id*c+(-this._cache.a12*this._cache.a00+this._cache.a02*this._cache.a10)*this._cache.id)*this._cache.scaleY)+this._cache.a12;return d};Phaser.Sprite.prototype.getLocalUnmodifiedPosition=function(d,c,e){d.x=this._cache.a11*this._cache.idi*c+-this._cache.i01*this._cache.idi*e+(this._cache.a12*this._cache.i01-this._cache.a02*this._cache.a11)*this._cache.idi;d.y=this._cache.a00*this._cache.idi*e+-this._cache.i10*this._cache.idi*c+(-this._cache.a12*this._cache.a00+this._cache.a02*this._cache.i10)*this._cache.idi;return d};Phaser.Sprite.prototype.bringToTop=function(){if(this.group){this.group.bringToTop(this)}else{this.game.world.bringToTop(this)}};Phaser.Sprite.prototype.getBounds=function(e){e=e||new Phaser.Rectangle;var h=Phaser.Math.min(this.topLeft.x,this.topRight.x,this.bottomLeft.x,this.bottomRight.x);var d=Phaser.Math.max(this.topLeft.x,this.topRight.x,this.bottomLeft.x,this.bottomRight.x);var f=Phaser.Math.min(this.topLeft.y,this.topRight.y,this.bottomLeft.y,this.bottomRight.y);var c=Phaser.Math.max(this.topLeft.y,this.topRight.y,this.bottomLeft.y,this.bottomRight.y);e.x=h;e.y=f;e.width=d-h;e.height=c-f;return e};Object.defineProperty(Phaser.Sprite.prototype,"angle",{get:function(){return Phaser.Math.radToDeg(this.rotation)},set:function(c){this.rotation=Phaser.Math.degToRad(c)}});Object.defineProperty(Phaser.Sprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(c){this.animations.frame=c}});Object.defineProperty(Phaser.Sprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(c){this.animations.frameName=c}});Object.defineProperty(Phaser.Sprite.prototype,"inCamera",{get:function(){return this._cache.cameraVisible}});Object.defineProperty(Phaser.Sprite.prototype,"inputEnabled",{get:function(){return(this.input.enabled)},set:function(c){if(c){if(this.input.enabled==false){this.input.start()}}else{if(this.input.enabled){this.input.stop()}}}});Phaser.TileSprite=function(e,d,j,h,c,f,i){d=d||0;j=j||0;h=h||256;c=c||256;f=f||null;i=i||null;Phaser.Sprite.call(this,e,d,j,f,i);this.texture=PIXI.TextureCache[f];PIXI.TilingSprite.call(this,this.texture,h,c);this.tileScale=new Phaser.Point(1,1);this.tilePosition=new Phaser.Point(0,0)};Phaser.TileSprite.prototype=Phaser.Utils.extend(true,PIXI.TilingSprite.prototype,Phaser.Sprite.prototype);Phaser.TileSprite.prototype.constructor=Phaser.TileSprite;Phaser.Text=function(d,c,i,h,e){c=c||0;i=i||0;h=h||"";e=e||"";this.canvas=document.createElement("canvas");this.context=this.canvas.getContext("2d");var f=d.rnd.uuid();PIXI.TextureCache[f]=new PIXI.Texture(new PIXI.BaseTexture(this.canvas));Phaser.Sprite.call(this,d,c,i,f);this.setText(h);this.setStyle(e);this.updateText();this.dirty=false};Phaser.Text.prototype=Phaser.Utils.extend(true,Phaser.Sprite.prototype,PIXI.Text.prototype);Phaser.Text.prototype.constructor=Phaser.Text;Phaser.Canvas={getOffset:function(d,c){if(typeof c==="undefined"){c=new Phaser.Point}var e=d.getBoundingClientRect();var j=d.clientTop||document.body.clientTop||0;var i=d.clientLeft||document.body.clientLeft||0;var f=window.pageYOffset||d.scrollTop||document.body.scrollTop;var h=window.pageXOffset||d.scrollLeft||document.body.scrollLeft;c.x=e.left+h-i;c.y=e.top+f-j;return c},getAspectRatio:function(c){return c.width/c.height},setBackgroundColor:function(d,c){if(typeof c==="undefined"){c="rgb(0,0,0)"}d.style.backgroundColor=c;return d},setTouchAction:function(c,d){if(typeof d==="undefined"){d="none"}c.style.msTouchAction=d;c.style["ms-touch-action"]=d;c.style["touch-action"]=d;return c},addToDOM:function(c,d,e){if(typeof d==="undefined"){d=""}if(typeof e==="undefined"){e=true}if((d!==""||d!==null)&&document.getElementById(d)){document.getElementById(d).appendChild(c);if(e){document.getElementById(d).style.overflow="hidden"}}else{document.body.appendChild(c)}return c},setTransform:function(h,j,i,e,c,f,d){h.setTransform(e,f,d,c,j,i);return h},setSmoothingEnabled:function(c,d){c.imageSmoothingEnabled=d;c.mozImageSmoothingEnabled=d;c.oImageSmoothingEnabled=d;c.webkitImageSmoothingEnabled=d;c.msImageSmoothingEnabled=d;return c},setImageRenderingCrisp:function(c){c.style["image-rendering"]="crisp-edges";c.style["image-rendering"]="-moz-crisp-edges";c.style["image-rendering"]="-webkit-optimize-contrast";c.style.msInterpolationMode="nearest-neighbor";return c},setImageRenderingBicubic:function(c){c.style["image-rendering"]="auto";c.style.msInterpolationMode="bicubic";return c}};Phaser.Device=function(){this.patchAndroidClearRectBug=false;this.desktop=false;this.iOS=false;this.android=false;this.chromeOS=false;this.linux=false;this.macOS=false;this.windows=false;this.canvas=false;this.file=false;this.fileSystem=false;this.localStorage=false;this.webGL=false;this.worker=false;this.touch=false;this.mspointer=false;this.css3D=false;this.arora=false;this.chrome=false;this.epiphany=false;this.firefox=false;this.ie=false;this.ieVersion=0;this.mobileSafari=false;this.midori=false;this.opera=false;this.safari=false;this.webApp=false;this.audioData=false;this.webAudio=false;this.ogg=false;this.opus=false;this.mp3=false;this.wav=false;this.m4a=false;this.webm=false;this.iPhone=false;this.iPhone4=false;this.iPad=false;this.pixelRatio=0;this._checkAudio();this._checkBrowser();this._checkCSS3D();this._checkDevice();this._checkFeatures();this._checkOS()};Phaser.Device.prototype={_checkOS:function(){var c=navigator.userAgent;if(/Android/.test(c)){this.android=true}else{if(/CrOS/.test(c)){this.chromeOS=true}else{if(/iP[ao]d|iPhone/i.test(c)){this.iOS=true}else{if(/Linux/.test(c)){this.linux=true}else{if(/Mac OS/.test(c)){this.macOS=true}else{if(/Windows/.test(c)){this.windows=true}}}}}}if(this.windows||this.macOS||this.linux){this.desktop=true}},_checkFeatures:function(){this.canvas=!!window.CanvasRenderingContext2D;try{this.localStorage=!!localStorage.getItem}catch(c){this.localStorage=false}this.file=!!window.File&&!!window.FileReader&&!!window.FileList&&!!window.Blob;this.fileSystem=!!window.requestFileSystem;this.webGL=(function(){try{return !!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(d){return false}})();this.worker=!!window.Worker;if("ontouchstart" in document.documentElement||window.navigator.msPointerEnabled){this.touch=true}if(window.navigator.msPointerEnabled){this.mspointer=true}},_checkBrowser:function(){var c=navigator.userAgent;if(/Arora/.test(c)){this.arora=true}else{if(/Chrome/.test(c)){this.chrome=true}else{if(/Epiphany/.test(c)){this.epiphany=true}else{if(/Firefox/.test(c)){this.firefox=true}else{if(/Mobile Safari/.test(c)){this.mobileSafari=true}else{if(/MSIE (\d+\.\d+);/.test(c)){this.ie=true;this.ieVersion=parseInt(RegExp.$1)}else{if(/Midori/.test(c)){this.midori=true}else{if(/Opera/.test(c)){this.opera=true}else{if(/Safari/.test(c)){this.safari=true}}}}}}}}}if(navigator.standalone){this.webApp=true}},_checkAudio:function(){this.audioData=!!(window.Audio);this.webAudio=!!(window.webkitAudioContext||window.AudioContext);var f=document.createElement("audio");var c=false;try{if(c=!!f.canPlayType){if(f.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")){this.ogg=true}if(f.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")){this.opus=true}if(f.canPlayType("audio/mpeg;").replace(/^no$/,"")){this.mp3=true}if(f.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")){this.wav=true}if(f.canPlayType("audio/x-m4a;")||f.canPlayType("audio/aac;").replace(/^no$/,"")){this.m4a=true}if(f.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")){this.webm=true}}}catch(d){}},_checkDevice:function(){this.pixelRatio=window.devicePixelRatio||1;this.iPhone=navigator.userAgent.toLowerCase().indexOf("iphone")!=-1;this.iPhone4=(this.pixelRatio==2&&this.iPhone);this.iPad=navigator.userAgent.toLowerCase().indexOf("ipad")!=-1},_checkCSS3D:function(){var e=document.createElement("p");var f;var d={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(e,null);for(var c in d){if(e.style[c]!==undefined){e.style[c]="translate3d(1px,1px,1px)";f=window.getComputedStyle(e).getPropertyValue(d[c])}}document.body.removeChild(e);this.css3D=(f!==undefined&&f.length>0&&f!=="none")},canPlayAudio:function(c){if(c=="mp3"&&this.mp3){return true}else{if(c=="ogg"&&(this.ogg||this.opus)){return true}else{if(c=="m4a"&&this.m4a){return true}else{if(c=="wav"&&this.wav){return true}else{if(c=="webm"&&this.webm){return true}}}}}return false},isConsoleOpen:function(){if(window.console&&window.console.firebug){return true}if(window.console){console.profile();console.profileEnd();if(console.clear){console.clear()}return console.profiles.length>0}return false}};Phaser.RequestAnimationFrame=function(d){this.game=d;this._isSetTimeOut=false;this.isRunning=false;var e=["ms","moz","webkit","o"];for(var c=0;c>>0;d-=f;d*=f;f=d>>>0;d-=f;f+=d*4294967296}return(f>>>0)*2.3283064365386963e-10},integer:function(){return this.rnd.apply(this)*4294967296},frac:function(){return this.rnd.apply(this)+(this.rnd.apply(this)*2097152|0)*1.1102230246251565e-16},real:function(){return this.integer()+this.frac()},integerInRange:function(d,c){return Math.floor(this.realInRange(d,c))},realInRange:function(d,c){d=d||0;c=c||0;return this.frac()*(c-d)+d},normal:function(){return 1-2*this.frac()},uuid:function(){var d,c;for(c=d="";d++<36;c+=~d%5|d*3&4?(d^15?8^this.frac()*(d^20?16:4):4).toString(16):"-"){}return c},pick:function(c){return c[this.integerInRange(0,c.length)]},weightedPick:function(c){return c[~~(Math.pow(this.frac(),2)*c.length)]},timestamp:function(d,c){return this.realInRange(d||946684800000,c||1577862000000)},angle:function(){return this.integerInRange(-180,180)}};Phaser.Math={PI2:Math.PI*2,fuzzyEqual:function(d,c,e){if(typeof e==="undefined"){e=0.0001}return Math.abs(d-c)c-e},fuzzyCeil:function(c,d){if(typeof d==="undefined"){d=0.0001}return Math.ceil(c-d)},fuzzyFloor:function(c,d){if(typeof d==="undefined"){d=0.0001}return Math.floor(c+d)},average:function(){var c=[];for(var e=0;e<(arguments.length-0);e++){c[e]=arguments[e+0]}var f=0;for(var d=0;d0)?Math.floor(c):Math.ceil(c)},shear:function(c){return c%1},snapTo:function(c,e,d){if(typeof d==="undefined"){d=0}if(e==0){return c}c-=d;c=e*Math.round(c/e);return d+c},snapToFloor:function(c,e,d){if(typeof d==="undefined"){d=0}if(e==0){return c}c-=d;c=e*Math.floor(c/e);return d+c},snapToCeil:function(c,e,d){if(typeof d==="undefined"){d=0}if(e==0){return c}c-=d;c=e*Math.ceil(c/e);return d+c},snapToInArray:function(e,d,h){if(typeof h==="undefined"){h=true}if(h){d.sort()}if(ee/2){d+=e*2}if(c<-e/2&&d>e/2){c+=e*2}return c-d},interpolateAngles:function(d,c,e,f,h){if(typeof f==="undefined"){f=true}if(typeof h==="undefined"){h=null}d=this.normalizeAngle(d,f);c=this.normalizeAngleToAnother(c,d,f);return(typeof h==="function")?h(e,d,c-d,1):this.interpolateFloat(d,c,e)},chanceRoll:function(c){if(typeof c==="undefined"){c=50}if(c<=0){return false}else{if(c>=100){return true}else{if(Math.random()*100>=c){return false}else{return true}}}},maxAdd:function(e,d,c){e+=d;if(e>c){e=c}return e},minSub:function(e,d,c){e-=d;if(e0.5)?1:-1},isOdd:function(c){return(c&1)},isEven:function(c){if(c&1){return false}else{return true}},max:function(){for(var e=1,d=0,c=arguments.length;e=-180&&d<=180){return d}c=(d+180)%360;if(c<0){c+=360}return c-180},angleLimit:function(f,e,d){var c=f;if(f>d){c=d}else{if(f1){return this.linear(e[c],e[c-1],c-j)}return this.linear(e[h],e[h+1>c?c:h+1],j-h)},bezierInterpolation:function(e,d){var c=0;var h=e.length-1;for(var f=0;f<=h;f++){c+=Math.pow(1-d,h-f)*Math.pow(d,f)*e[f]*this.bernstein(h,f)}return c},catmullRomInterpolation:function(e,d){var c=e.length-1;var j=c*d;var h=Math.floor(j);if(e[0]===e[c]){if(d<0){h=Math.floor(j=c*(1+d))}return this.catmullRom(e[(h-1+c)%c],e[h],e[(h+1)%c],e[(h+2)%c],j-h)}else{if(d<0){return e[0]-(this.catmullRom(e[0],e[0],e[1],e[1],-j)-e[0])}if(d>1){return e[c]-(this.catmullRom(e[c],e[c],e[c-1],e[c-1],j-c)-e[c])}return this.catmullRom(e[h?h-1:0],e[h],e[ce.length-f)){c=e.length-f}if(c>0){return e[f+Math.floor(Math.random()*c)]}}return null},floor:function(c){var d=c|0;return(c>0)?(d):((d!=c)?(d-1):(d))},ceil:function(c){var d=c|0;return(c>0)?((d!=c)?(d+1):(d)):(d)},sinCosGenerator:function(d,l,e,j){if(typeof l==="undefined"){l=1}if(typeof e==="undefined"){e=1}if(typeof j==="undefined"){j=1}var k=l;var n=e;var h=j*Math.PI/d;var f=[];var m=[];for(var i=0;i0;e--){var d=Math.floor(Math.random()*(e+1));var c=f[e];f[e]=f[d];f[d]=c}return f},distance:function(f,i,e,h){var d=f-e;var c=i-h;return Math.sqrt(d*d+c*c)},distanceRounded:function(d,f,c,e){return Math.round(Phaser.Math.distance(d,f,c,e))},clamp:function(d,e,c){return(dc)?c:d)},clampBottom:function(c,d){return c=c){return 1}d=(d-e)/(c-e);return d*d*(3-2*d)},smootherstep:function(d,e,c){if(d<=e){return 0}if(d>=c){return 1}d=(d-e)/(c-e);return d*d*d*(d*(d*6-15)+10)},sign:function(c){return(c<0)?-1:((c>0)?1:0)},degToRad:function(){var c=Math.PI/180;return function(d){return d*c}}(),radToDeg:function(){var c=180/Math.PI;return function(d){return d*c}}()};Phaser.QuadTree=function(i,d,k,h,c,f,e,j){this.physicsManager=i;this.ID=i.quadTreeID;i.quadTreeID++;this.maxObjects=f||10;this.maxLevels=e||4;this.level=j||0;this.bounds={x:Math.round(d),y:Math.round(k),width:h,height:c,subWidth:Math.floor(h/2),subHeight:Math.floor(c/2),right:Math.round(d)+Math.floor(h/2),bottom:Math.round(k)+Math.floor(c/2)};this.objects=[];this.nodes=[]};Phaser.QuadTree.prototype={split:function(){this.level++;this.nodes[0]=new Phaser.QuadTree(this.physicsManager,this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level);this.nodes[1]=new Phaser.QuadTree(this.physicsManager,this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level);this.nodes[2]=new Phaser.QuadTree(this.physicsManager,this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level);this.nodes[3]=new Phaser.QuadTree(this.physicsManager,this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level)},insert:function(c){var e=0;var d;if(this.nodes[0]!=null){d=this.getIndex(c);if(d!==-1){this.nodes[d].insert(c);return}}this.objects.push(c);if(this.objects.length>this.maxObjects&&this.levelthis.bounds.bottom)){c=2}}}else{if(d.x>this.bounds.right){if((d.ythis.bounds.bottom)){c=3}}}}return c},retrieve:function(c){var d=this.objects;c.body.quadTreeIndex=this.getIndex(c.body);c.body.quadTreeIDs.push(this.ID);if(this.nodes[0]){if(c.body.quadTreeIndex!==-1){d=d.concat(this.nodes[c.body.quadTreeIndex].retrieve(c))}else{d=d.concat(this.nodes[0].retrieve(c));d=d.concat(this.nodes[1].retrieve(c));d=d.concat(this.nodes[2].retrieve(c));d=d.concat(this.nodes[3].retrieve(c))}}return d},clear:function(){this.objects=[];for(var d=0,c=this.nodes.length;d0){this._diameter=c;this._radius=c*0.5}},enumerable:true,configurable:true});Object.defineProperty(Phaser.Circle.prototype,"radius",{get:function(){return this._radius},set:function(c){if(c>0){this._radius=c;this._diameter=c*2}},enumerable:true,configurable:true});Object.defineProperty(Phaser.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(c){if(c>this.x){this._radius=0;this._diameter=0}else{this.radius=this.x-c}},enumerable:true,configurable:true});Object.defineProperty(Phaser.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(c){if(cthis.y){this._radius=0;this._diameter=0}else{this.radius=this.y-c}},enumerable:true,configurable:true});Object.defineProperty(Phaser.Circle.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(c){if(c0){return Math.PI*this._radius*this._radius}else{return 0}},enumerable:true,configurable:true});Object.defineProperty(Phaser.Circle.prototype,"empty",{get:function(){return(this._diameter==0)},set:function(c){this.setTo(0,0,0)},enumerable:true,configurable:true});Phaser.Circle.contains=function(e,c,h){if(c>=e.left&&c<=e.right&&h>=e.top&&h<=e.bottom){var f=(e.x-c)*(e.x-c);var d=(e.y-h)*(e.y-h);return(f+d)<=(e.radius*e.radius)}return false};Phaser.Circle.equals=function(d,c){return(d.x==c.x&&d.y==c.y&&d.diameter==c.diameter)};Phaser.Circle.intersects=function(d,c){return(Phaser.Math.distance(d.x,d.y,c.x,c.y)<=(d.radius+c.radius))};Phaser.Circle.circumferencePoint=function(c,f,e,d){if(typeof e==="undefined"){e=false}if(typeof d==="undefined"){d=new Phaser.Point()}if(e===true){f=Phaser.Math.radToDeg(f)}d.x=c.x+c.radius*Math.cos(f);d.y=c.y+c.radius*Math.sin(f);return d};Phaser.Circle.intersectsRectangle=function(o,e){var i=Math.abs(o.x-e.x-e.halfWidth);var n=e.halfWidth+o.radius;if(i>n){return false}var h=Math.abs(o.y-e.y-e.halfHeight);var l=e.halfHeight+o.radius;if(h>l){return false}if(i<=e.halfWidth||h<=e.halfHeight){return true}var j=i-e.halfWidth;var f=h-e.halfHeight;var m=j*j;var d=f*f;var k=o.radius*o.radius;return m+d<=k};Phaser.Point=function(c,d){if(typeof c==="undefined"){c=0}if(typeof d==="undefined"){d=0}this.x=c;this.y=d};Phaser.Point.prototype={copyFrom:function(c){return this.setTo(c.x,c.y)},invert:function(){return this.setTo(this.y,this.x)},setTo:function(c,d){this.x=c;this.y=d;return this},add:function(c,d){this.x+=c;this.y+=d;return this},subtract:function(c,d){this.x-=c;this.y-=d;return this},multiply:function(c,d){this.x*=c;this.y*=d;return this},divide:function(c,d){this.x/=c;this.y/=d;return this},clampX:function(d,c){this.x=Phaser.Math.clamp(this.x,d,c);return this},clampY:function(d,c){this.y=Phaser.Math.clamp(this.y,d,c);return this},clamp:function(d,c){this.x=Phaser.Math.clamp(this.x,d,c);this.y=Phaser.Math.clamp(this.y,d,c);return this},clone:function(c){if(typeof c==="undefined"){c=new Phaser.Point}return c.setTo(this.x,this.y)},copyFrom:function(c){return this.setTo(c.x,c.y)},copyTo:function(c){c[x]=this.x;c[y]=this.y;return c},distance:function(d,c){return Phaser.Point.distance(this,d,c)},equals:function(c){return(c.x==this.x&&c.y==this.y)},rotate:function(c,h,e,d,f){return Phaser.Point.rotate(this,c,h,e,d,f)},toString:function(){return"[{Point (x="+this.x+" y="+this.y+")}]"}};Phaser.Point.add=function(d,c,e){if(typeof e==="undefined"){e=new Phaser.Point()}e.x=d.x+c.x;e.y=d.y+c.y;return e};Phaser.Point.subtract=function(d,c,e){if(typeof e==="undefined"){e=new Phaser.Point()}e.x=d.x-c.x;e.y=d.y-c.y;return e};Phaser.Point.multiply=function(d,c,e){if(typeof e==="undefined"){e=new Phaser.Point()}e.x=d.x*c.x;e.y=d.y*c.y;return e};Phaser.Point.divide=function(d,c,e){if(typeof e==="undefined"){e=new Phaser.Point()}e.x=d.x/c.x;e.y=d.y/c.y;return e};Phaser.Point.equals=function(d,c){return(d.x==c.x&&d.y==c.y)};Phaser.Point.distance=function(d,c,e){if(typeof e==="undefined"){e=false}if(e){return Phaser.Math.distanceRound(d.x,d.y,c.x,c.y)}else{return Phaser.Math.distance(d.x,d.y,c.x,c.y)}},Phaser.Point.rotate=function(d,c,i,f,e,h){e=e||false;h=h||null;if(e){f=Phaser.Math.radToDeg(f)}if(h===null){h=Math.sqrt(((c-d.x)*(c-d.x))+((i-d.y)*(i-d.y)))}return d.setTo(c+h*Math.cos(f),i+h*Math.sin(f))};Phaser.Rectangle=function(d,f,e,c){d=d||0;f=f||0;e=e||0;c=c||0;this.x=d;this.y=f;this.width=e;this.height=c};Phaser.Rectangle.prototype={x:0,y:0,width:0,height:0,offset:function(d,c){this.x+=d;this.y+=c;return this},offsetPoint:function(c){return this.offset(c.x,c.y)},setTo:function(d,f,e,c){this.x=d;this.y=f;this.width=e;this.height=c;return this},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y)},copyFrom:function(c){return this.setTo(c.x,c.y,c.width,c.height)},copyTo:function(c){c.x=this.x;c.y=this.y;c.width=this.width;c.height=this.height;return c},inflate:function(d,c){return Phaser.Rectangle.inflate(this,d,c)},size:function(c){return Phaser.Rectangle.size(this,c)},clone:function(c){return Phaser.Rectangle.clone(this,c)},contains:function(c,d){return Phaser.Rectangle.contains(this,c,d)},containsRect:function(c){return Phaser.Rectangle.containsRect(this,c)},equals:function(c){return Phaser.Rectangle.equals(this,c)},intersection:function(c,d){return Phaser.Rectangle.intersection(this,c,output)},intersects:function(c,d){return Phaser.Rectangle.intersects(this,c,d)},intersectsRaw:function(h,e,f,d,c){return Phaser.Rectangle.intersectsRaw(this,h,e,f,d,c)},union:function(c,d){return Phaser.Rectangle.union(this,c,d)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}};Object.defineProperty(Phaser.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(c){if(c<=this.y){this.height=0}else{this.height=(this.y-c)}},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"bottomRight",{get:function(){return new Phaser.Point(this.right,this.bottom)},set:function(c){this.right=c.x;this.bottom=c.y},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"left",{get:function(){return this.x},set:function(c){if(c>=this.right){this.width=0}else{this.width=this.right-c}this.x=c},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(c){if(c<=this.x){this.width=0}else{this.width=this.x+c}},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"volume",{get:function(){return this.width*this.height},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"perimeter",{get:function(){return(this.width*2)+(this.height*2)},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(c){this.x=c-this.halfWidth},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(c){this.y=c-this.halfHeight},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"top",{get:function(){return this.y},set:function(c){if(c>=this.bottom){this.height=0;this.y=c}else{this.height=(this.bottom-c)}},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"topLeft",{get:function(){return new Phaser.Point(this.x,this.y)},set:function(c){this.x=c.x;this.y=c.y},enumerable:true,configurable:true});Object.defineProperty(Phaser.Rectangle.prototype,"empty",{get:function(){return(!this.width||!this.height)},set:function(c){this.setTo(0,0,0,0)},enumerable:true,configurable:true});Phaser.Rectangle.inflate=function(d,e,c){d.x-=e;d.width+=2*e;d.y-=c;d.height+=2*c;return d};Phaser.Rectangle.inflatePoint=function(d,c){return Phaser.Phaser.Rectangle.inflate(d,c.x,c.y)};Phaser.Rectangle.size=function(c,d){if(typeof d==="undefined"){d=new Phaser.Point()}return d.setTo(c.width,c.height)};Phaser.Rectangle.clone=function(c,d){if(typeof d==="undefined"){d=new Phaser.Rectangle()}return d.setTo(c.x,c.y,c.width,c.height)};Phaser.Rectangle.contains=function(d,c,e){return(c>=d.x&&c<=d.right&&e>=d.y&&e<=d.bottom)};Phaser.Rectangle.containsPoint=function(d,c){return Phaser.Phaser.Rectangle.contains(d,c.x,c.y)};Phaser.Rectangle.containsRect=function(d,c){if(d.volume>c.volume){return false}return(d.x>=c.x&&d.y>=c.y&&d.right<=c.right&&d.bottom<=c.bottom)};Phaser.Rectangle.equals=function(d,c){return(d.x==c.x&&d.y==c.y&&d.width==c.width&&d.height==c.height)};Phaser.Rectangle.intersection=function(d,c,e){e=e||new Phaser.Rectangle;if(Phaser.Rectangle.intersects(d,c)){e.x=Math.max(d.x,c.x);e.y=Math.max(d.y,c.y);e.width=Math.min(d.right,c.right)-e.x;e.height=Math.min(d.bottom,c.bottom)-e.y}return e};Phaser.Rectangle.intersects=function(d,c,e){e=e||0;return !(d.left>c.right+e||d.rightc.bottom+e||d.bottomc.right+d||fc.bottom+d||e1){if(h&&h==this.decodeURI(e[0])){return this.decodeURI(e[1])}else{d[this.decodeURI(e[0])]=this.decodeURI(e[1])}}}return d},decodeURI:function(c){return decodeURIComponent(c.replace(/\+/g," "))}};Phaser.TweenManager=function(c){this.game=c;this._tweens=[]};Phaser.TweenManager.prototype={REVISION:"11dev",getAll:function(){return this._tweens},removeAll:function(){this._tweens=[]},add:function(c){this._tweens.push(c)},create:function(c,d){if(typeof d==="undefined"){d=false}if(d){c.tween=new Phaser.Tween(c,this.game);return c.tween}else{return new Phaser.Tween(c,this.game)}},remove:function(d){var c=this._tweens.indexOf(d);if(c!==-1){this._tweens.splice(c,1)}},update:function(){if(this._tweens.length===0){return false}var c=0,d=this._tweens.length;while(c=0;c--){this._tweens[c].pause()}},resumeAll:function(){for(var c=this._tweens.length-1;c>=0;c--){this._tweens[c].resume()}}};Phaser.Tween=function(d,c){this._object=d;this.game=c;this._manager=this.game.tweens;this._valuesStart={};this._valuesEnd={};this._valuesStartRepeat={};this._duration=1000;this._repeat=0;this._yoyo=false;this._reversed=false;this._delayTime=0;this._startTime=null;this._easingFunction=Phaser.Easing.Linear.None;this._interpolationFunction=Phaser.Math.linearInterpolation;this._chainedTweens=[];this._onStartCallback=null;this._onStartCallbackFired=false;this._onUpdateCallback=null;this._onCompleteCallback=null;this._pausedTime=0;for(var e in d){this._valuesStart[e]=parseFloat(d[e],10)}this.onStart=new Phaser.Signal();this.onComplete=new Phaser.Signal();this.isRunning=false};Phaser.Tween.prototype={to:function(e,i,j,d,c,h,f){i=i||1000;j=j||null;d=d||false;c=c||0;h=h||0;f=f||false;this._repeat=h;this._duration=i;this._valuesEnd=e;if(j!==null){this._easingFunction=j}if(c>0){this._delayTime=c}this._yoyo=f;if(d){return this.start()}else{return this}},start:function(d){if(this.game===null||this._object===null){return}this._manager.add(this);this.onStart.dispatch(this._object);this.isRunning=true;this._onStartCallbackFired=false;this._startTime=this.game.time.now+this._delayTime;for(var c in this._valuesEnd){if(this._valuesEnd[c] instanceof Array){if(this._valuesEnd[c].length===0){continue}this._valuesEnd[c]=[this._object[c]].concat(this._valuesEnd[c])}this._valuesStart[c]=this._object[c];if((this._valuesStart[c] instanceof Array)===false){this._valuesStart[c]*=1}this._valuesStartRepeat[c]=this._valuesStart[c]||0}return this},stop:function(){this._manager.remove(this);this.isRunning=false;return this},delay:function(c){this._delayTime=c;return this},repeat:function(c){this._repeat=c;return this},yoyo:function(c){this._yoyo=c;return this},easing:function(c){this._easingFunction=c;return this},interpolation:function(c){this._interpolationFunction=c;return this},chain:function(){this._chainedTweens=arguments;return this},onStart:function(c){this._onStartCallback=c;return this},onUpdate:function(c){this._onUpdateCallback=c;return this},onComplete:function(c){this._onCompleteCallback=c;return this},pause:function(){this._paused=true},resume:function(){this._paused=false;this._startTime+=this.game.time.pauseDuration},update:function(d){if(this._paused||d1?1:m;var k=this._easingFunction(m);for(l in this._valuesEnd){var c=this._valuesStart[l]||0;var e=this._valuesEnd[l];if(e instanceof Array){this._object[l]=this._interpolationFunction(e,k)}else{if(typeof(e)==="string"){e=c+parseFloat(e,10)}if(typeof(e)==="number"){this._object[l]=c+(e-c)*k}}}if(this._onUpdateCallback!==null){this._onUpdateCallback.call(this._object,k)}if(m==1){if(this._repeat>0){if(isFinite(this._repeat)){this._repeat--}for(l in this._valuesStartRepeat){if(typeof(this._valuesEnd[l])==="string"){this._valuesStartRepeat[l]=this._valuesStartRepeat[l]+parseFloat(this._valuesEnd[l],10)}if(this._yoyo){var f=this._valuesStartRepeat[l];this._valuesStartRepeat[l]=this._valuesEnd[l];this._valuesEnd[l]=f;this._reversed=!this._reversed}this._valuesStart[l]=this._valuesStartRepeat[l]}this._startTime=d+this._delayTime;this.onComplete.dispatch(this._object);if(this._onCompleteCallback!==null){this._onCompleteCallback.call(this._object)}return true}else{this.onComplete.dispatch(this._object);if(this._onCompleteCallback!==null){this._onCompleteCallback.call(this._object)}for(var h=0,j=this._chainedTweens.length;hthis._timeLastSecond+1000){this.fps=Math.round((this.frames*1000)/(this.now-this._timeLastSecond));this.fpsMin=Math.min(this.fpsMin,this.fps);this.fpsMax=Math.max(this.fpsMax,this.fps);this._timeLastSecond=this.now;this.frames=0}this.time=this.now;this.lastTime=c+this.timeToCall;this.physicsElapsed=1*(this.elapsed/1000);if(this.game.paused){this.pausedTime=this.now-this._pauseStarted}},gamePaused:function(){this._pauseStarted=this.now},gameResumed:function(){this.elapsed=0;this.physicsElapsed=0;this.time=Date.now();this.pauseDuration=this.pausedTime},elapsedSince:function(c){return this.now-c},elapsedSecondsSince:function(c){return(this.now-c)*0.001},reset:function(){this._started=this.now}};Phaser.AnimationManager=function(c){this._frameData=null;this.currentFrame=null;this._parent=c;this.game=c.game;this._anims={}};Phaser.AnimationManager.prototype={updateIfVisible:true,loadFrameData:function(c){this._frameData=c;this.frame=0},add:function(f,h,e,d,c){h=h||null;e=e||60;d=d||false;c=c||true;if(this._frameData==null){console.warn("No frameData available for Phaser.Animation "+f);return}if(h==null){h=this._frameData.getFrameIndexes()}else{if(this.validateFrames(h,c)==false){console.warn("Invalid frames given to Phaser.Animation "+f);return}}if(c==false){h=this._frameData.getFrameIndexesByName(h)}this._anims[f]=new Phaser.Animation(this.game,this._parent,this._frameData,f,h,e,d);this.currentAnim=this._anims[f];this.currentFrame=this.currentAnim.currentFrame;this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);return this._anims[f]},validateFrames:function(e,c){for(var d=0;dthis._frameData.total){return false}}else{if(this._frameData.checkFrameName(e[d])==false){return false}}}return true},play:function(e,d,c){d=d||null;c=c||null;if(this._anims[e]){if(this.currentAnim==this._anims[e]){if(this.currentAnim.isPlaying==false){return this.currentAnim.play(d,c)}}else{this.currentAnim=this._anims[e];return this.currentAnim.play(d,c)}}},stop:function(c){if(this._anims[c]){this.currentAnim=this._anims[c];this.currentAnim.stop()}},update:function(){if(this.updateIfVisible&&this._parent.visible==false){return false}if(this.currentAnim&&this.currentAnim.update()==true){this.currentFrame=this.currentAnim.currentFrame;this._parent.currentFrame=this.currentFrame;return true}return false},destroy:function(){this._anims={};this._frameData=null;this._frameIndex=0;this.currentAnim=null;this.currentFrame=null}};Object.defineProperty(Phaser.AnimationManager.prototype,"frameData",{get:function(){return this._frameData},enumerable:true,configurable:true});Object.defineProperty(Phaser.AnimationManager.prototype,"frameTotal",{get:function(){if(this._frameData){return this._frameData.total}else{return -1}},enumerable:true,configurable:true});Object.defineProperty(Phaser.AnimationManager.prototype,"frame",{get:function(){if(this.currentFrame){return this._frameIndex}},set:function(c){if(this._frameData&&this._frameData.getFrame(c)!==null){this.currentFrame=this._frameData.getFrame(c);this._frameIndex=c;this._parent.currentFrame=this.currentFrame;this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid])}},enumerable:true,configurable:true});Object.defineProperty(Phaser.AnimationManager.prototype,"frameName",{get:function(){if(this.currentFrame){return this.currentFrame.name}},set:function(c){if(this._frameData&&this._frameData.getFrameByName(c)){this.currentFrame=this._frameData.getFrameByName(c);this._frameIndex=this.currentFrame.index;this._parent.currentFrame=this.currentFrame;this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid])}else{console.warn("Cannot set frameName: "+c)}},enumerable:true,configurable:true});Phaser.Animation=function(d,i,h,f,j,e,c){this.game=d;this._parent=i;this._frames=j;this._frameData=h;this.name=f;this.delay=1000/e;this.looped=c;this.isFinished=false;this.isPlaying=false;this._frameIndex=0;this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex])};Phaser.Animation.prototype={play:function(d,c){d=d||null;c=c||null;if(d!==null){this.delay=1000/d}if(c!==null){this.looped=c}this.isPlaying=true;this.isFinished=false;this._timeLastFrame=this.game.time.now;this._timeNextFrame=this.game.time.now+this.delay;this._frameIndex=0;this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]);this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);return this},restart:function(){this.isPlaying=true;this.isFinished=false;this._timeLastFrame=this.game.time.now;this._timeNextFrame=this.game.time.now+this.delay;this._frameIndex=0;this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex])},stop:function(){this.isPlaying=false;this.isFinished=true},update:function(){if(this.isPlaying==true&&this.game.time.now>=this._timeNextFrame){this._frameIndex++;if(this._frameIndex==this._frames.length){if(this.looped){this._frameIndex=0;this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]);this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid])}else{this.onComplete()}}else{this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]);this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid])}this._timeLastFrame=this.game.time.now;this._timeNextFrame=this.game.time.now+this.delay;return true}return false},destroy:function(){this.game=null;this._parent=null;this._frames=null;this._frameData=null;this.currentFrame=null;this.isPlaying=false},onComplete:function(){this.isPlaying=false;this.isFinished=true}};Object.defineProperty(Phaser.Animation.prototype,"frameTotal",{get:function(){return this._frames.length},enumerable:true,configurable:true});Object.defineProperty(Phaser.Animation.prototype,"frame",{get:function(){if(this.currentFrame!==null){return this.currentFrame.index}else{return this._frameIndex}},set:function(c){this.currentFrame=this._frameData.getFrame(c);if(this.currentFrame!==null){this._frameIndex=c;this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid])}},enumerable:true,configurable:true});Phaser.Animation.Frame=function(d,i,h,c,e,f){this.x=d;this.y=i;this.width=h;this.height=c;this.sourceSizeW=h;this.sourceSizeH=c;this.centerX=Math.floor(h/2);this.centerY=Math.floor(c/2);this.name=e;this.uuid=f;this.distance=Phaser.Math.distance(0,0,h,c)};Phaser.Animation.Frame.prototype={uuid:"",x:0,y:0,width:0,height:0,centerX:0,centerY:0,distance:0,index:0,name:"",rotated:false,rotationDirection:"cw",trimmed:false,sourceSizeW:0,sourceSizeH:0,spriteSourceSizeX:0,spriteSourceSizeY:0,spriteSourceSizeW:0,spriteSourceSizeH:0,setTrim:function(h,f,j,d,c,e,i){this.trimmed=h;if(h){this.width=f;this.height=j;this.sourceSizeW=f;this.sourceSizeH=j;this.centerX=Math.floor(f/2);this.centerY=Math.floor(j/2);this.spriteSourceSizeX=d;this.spriteSourceSizeY=c;this.spriteSourceSizeW=e;this.spriteSourceSizeH=i}}};Phaser.Animation.FrameData=function(){};Phaser.Animation.FrameData.prototype={_frames:[],_frameNames:[],addFrame:function(c){c.index=this._frames.length;this._frames.push(c);if(c.name!==""){this._frameNames[c.name]=c.index}return c},getFrame:function(c){if(this._frames[c]){return this._frames[c]}return null},getFrameByName:function(c){if(this._frameNames[c]!==""){return this._frames[this._frameNames[c]]}return null},checkFrameName:function(c){if(this._frameNames[c]==null){return false}return true},getFrameRange:function(f,c,d){if(typeof d==="undefined"){d=[]}for(var e=f;e<=c;e++){d.push(this._frames[e])}return d},getFrameIndexes:function(c){if(typeof c==="undefined"){c=[]}for(var d=0;d tag")}var e=new Phaser.Animation.FrameData();var l=j.getElementsByTagName("SubTexture");var h;for(var f=0;f0){this._progressChunk=100/this._keys.length;this.loadFile()}else{this.progress=100;this.hasLoaded=true;this.onLoadComplete.dispatch()}},loadFile:function(){var c=this._fileList[this._keys.shift()];var d=this;switch(c.type){case"image":case"spritesheet":case"textureatlas":c.data=new Image();c.data.name=c.key;c.data.onload=function(){return d.fileComplete(c.key)};c.data.onerror=function(){return d.fileError(c.key)};c.data.crossOrigin=this.crossOrigin;c.data.src=this.baseURL+c.url;break;case"audio":c.url=this.getAudioURL(c.url);if(c.url!==null){if(this.game.sound.usingWebAudio){this._xhr.open("GET",this.baseURL+c.url,true);this._xhr.responseType="arraybuffer";this._xhr.onload=function(){return d.fileComplete(c.key)};this._xhr.onerror=function(){return d.fileError(c.key)};this._xhr.send()}else{if(this.game.sound.usingAudioTag){if(this.game.sound.touchLocked){c.data=new Audio();c.data.name=c.key;c.data.preload="auto";c.data.src=this.baseURL+c.url;this.fileComplete(c.key)}else{c.data=new Audio();c.data.name=c.key;c.data.onerror=function(){return d.fileError(c.key)};c.data.preload="auto";c.data.src=this.baseURL+c.url;c.data.addEventListener("canplaythrough",Phaser.GAMES[this.game.id].load.fileComplete(c.key),false);c.data.load()}}}}break;case"text":this._xhr.open("GET",this.baseURL+c.url,true);this._xhr.responseType="text";this._xhr.onload=function(){return d.fileComplete(c.key)};this._xhr.onerror=function(){return d.fileError(c.key)};this._xhr.send();break}},getAudioURL:function(d){var e;for(var c=0;c100){this.progress=100}this.onFileComplete.dispatch(this.progress,c,d,this.queueSize-this._keys.length,this.queueSize);if(this._keys.length>0){this.loadFile()}else{this.hasLoaded=true;this.isLoading=false;this.removeAll();this.onLoadComplete.dispatch()}}};Phaser.Sound=function(d,e,f,c){f=f||1;c=c||false;this.game=d;this.key=e;this._volume=f;this.loop=c;this.usingWebAudio=this.game.sound.usingWebAudio;this.usingAudioTag=this.game.sound.usingAudioTag;if(this.usingWebAudio){this.context=this.game.sound.context;this.masterGainNode=this.game.sound.masterGain;if(typeof this.context.createGain==="undefined"){this.gainNode=this.context.createGainNode()}else{this.gainNode=this.context.createGain()}this.gainNode.gain.value=f*this.game.sound.volume;this.gainNode.connect(this.masterGainNode)}else{if(this.game.cache.getSound(e)&&this.game.cache.getSound(e).locked==false){this._sound=this.game.cache.getSoundData(e);this.totalDuration=this._sound.duration}else{this.game.cache.onSoundUnlock.add(this.soundHasUnlocked,this)}}this.onDecoded=new Phaser.Signal;this.onPlay=new Phaser.Signal;this.onPause=new Phaser.Signal;this.onResume=new Phaser.Signal;this.onLoop=new Phaser.Signal;this.onStop=new Phaser.Signal;this.onMute=new Phaser.Signal;this.onMarkerComplete=new Phaser.Signal};Phaser.Sound.prototype={game:null,context:null,_buffer:null,_muted:false,key:"",name:"",markers:{},usingWebAudio:false,usingAudioTag:false,autoplay:false,totalDuration:0,startTime:0,currentTime:0,duration:0,stopTime:0,paused:false,loop:false,isPlaying:false,currentMarker:"",pendingPlayback:false,override:false,onDecoded:null,onPlay:null,onPause:null,onResume:null,onLoop:null,onStop:null,onMute:null,onMarkerComplete:null,soundHasUnlocked:function(c){if(c==this.key){this._sound=this.game.cache.getSoundData(this.key);this.totalDuration=this._sound.duration;console.log("sound has unlocked",this._sound)}},addMarker:function(d,h,e,f,c){f=f||1;c=c||false;this.markers[d]={name:d,start:h,stop:e,volume:f,duration:e-h,loop:c}},removeMarker:function(c){delete this.markers[c]},update:function(){if(this.pendingPlayback&&this.game.cache.isSoundReady(this.key)){this.pendingPlayback=false;this.play(this._tempMarker,this._tempPosition,this._tempVolume,this._tempLoop)}if(this.isPlaying){this.currentTime=this.game.time.now-this.startTime;if(this.currentTime>=this.duration){if(this.usingWebAudio){if(this.loop){this.onLoop.dispatch(this);if(this.currentMarker==""){this.currentTime=0;this.startTime=this.game.time.now}else{this.play(this.currentMarker,0,this.volume,true,true)}}else{this.stop()}}else{if(this.loop){this.onLoop.dispatch(this);this.play(this.currentMarker,0,this.volume,true,true)}else{this.stop()}}}}},play:function(e,c,h,d,f){e=e||"";c=c||0;h=h||1;d=d||false;f=f||false;console.log("play",e,"current is",this.currentMarker);if(this.isPlaying==true&&f==false&&this.override==false){return}if(this.isPlaying&&this.override){if(this.usingWebAudio){if(typeof this._sound.stop==="undefined"){this._sound.noteOff(0)}else{this._sound.stop(0)}}else{if(this.usingAudioTag){this._sound.pause();this._sound.currentTime=0}}}this.currentMarker=e;if(e!==""&&this.markers[e]){this.position=this.markers[e].start;this.volume=this.markers[e].volume;this.loop=this.markers[e].loop;this.duration=this.markers[e].duration*1000;this._tempMarker=e;this._tempPosition=this.position;this._tempVolume=this.volume;this._tempLoop=this.loop}else{this.position=c;this.volume=h;this.loop=d;this.duration=0;this._tempMarker=e;this._tempPosition=c;this._tempVolume=h;this._tempLoop=d}if(this.usingWebAudio){if(this.game.cache.isSoundDecoded(this.key)){if(this._buffer==null){this._buffer=this.game.cache.getSoundData(this.key)}this._sound=this.context.createBufferSource();this._sound.buffer=this._buffer;this._sound.connect(this.gainNode);this.totalDuration=this._sound.buffer.duration;if(this.duration==0){this.duration=this.totalDuration*1000}if(this.loop&&e==""){this._sound.loop=true}if(typeof this._sound.start==="undefined"){this._sound.noteGrainOn(0,this.position,this.duration/1000)}else{this._sound.start(0,this.position,this.duration/1000)}this.isPlaying=true;this.startTime=this.game.time.now;this.currentTime=0;this.stopTime=this.startTime+this.duration;this.onPlay.dispatch(this)}else{this.pendingPlayback=true;if(this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).isDecoding==false){this.game.sound.decode(this.key,this)}}}else{if(this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).locked){this.game.cache.reloadSound(this.key);this.pendingPlayback=true}else{if(this._sound&&this._sound.readyState==4){if(this.duration==0){this.duration=this.totalDuration*1000}this._sound.currentTime=this.position;this._sound.muted=this._muted;if(this._muted){this._sound.volume=0}else{this._sound.volume=this._volume}this._sound.play();this.isPlaying=true;this.startTime=this.game.time.now;this.currentTime=0;this.stopTime=this.startTime+this.duration;this.onPlay.dispatch(this)}else{this.pendingPlayback=true}}}},restart:function(e,c,f,d){e=e||"";c=c||0;f=f||1;d=d||false;this.play(e,c,f,d,true)},pause:function(){if(this.isPlaying&&this._sound){this.stop();this.isPlaying=false;this.paused=true;this.onPause.dispatch(this)}},resume:function(){if(this.paused&&this._sound){if(this.usingWebAudio){if(typeof this._sound.start==="undefined"){this._sound.noteGrainOn(0,this.position,this.duration)}else{this._sound.start(0,this.position,this.duration)}}else{this._sound.play()}this.isPlaying=true;this.paused=false;this.onResume.dispatch(this)}},stop:function(){if(this.isPlaying&&this._sound){if(this.usingWebAudio){if(typeof this._sound.stop==="undefined"){this._sound.noteOff(0)}else{this._sound.stop(0)}}else{if(this.usingAudioTag){this._sound.pause();this._sound.currentTime=0}}}this.isPlaying=false;var c=this.currentMarker;this.currentMarker="";this.onStop.dispatch(this,c)}};Object.defineProperty(Phaser.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding},enumerable:true,configurable:true});Object.defineProperty(Phaser.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)},enumerable:true,configurable:true});Object.defineProperty(Phaser.Sound.prototype,"mute",{get:function(){return this._muted},set:function(c){c=c||null;if(c){this._muted=true;if(this.usingWebAudio){this._muteVolume=this.gainNode.gain.value;this.gainNode.gain.value=0}else{if(this.usingAudioTag&&this._sound){this._muteVolume=this._sound.volume;this._sound.volume=0}}}else{this._muted=false;if(this.usingWebAudio){this.gainNode.gain.value=this._muteVolume}else{if(this.usingAudioTag&&this._sound){this._sound.volume=this._muteVolume}}}this.onMute.dispatch(this)},enumerable:true,configurable:true});Object.defineProperty(Phaser.Sound.prototype,"volume",{get:function(){return this._volume},set:function(c){this._volume=c;if(this.usingWebAudio){this.gainNode.gain.value=c}else{if(this.usingAudioTag&&this._sound){this._sound.volume=c}}},enumerable:true,configurable:true});Phaser.SoundManager=function(c){this.game=c;this.onSoundDecode=new Phaser.Signal;if(this.game.device.iOS&&this.game.device.webAudio==false){this.channels=1}if(c.device.iOS||(window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock)){this.game.input.touch.callbackContext=this;this.game.input.touch.touchStartCallback=this.unlock;this.game.input.mouse.callbackContext=this;this.game.input.mouse.mouseDownCallback=this.unlock;this.touchLocked=true}else{this.touchLocked=false}if(window.PhaserGlobal){if(window.PhaserGlobal.disableAudio==true){this.usingWebAudio=false;this.noAudio=true;return}if(window.PhaserGlobal.disableWebAudio==true){this.usingWebAudio=false;this.usingAudioTag=true;this.noAudio=false;return}}if(!!window.AudioContext){this.context=new window.AudioContext()}else{if(!!window.webkitAudioContext){this.context=new window.webkitAudioContext()}else{if(!!window.Audio){this.usingWebAudio=false;this.usingAudioTag=true}else{this.usingWebAudio=false;this.noAudio=true}}}if(this.context!==null){if(typeof this.context.createGain==="undefined"){this.masterGain=this.context.createGainNode()}else{this.masterGain=this.context.createGain()}this.masterGain.gain.value=1;this.masterGain.connect(this.context.destination)}};Phaser.SoundManager.prototype={game:null,_muted:false,_unlockSource:null,_volume:1,_muted:false,_sounds:[],context:null,usingWebAudio:true,usingAudioTag:false,noAudio:false,touchLocked:false,onSoundDecode:null,channels:32,unlock:function(){if(this.touchLocked==false){return}console.log("SoundManager touch unlocked");if(this.game.device.webAudio&&(window.PhaserGlobal&&window.PhaserGlobal.disableWebAudio==false)){var c=this.context.createBuffer(1,1,22050);this._unlockSource=this.context.createBufferSource();this._unlockSource.buffer=c;this._unlockSource.connect(this.context.destination);this._unlockSource.noteOn(0)}else{this.touchLocked=false;this._unlockSource=null;this.game.input.touch.callbackContext=null;this.game.input.touch.touchStartCallback=null;this.game.input.mouse.callbackContext=null;this.game.input.mouse.mouseDownCallback=null}},stopAll:function(){for(var c=0;c0){i=i-this._drag}else{if(i+this._drag<0){i+=this._drag}else{i=0}}}}if(i!=0){if(i>c){i=c}else{if(i<-c){i=-c}}}return i},preUpdate:function(){this.quadTree.clear();this.quadTreeID=0;this.quadTree=new Phaser.QuadTree(this,this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels)},postUpdate:function(){this.quadTree.clear()},collide:function(d,e,c){return this.overlap(d,null,e,this.separate,c)},collideGroup:function(k,h,e){h=h||null;e=e||h;for(var j=0,c=k.length;j0)?d.deltaX():0),d.lastY,d.width+((d.deltaX()>0)?d.deltaX():-d.deltaX()),d.height);this._obj2Bounds.setTo(c.x-((c.deltaX()>0)?c.deltaX():0),c.lastY,c.width+((c.deltaX()>0)?c.deltaX():-c.deltaX()),c.height);if((this._obj1Bounds.right>this._obj2Bounds.x)&&(this._obj1Bounds.xthis._obj2Bounds.y)&&(this._obj1Bounds.yc.deltaX()){this._overlap=d.x+d.width-c.x;if((this._overlap>this._maxOverlap)||d.allowCollision.right==false||c.allowCollision.left==false){this._overlap=0}else{d.touching.right=true;c.touching.left=true}}else{if(d.deltaX()this._maxOverlap)||d.allowCollision.left==false||c.allowCollision.right==false){this._overlap=0}else{d.touching.left=true;c.touching.right=true}}}}}if(this._overlap!=0){this._obj1Velocity=d.velocity.x;this._obj2Velocity=c.velocity.x;if(!d.immovable&&!c.immovable){this._overlap*=0.5;d.x=d.x-this._overlap;c.x+=this._overlap;this._obj1NewVelocity=Math.sqrt((this._obj2Velocity*this._obj2Velocity*c.mass)/d.mass)*((this._obj2Velocity>0)?1:-1);this._obj2NewVelocity=Math.sqrt((this._obj1Velocity*this._obj1Velocity*d.mass)/c.mass)*((this._obj1Velocity>0)?1:-1);this._average=(this._obj1NewVelocity+this._obj2NewVelocity)*0.5;this._obj1NewVelocity-=this._average;this._obj2NewVelocity-=this._average;d.velocity.x=this._average+this._obj1NewVelocity*d.bounce.x;c.velocity.x=this._average+this._obj2NewVelocity*c.bounce.x}else{if(!d.immovable){d.x=d.x-this._overlap;d.velocity.x=this._obj2Velocity-this._obj1Velocity*d.bounce.x}else{if(!c.immovable){c.x+=this._overlap;c.velocity.x=this._obj1Velocity-this._obj2Velocity*c.bounce.x}}}return true}else{return false}},separateY:function(d,c){if(d.immovable&&c.immovable){return false}this._overlap=0;if(d.deltaY()!=c.deltaY()){this._obj1Bounds.setTo(d.x,d.y-((d.deltaY()>0)?d.deltaY():0),d.width,d.height+d.deltaAbsY());this._obj2Bounds.setTo(c.x,c.y-((c.deltaY()>0)?c.deltaY():0),c.width,c.height+c.deltaAbsY());if((this._obj1Bounds.right>this._obj2Bounds.x)&&(this._obj1Bounds.xthis._obj2Bounds.y)&&(this._obj1Bounds.yc.deltaY()){this._overlap=d.y+d.height-c.y;if((this._overlap>this._maxOverlap)||d.allowCollision.down==false||c.allowCollision.up==false){this._overlap=0}else{d.touching.down=true;c.touching.up=true}}else{if(d.deltaY()this._maxOverlap)||d.allowCollision.up==false||c.allowCollision.down==false){this._overlap=0}else{d.touching.up=true;c.touching.down=true}}}}}if(this._overlap!=0){this._obj1Velocity=d.velocity.y;this._obj2Velocity=c.velocity.y;if(!d.immovable&&!c.immovable){this._overlap*=0.5;d.y=d.y-this._overlap;c.y+=this._overlap;this._obj1NewVelocity=Math.sqrt((this._obj2Velocity*this._obj2Velocity*c.mass)/d.mass)*((this._obj2Velocity>0)?1:-1);this._obj2NewVelocity=Math.sqrt((this._obj1Velocity*this._obj1Velocity*d.mass)/c.mass)*((this._obj1Velocity>0)?1:-1);this._average=(this._obj1NewVelocity+this._obj2NewVelocity)*0.5;this._obj1NewVelocity-=this._average;this._obj2NewVelocity-=this._average;d.velocity.y=this._average+this._obj1NewVelocity*d.bounce.y;c.velocity.y=this._average+this._obj2NewVelocity*c.bounce.y}else{if(!d.immovable){d.y=d.y-this._overlap;d.velocity.y=this._obj2Velocity-this._obj1Velocity*d.bounce.y;if(c.active&&c.moves&&(d.deltaY()>c.deltaY())){d.x+=c.x-c.lastX}}else{if(!c.immovable){c.y+=this._overlap;c.velocity.y=this._obj1Velocity-this._obj2Velocity*c.bounce.y;if(d.sprite.active&&d.moves&&(d.deltaY()0){var j=this.distanceBetween(i,f);h=j/(e/1000)}i.body.velocity.x=Math.cos(c)*h;i.body.velocity.y=Math.sin(c)*h},accelerateTowardsObject:function(h,e,f,c,i){c=c||1000;i=i||1000;var d=this.angleBetween(h,e);h.body.velocity.x=0;h.body.velocity.y=0;h.body.acceleration.x=Math.cos(d)*f;h.body.acceleration.y=Math.sin(d)*f;h.body.maxVelocity.x=c;h.body.maxVelocity.y=i},moveTowardsMouse:function(h,f,e){f=f||60;e=e||0;var c=this.angleBetweenMouse(h);if(e>0){var i=this.distanceToMouse(h);f=i/(e/1000)}h.body.velocity.x=Math.cos(c)*f;h.body.velocity.y=Math.sin(c)*f},accelerateTowardsMouse:function(f,e,c,h){c=c||1000;h=h||1000;var d=this.angleBetweenMouse(f);f.body.velocity.x=0;f.body.velocity.y=0;f.body.acceleration.x=Math.cos(d)*e;f.body.acceleration.y=Math.sin(d)*e;f.body.maxVelocity.x=c;f.body.maxVelocity.y=h},moveTowardsPoint:function(h,i,f,e){f=f||60;e=e||0;var c=this.angleBetweenPoint(h,i);if(e>0){var j=this.distanceToPoint(h,i);f=j/(e/1000)}h.body.velocity.x=Math.cos(c)*f;h.body.velocity.y=Math.sin(c)*f},accelerateTowardsPoint:function(f,h,e,c,i){c=c||1000;i=i||1000;var d=this.angleBetweenPoint(f,h);f.body.velocity.x=0;f.body.velocity.y=0;f.body.acceleration.x=Math.cos(d)*e;f.body.acceleration.y=Math.sin(d)*e;f.body.maxVelocity.x=c;f.body.maxVelocity.y=i},distanceBetween:function(e,c){var f=e.center.x-c.center.x;var d=e.center.y-c.center.y;return Math.sqrt(f*f+d*d)},distanceToPoint:function(d,f){var e=d.center.x-f.x;var c=d.center.y-f.y;return Math.sqrt(e*e+c*c)},distanceToMouse:function(d){var e=d.center.x-this.game.input.x;var c=d.center.y-this.game.input.y;return Math.sqrt(e*e+c*c)},angleBetweenPoint:function(d,h,f){f=f||false;var e=h.x-d.center.x;var c=h.y-d.center.y;if(f){return this.game.math.radToDeg(Math.atan2(c,e))}else{return Math.atan2(c,e)}},angleBetween:function(e,c,h){h=h||false;var f=c.center.x-e.center.x;var d=c.center.y-e.center.y;if(h){return this.game.math.radToDeg(Math.atan2(d,f))}else{return Math.atan2(d,f)}},velocityFromFacing:function(c,d){},angleBetweenMouse:function(d,f){f=f||false;var e=this.game.input.x-d.bounds.x;var c=this.game.input.y-d.bounds.y;if(f){return this.game.math.radToDeg(Math.atan2(c,e))}else{return Math.atan2(c,e)}}};Phaser.Physics.Arcade.Body=function(c){this.sprite=c;this.game=c.game;this.offset=new Phaser.Point;this.x=c.x;this.y=c.y;this.sourceWidth=c.currentFrame.sourceSizeW;this.sourceHeight=c.currentFrame.sourceSizeH;this.width=c.currentFrame.sourceSizeW;this.height=c.currentFrame.sourceSizeH;this.halfWidth=Math.floor(c.currentFrame.sourceSizeW/2);this.halfHeight=Math.floor(c.currentFrame.sourceSizeH/2);this._sx=c.scale.x;this._sy=c.scale.y;this.velocity=new Phaser.Point;this.acceleration=new Phaser.Point;this.drag=new Phaser.Point;this.gravity=new Phaser.Point;this.bounce=new Phaser.Point;this.maxVelocity=new Phaser.Point(10000,10000);this.angularVelocity=0;this.angularAcceleration=0;this.angularDrag=0;this.maxAngular=1000;this.mass=1;this.quadTreeIDs=[];this.quadTreeIndex=-1;this.allowCollision={none:false,any:true,up:true,down:true,left:true,right:true};this.touching={none:true,up:false,down:false,left:false,right:false};this.wasTouching={none:true,up:false,down:false,left:false,right:false};this.immovable=false;this.moves=true;this.rotation=0;this.allowRotation=true;this.allowGravity=true;this.collideWorldBounds=false;this.lastX=c.x;this.lastY=c.y};Phaser.Physics.Arcade.Body.prototype={updateBounds:function(f,e,d,c){if(d!=this._sx||c!=this._sy){this.width=this.sourceWidth*d;this.height=this.sourceHeight*c;this.halfWidth=Math.floor(this.width/2);this.halfHeight=Math.floor(this.height/2);this._sx=d;this._sy=c}},update:function(){this.wasTouching.none=this.touching.none;this.wasTouching.up=this.touching.up;this.wasTouching.down=this.touching.down;this.wasTouching.left=this.touching.left;this.wasTouching.right=this.touching.right;this.touching.none=true;this.touching.up=false;this.touching.down=false;this.touching.left=false;this.touching.right=false;this.lastX=this.x;this.lastY=this.y;this.rotation=this.sprite.angle;this.x=(this.sprite.x-(this.sprite.anchor.x*this.width))+this.offset.x;this.y=(this.sprite.y-(this.sprite.anchor.y*this.height))+this.offset.y;if(this.moves){this.game.physics.updateMotion(this)}if(this.collideWorldBounds){this.checkWorldBounds()}if(this.allowCollision.none==false&&this.sprite.visible&&this.sprite.alive){this.quadTreeIDs=[];this.quadTreeIndex=-1;this.game.physics.quadTree.insert(this)}this.sprite.x=this.x-this.offset.x+(this.sprite.anchor.x*this.width);this.sprite.y=this.y-this.offset.y+(this.sprite.anchor.y*this.height);if(this.allowRotation){this.sprite.angle=this.rotation}},postUpdate:function(){this.sprite.x=this.x-this.offset.x+(this.sprite.anchor.x*this.width);this.sprite.y=this.y-this.offset.y+(this.sprite.anchor.y*this.height);if(this.allowRotation){this.sprite.angle=this.rotation}},checkWorldBounds:function(){if(this.xthis.game.world.bounds.right){this.x=this.game.world.bounds.right-this.width;this.velocity.x*=-this.bounce.x}}if(this.ythis.game.world.bounds.bottom){this.y=this.game.world.bounds.bottom-this.height;this.velocity.y*=-this.bounce.y}}},setSize:function(e,d,c,f){c=c||this.offset.x;f=f||this.offset.y;this.sourceWidth=e;this.sourceHeight=d;this.width=this.sourceWidth*this._sx;this.height=this.sourceHeight*this._sy;this.halfWidth=Math.floor(this.width/2);this.halfHeight=Math.floor(this.height/2);this.offset.setTo(c,f)},deltaAbsX:function(){return(this.deltaX()>0?this.deltaX():-this.deltaX())},deltaAbsY:function(){return(this.deltaY()>0?this.deltaY():-this.deltaY())},deltaX:function(){return this.x-this.lastX},deltaY:function(){return this.y-this.lastY}};Object.defineProperty(Phaser.Physics.Arcade.Body.prototype,"bottom",{get:function(){return this.y+this.height},set:function(c){if(c<=this.y){this.height=0}else{this.height=(this.y-c)}},enumerable:true,configurable:true});Object.defineProperty(Phaser.Physics.Arcade.Body.prototype,"right",{get:function(){return this.x+this.width},set:function(c){if(c<=this.x){this.width=0}else{this.width=this.x+c}},enumerable:true,configurable:true});