Moto-X3M-Winter/motox3m.min.js

778 lines
1 MiB
JavaScript
Raw Normal View History

2022-10-09 04:48:47 +02:00
!function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};e.m=t,e.c=i,e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function e(){return t.default}:function e(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=54)}([function(t,e,i){"use strict";e.__esModule=!0;var s=i(6);e.MyRand=s.MyRand,e.UiStrUtil=s.UiStrUtil;var n=i(40);e.Drawing=n.Drawing;var o=i(18);e.NapeUtil=o.NapeUtil;var a=i(64);e.GameCore=a.GameCore;var r=i(65);e.GameObject=r.GameObject;var h=i(66);e.IDisposed=h.IDisposed;var l=i(67);e.IUpdated=l.IUpdated;var c=i(68);e.ISafed=c.ISafed;var u=i(69);e.IRestarted=u.IRestarted;var d=i(70);e.IActivatable=d.IActivatable;var p=i(41);e.GamePhysics=p.GamePhysics;var f=i(42);e.NapePhysics=f.NapePhysics;var y=i(71);e.GameView=y.GameView;var g=i(31);e.RaceCamera=g.RaceCamera;var m=i(32);e.CameraPathes=m.CameraPathes;var v=i(72);e.CarParams=v.CarParams;var b=i(73);e.CarUpgrades=b.CarUpgrades;var x=i(74);e.RaceCars=x.RaceCars;var _=i(75);e.WeaponParams=_.WeaponParams;var w=i(76);e.Inventory=w.Inventory;var P=i(77);e.LeagueVO=P.LeagueVO;var C=i(78);e.MapVO=C.MapVO;var T=i(79);e.RaceData=T.RaceData;var S=i(80);e.BgElVo=S.BgElVo;var A=i(81);e.ShopCarVO=A.ShopCarVO;var E=i(43);e.CarsData=E.CarsData;var I=i(34);e.GameData=I.GameData;var M=i(33);e.RacesData=M.RacesData;var O=i(82);e.ShopData=O.ShopData;var R=i(83);e.CarBuilder=R.CarBuilder;var B=i(85);e.RaceBuilder=B.RaceBuilder;var D=i(88);e.FrameGraphic=D.FrameGraphic;var L=i(46);e.GroundPartClip=L.GroundPartClip;var k=i(45);e.SmokePartClip=k.SmokePartClip;var F=i(89);e.TrailPart=F.TrailPart;var G=i(90);e.WheelGraphic=G.WheelGraphic;var U=i(91);e.BgEl=U.BgEl;var N=i(92);e.LandscapeShape=N.LandscapeShape;var j=i(47);e.CarObject=j.CarObject;var W=i(93);e.BikeObject=W.BikeObject;var X=i(94);e.CorpseObject=X.CorpseObject;var H=i(95);e.DriverObject=H.DriverObject;var V=i(96);e.FrameObject=V.FrameObject;var Y=i(97);e.PartObject=Y.PartObject;var q=i(98);e.WheelObject=q.WheelObject;var z=i(99);e.BgObject=z.BgObject;var K=i(100);e.DecorActObject=K.DecorActObject;var J=i(101);e.DecorMultiObject=J.DecorMultiObject;var Z=i(48);e.DecorObject=Z.DecorObject;var Q=i(102);e.VectorDecor=Q.VectorDecor;var $=i(38);e.CarExplodeObject=$.CarExplodeObject;var tt=i(103);e.GlassExplodeObject=tt.GlassExplodeObject;var et=i(37);e.TrailParticlesSystem=et.TrailParticlesSystem;var it=i(44);e.TrailPartObject=it.TrailPartObject;var st=i(104);e.GlassBlock=st.GlassBlock;var nt=i(49);e.GlassBlockPart=nt.GlassBlockPart;var ot=i(105);e.GroundObject=ot.GroundObject;var at=i(106);e.PlankObject=at.PlankObject;var rt=i(107);e.ShaperObject=rt.ShaperObject;var ht=i(108);e.WaterObject=ht.WaterObject;var lt=i(110);e.BoostObject=lt.BoostObject;var ct=i(51);e.DynamicBodyObject=ct.DynamicBodyObject;var ut=i(111);e.FinishObject=ut.FinishObject;var dt=i(112);e.MotorObject=dt.MotorObject;var pt=i(113);e.MoverPatherObject=pt.MoverPatherObject;var ft=i(114);e.PivotObject=ft.PivotObject;var yt=i(115);e.RemovedBodyObjects=yt.RemovedBodyObjects;var gt=i(116);e.SafePointObject=gt.SafePointObject;var mt=i(117);e.SpikesObject=mt.SpikesObject;var vt=i(118);e.TntObject=vt.TntObject;var bt=i(119);e.ToggleObject=bt.ToggleObject;var xt=i(120);e.CameraZone=xt.CameraZone;var _t=i(121);e.WaypointObject=_t.WaypointObject;var wt=i(1);e.ObjectTypes=wt.ObjectTypes;var Pt=i(11);e.CbTypes=Pt.CbTypes;var Ct=i(7);e.Filters=Ct.Filters;var Tt=i(9);e.Materials=Tt.Materials;var St=i(122);e.MaxPhysics=St.MaxPhysics;var At=i(123);e.BodyEffector=At.BodyEffector;var Et=i(124);e.BoostEffector=Et.BoostEffector;var It=i(125);e.PlayerController=It.PlayerController;var Mt=i(52);e.CarController=Mt.CarController;var Ot=i(5);e.GraphicUtil=Ot.GraphicUtil;var Rt=i(50);e.PhysicUtil=Rt.PhysicUtil;var Bt=i(2);e.MaxGameView=Bt.MaxGameView},function(t,e,i){"use strict";e.__esModule=!0;var s=function(){function t(){}return t.BG=0,
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*
* @overview
*
* Phaser - http://phaser.io
*
* v2.6.4 "Kore Springs" - Built: Thu Nov 16 2017 13:53:48
*
* By Richard Davey http://www.photonstorm.com @photonstorm
*
* Phaser is a fun, free and fast 2D game framework for making HTML5 games
* for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
*
* Phaser uses Pixi.js for rendering, created by Mat Groves http://matgroves.com @Doormat23
* Phaser uses p2.js for full-body physics, created by Stefan Hedman https://github.com/schteppe/p2.js @schteppe
* Phaser contains a port of N+ Physics, converted by Richard Davey, original by http://www.metanetsoftware.com
*
* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from which both Phaser and my love of framework development originate.
*
* Follow development at http://phaser.io and on our forum
*
* "If you want your children to be intelligent, read them fairy tales."
* "If you want them to be more intelligent, read them more fairy tales."
* -- Albert Einstein
*/
(function(){var i=this,s=s||{};/**
* @author Mat Groves http://matgroves.com @Doormat23
* @author Richard Davey <rich@photonstorm.com>
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
return s.game=null,s.WEBGL_RENDERER=0,s.CANVAS_RENDERER=1,s.VERSION="v2.2.9",s._UID=0,"undefined"!=typeof Float32Array?(s.Float32Array=Float32Array,s.Uint16Array=Uint16Array,s.Uint32Array=Uint32Array,s.ArrayBuffer=ArrayBuffer):(s.Float32Array=Array,s.Uint16Array=Array),s.PI_2=2*Math.PI,s.RAD_TO_DEG=180/Math.PI,s.DEG_TO_RAD=Math.PI/180,s.RETINA_PREFIX="@2x",s.DisplayObject=function(){this.position=new s.Point(0,0),this.scale=new s.Point(1,1),this.pivot=new s.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.renderable=!1,this.parent=null,this.worldAlpha=1,this.worldTransform=new s.Matrix,this.worldPosition=new s.Point(0,0),this.worldScale=new s.Point(1,1),this.worldRotation=0,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new s.Rectangle(0,0,0,0),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cacheIsDirty=!1},s.DisplayObject.prototype.constructor=s.DisplayObject,s.DisplayObject.prototype={destroy:function(){if(this.children){for(var t=this.children.length;t--;)this.children[t].destroy();this.children=[]}this.hitArea=null,this.parent=null,this.worldTransform=null,this.filterArea=null,this.renderable=!1,this._bounds=null,this._currentBounds=null,this._mask=null,this._destroyCachedSprite()},updateTransform:function(t){if(!t&&!this.parent&&!this.game)return this;var e=this.parent;t?e=t:this.parent||(e=this.game.world);var i=e.worldTransform,n=this.worldTransform,o,a,r,h,l,c;return this.rotation%s.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),o=this._cr*this.scale.x,a=this._sr*this.scale.x,r=-this._sr*this.scale.y,h=this._cr*this.scale.y,l=this.position.x,c=this.position.y,(this.pivot.x||this.pivot.y)&&(l-=this.pivot.x*o+this.pivot.y*r,c-=this.pivot.x*a+this.pivot.y*h),n.a=o*i.a+a*i.c,n.b=o*i.b+a*i.d,n.c=r*i.a+h*i.c,n.d=r*i.b+h*i.d,n.tx=l*i.a+c*i.c+i.tx,n.ty=l*i.b+c*i.d+i.ty):(o=this.scale.x,h=this.scale.y,l=this.position.x-this.pivot.x*o,c=this.position.y-this.pivot.y*h,n.a=o*i.a,n.b=o*i.b,n.c=h*i.c,n.d=h*i.d,n.tx=l*i.a+c*i.c+i.tx,n.ty=l*i.b+c*i.d+i.ty),this.worldAlpha=this.alpha*e.worldAlpha,this.worldPosition.set(n.tx,n.ty),this.worldScale.set(this.scale.x*Math.sqrt(n.a*n.a+n.c*n.c),this.scale.y*Math.sqrt(n.b*n.b+n.d*n.d)),this.worldRotation=Math.atan2(-n.c,n.d),this._currentBounds=null,this.transformCallback&&this.transformCallback.call(this.transformCallbackContext,n,i),this},preUpdate:function(){},generateTexture:function(t,e,i){var n=this.getLocalBounds(),o=new s.RenderTexture(0|n.width,0|n.height,i,e,t);return s.DisplayObject._tempMatrix.tx=-n.x,s.DisplayObject._tempMatrix.ty=-n.y,o.render(this,s.DisplayObject._tempMatrix),o},updateCache:function(){return this._generateCachedSprite(),this},toGlobal:function(t){return this.updateTransform(),this.worldTransform.apply(t)},toLocal:function(t,e){return e&&(t=e.toGlobal(t)),this.updateTransform(),this.worldTransform.applyInverse(t)},_renderCachedSprite:function(t){this._cachedSprite.worldAlpha=this.worldAlpha,t.gl?s.Sprite.prototype._renderWebGL.call(this._cachedSprite,t):s.Sprite.prototype._renderCanvas.call(this._cachedSprite,t)},_generateCachedSprite:function(){this._cacheAsBitmap=!1;var t=this.getLocalBounds();if(t.width=Math.max(1,Math.ceil(t.width)),t.height=Math.max(1,Math.ceil(t.height)),this.updateTransform(),this._cachedSprite)this._cachedSprite.texture.resize(t.width,t.height);else{var e=new s.RenderTexture(t.width,t.height);this._cachedSprite=new s.Sprite(e),this._cachedSprite.worldTransform=this.worldTransform}var i=this._filters;this._filters=null,this._cachedSprite.filters=i,s.DisplayObject._tempMatrix.tx=-t.x,s.DisplayObject._tempMatrix.ty=-t.y,this._cachedSprite.texture.render(this,s.DisplayObject._tempMatrix,!0),this._cachedSprite.anchor.x=-t.x/t.width,this._cachedSprite.anchor.y=-t.y/t.height,this._filters=i,this._cacheAsBitmap=!0},_destroyCachedSprite:function(){this._cachedSprite&&(this._cachedSprite.texture.destroy(!0),this._cachedSprite=null)}},s.DisplayObject.prototype.displayObjectUpdateTransfo
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*
* @overview
*
* Phaser - http://phaser.io
*
* v2.6.4 "Kore Springs" - Built: Thu Nov 16 2017 13:53:52
*
* By Richard Davey http://www.photonstorm.com @photonstorm
*
* Phaser is a fun, free and fast 2D game framework for making HTML5 games
* for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
*
* Phaser uses Pixi.js for rendering, created by Mat Groves http://matgroves.com @Doormat23
* Phaser uses p2.js for full-body physics, created by Stefan Hedman https://github.com/schteppe/p2.js @schteppe
* Phaser contains a port of N+ Physics, converted by Richard Davey, original by http://www.metanetsoftware.com
*
* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from which both Phaser and my love of framework development originate.
*
* Follow development at http://phaser.io and on our forum
*
* "If you want your children to be intelligent, read them fairy tales."
* "If you want them to be more intelligent, read them more fairy tales."
* -- Albert Einstein
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
(function(){function s(t,e){this._scaleFactor=t,this._deltaMode=e,this.originalEvent=null}var n=this,o=o||{VERSION:"2.6.4",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,POINTER:19,ROPE:20,CIRCLE:21,RECTANGLE:22,LINE:23,MATRIX:24,POINT:25,ROUNDEDRECTANGLE:26,CREATURE:27,VIDEO:28,PENDING_ATLAS:-1,HORIZONTAL:0,VERTICAL:1,LANDSCAPE:0,PORTRAIT:1,ANGLE_UP:270,ANGLE_DOWN:90,ANGLE_LEFT:180,ANGLE_RIGHT:0,ANGLE_NORTH_EAST:315,ANGLE_NORTH_WEST:225,ANGLE_SOUTH_EAST:45,ANGLE_SOUTH_WEST:135,TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12,blendModes:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1},PIXI:PIXI||{}};if(/**
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
Math.trunc||(Math.trunc=function t(e){return e<0?Math.ceil(e):Math.floor(e)}),Function.prototype.bind||(Function.prototype.bind=function(){var t=Array.prototype.slice;return function(e){function i(){var o=n.concat(t.call(arguments));s.apply(this instanceof i?this:e,o)}var s=this,n=t.call(arguments,1);if("function"!=typeof s)throw new TypeError;return i.prototype=function t(e){if(e&&(t.prototype=e),!(this instanceof t))return new t}(s.prototype),i}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(void 0===this||null===this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var s=arguments.length>=2?arguments[1]:void 0,n=0;n<i;n++)n in e&&t.call(s,e[n],n,e)}),"function"!=typeof window.Uint32Array&&"object"!=typeof window.Uint32Array){var a=function(t){var e=new Array;window[t]=function(t){if("number"==typeof t){Array.call(this,t),this.length=t;for(var e=0;e<this.length;e++)this[e]=0}else{Array.call(this,t.length),this.length=t.length;for(var e=0;e<this.length;e++)this[e]=t[e]}},window[t].prototype=e,window[t].constructor=window[t]};a("Uint32Array"),a("Int16Array")}window.console||(window.console={},window.console.log=window.console.assert=function(){},window.console.warn=window.console.assert=function(){}),/firefox/i.test(navigator.userAgent)&&(window.oldGetComputedStyle=window.getComputedStyle,window.getComputedStyle=function(t,e){var i=window.oldGetComputedStyle(t,e);return null===i?{getPropertyValue:function(){}}:i}),/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Utils={reverseString:function(t){return t.split("").reverse().join("")},getProperty:function(t,e){for(var i=e.split("."),s=i.pop(),n=i.length,o=1,a=i[0];o<n&&(t=t[a]);)a=i[o],o++;return t?t[s]:null},setProperty:function(t,e,i){for(var s=e.split("."),n=s.pop(),o=s.length,a=1,r=s[0];a<o&&(t=t[r]);)r=s[a],a++;return t&&(t[n]=i),t},chanceRoll:function(t){return void 0===t&&(t=50),t>0&&100*Math.random()<=t},randomChoice:function(t,e){return Math.random()<.5?t:e},parseDimension:function(t,e){var i=0,s=0;return"string"==typeof t?"%"===t.substr(-1)?(i=parseInt(t,10)/100,s=0===e?window.innerWidth*i:window.innerHeight*i):s=parseInt(t,10):s=t,s},pad:function(t,e,i,s){if(void 0===e)var e=0;if(void 0===i)var i=" ";if(void 0===s)var s=3;t=t.toString();var n=0;if(e+1>=t.length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var o=Math.ceil((n=e-t.length)/2),a=n-o;t=new Array(a+1).join(i)+t+new Array(o+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t},isPlainObject:function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},extend:function(){var t,e,i,s,n,a,r=arguments[0]||{},h=1,l=arguments.length,c=!1;for("boolean"==typeof r&&(c=r,r=arguments[1]||{},h=2),l===h&&(r=this,--h);h<l;h++)if(null!=(t=arguments[h]))for(e in t)i=r[e],s=t[e],r!==s&&(c&&s&&(o.Utils.isPlainObject(s)||(n=Array.isArray(s)))?(n?(n=!1,a=i&&Array.isArray(i)?i:[]):a=i&&o.Utils.isPlainObject(i)?i:{},r[e]=o.Utils.extend(c,a,s)):void 0!==s&&(r[e]=s));return r},mixinPrototype:function(t,e,i){void 0===i&&(i=!1);for(var s=Object.keys(e),n=0;n<s.length;n++){var o=s[n],a=e[o];!i&&o in t||(!a||"function"!=typeof a.get&&"function"!=typeof a.set?t[o]=a:"function"==typeof a.clone?t[o]=a.clone():Object.defineProperty(t,o,a))}},mixin:function(t,e){if(!t||"object"!=typeof t)return e;for(var i in t){var s=t[i];if(!s.childNodes&&!s.cloneNode){var n=typeof t[i];t[i]&&"object"===n?typeof e[i]===n?e[i]=o.Utils.mixin(t[i],e[i]):e[i]=o.Utils.mixin(t[i],new s.constructor):e[i]=t[i]}}return e}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Circle=function(t,e,i){t=t||0,e=e||0,i=i||0,this.x=t,this.y=e,this._diameter=i,this._radius=0,i>0&&(this._radius=.5*i),this.type=o.CIRCLE},o.Circle.prototype={circumference:function(){return Math.PI*this._radius*2},random:function(t){void 0===t&&(t=new o.Point);var e=2*Math.PI*Math.random(),i=Math.random()+Math.random(),s=i>1?2-i:i,n=s*Math.cos(e),a=s*Math.sin(e);return t.x=this.x+n*this.radius,t.y=this.y+a*this.radius,t},getBounds:function(){return new o.Rectangle(this.x-this.radius,this.y-this.radius,this.diameter,this.diameter)},setTo:function(t,e,i){return this.x=t,this.y=e,this._diameter=i,this._radius=.5*i,this},copyFrom:function(t){return this.setTo(t.x,t.y,t.diameter)},copyTo:function(t){return t.x=this.x,t.y=this.y,t.diameter=this._diameter,t},distance:function(t,e){var i=o.Math.distance(this.x,this.y,t.x,t.y);return e?Math.round(i):i},clone:function(t){return void 0===t||null===t?t=new o.Circle(this.x,this.y,this.diameter):t.setTo(this.x,this.y,this.diameter),t},contains:function(t,e){return o.Circle.contains(this,t,e)},circumferencePoint:function(t,e,i){return o.Circle.circumferencePoint(this,t,e,i)},offset:function(t,e){return this.x+=t,this.y+=e,this},offsetPoint:function(t){return this.offset(t.x,t.y)},toString:function(){return"[{Phaser.Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"}},o.Circle.prototype.constructor=o.Circle,Object.defineProperty(o.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(t){t>0&&(this._diameter=t,this._radius=.5*t)}}),Object.defineProperty(o.Circle.prototype,"radius",{get:function(){return this._radius},set:function(t){t>0&&(this._radius=t,this._diameter=2*t)}}),Object.defineProperty(o.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(t){t>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-t}}),Object.defineProperty(o.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(t){t<this.x?(this._radius=0,this._diameter=0):this.radius=t-this.x}}),Object.defineProperty(o.Circle.prototype,"top",{get:function(){return this.y-this._radius},set:function(t){t>this.y?(this._radius=0,this._diameter=0):this.radius=this.y-t}}),Object.defineProperty(o.Circle.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(t){t<this.y?(this._radius=0,this._diameter=0):this.radius=t-this.y}}),Object.defineProperty(o.Circle.prototype,"area",{get:function(){return this._radius>0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(o.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(t){!0===t&&this.setTo(0,0,0)}}),o.Circle.contains=function(t,e,i){if(t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom){return(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}return!1},o.Circle.equals=function(t,e){return t.x===e.x&&t.y===e.y&&t.diameter===e.diameter},o.Circle.intersects=function(t,e){return o.Math.distance(t.x,t.y,e.x,e.y)<=t.radius+e.radius},o.Circle.circumferencePoint=function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=new o.Point),!0===i&&(e=o.Math.degToRad(e)),s.x=t.x+t.radius*Math.cos(e),s.y=t.y+t.radius*Math.sin(e),s},o.Circle.intersectsRectangle=function(t,e){var i=Math.abs(t.x-e.x-e.halfWidth);if(i>e.halfWidth+t.radius)return!1;var s=Math.abs(t.y-e.y-e.halfHeight);if(s>e.halfHeight+t.radius)return!1;if(i<=e.halfWidth||s<=e.halfHeight)return!0;var n=i-e.halfWidth,o=s-e.halfHeight;return n*n+o*o<=t.radius*t.radius},PIXI.Circle=o.Circle,/**
* @author Richard Davey <rich@photonstorm.com>
* @author Chad Engler <chad@pantherdev.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Ellipse=function(t,e,i,s){t=t||0,e=e||0,i=i||0,s=s||0,this.x=t,this.y=e,this.width=i,this.height=s,this.type=o.ELLIPSE},o.Ellipse.prototype={setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},getBounds:function(){return new o.Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},copyFrom:function(t){return this.setTo(t.x,t.y,t.width,t.height)},copyTo:function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},clone:function(t){return void 0===t||null===t?t=new o.Ellipse(this.x,this.y,this.width,this.height):t.setTo(this.x,this.y,this.width,this.height),t},contains:function(t,e){return o.Ellipse.contains(this,t,e)},random:function(t){void 0===t&&(t=new o.Point);var e=Math.random()*Math.PI*2,i=Math.random();return t.x=Math.sqrt(i)*Math.cos(e),t.y=Math.sqrt(i)*Math.sin(e),t.x=this.x+t.x*this.width/2,t.y=this.y+t.y*this.height/2,t},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},o.Ellipse.prototype.constructor=o.Ellipse,Object.defineProperty(o.Ellipse.prototype,"left",{get:function(){return this.x},set:function(t){this.x=t}}),Object.defineProperty(o.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(t){t<this.x?this.width=0:this.width=t-this.x}}),Object.defineProperty(o.Ellipse.prototype,"top",{get:function(){return this.y},set:function(t){this.y=t}}),Object.defineProperty(o.Ellipse.prototype,"bottom",{get:function(){return this.y+this.height},set:function(t){t<this.y?this.height=0:this.height=t-this.y}}),Object.defineProperty(o.Ellipse.prototype,"empty",{get:function(){return 0===this.width||0===this.height},set:function(t){!0===t&&this.setTo(0,0,0,0)}}),o.Ellipse.contains=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width-.5,n=(i-t.y)/t.height-.5;return s*=s,n*=n,s+n<.25},PIXI.Ellipse=o.Ellipse,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Line=function(t,e,i,s){t=t||0,e=e||0,i=i||0,s=s||0,this.start=new o.Point(t,e),this.end=new o.Point(i,s),this.type=o.LINE},o.Line.prototype={setTo:function(t,e,i,s){return this.start.setTo(t,e),this.end.setTo(i,s),this},fromSprite:function(t,e,i){return void 0===i&&(i=!1),i?this.setTo(t.center.x,t.center.y,e.center.x,e.center.y):this.setTo(t.x,t.y,e.x,e.y)},fromAngle:function(t,e,i,s){return this.start.setTo(t,e),this.end.setTo(t+Math.cos(i)*s,e+Math.sin(i)*s),this},rotate:function(t,e){var i=(this.start.x+this.end.x)/2,s=(this.start.y+this.end.y)/2;return this.start.rotate(i,s,t,e),this.end.rotate(i,s,t,e),this},rotateAround:function(t,e,i,s){return this.start.rotate(t,e,i,s),this.end.rotate(t,e,i,s),this},intersects:function(t,e,i){return o.Line.intersectsPoints(this.start,this.end,t.start,t.end,e,i)},reflect:function(t){return o.Line.reflect(this,t)},midPoint:function(t){return void 0===t&&(t=new o.Point),t.x=(this.start.x+this.end.x)/2,t.y=(this.start.y+this.end.y)/2,t},centerOn:function(t,e){var i=(this.start.x+this.end.x)/2,s=(this.start.y+this.end.y)/2,n=t-i,o=e-s;this.start.add(n,o),this.end.add(n,o)},pointOnLine:function(t,e){return(t-this.start.x)*(this.end.y-this.start.y)==(this.end.x-this.start.x)*(e-this.start.y)},pointOnSegment:function(t,e){var i=Math.min(this.start.x,this.end.x),s=Math.max(this.start.x,this.end.x),n=Math.min(this.start.y,this.end.y),o=Math.max(this.start.y,this.end.y);return this.pointOnLine(t,e)&&t>=i&&t<=s&&e>=n&&e<=o},random:function(t){void 0===t&&(t=new o.Point);var e=Math.random();return t.x=this.start.x+e*(this.end.x-this.start.x),t.y=this.start.y+e*(this.end.y-this.start.y),t},coordinatesOnLine:function(t,e){void 0===t&&(t=1),void 0===e&&(e=[]);var i=Math.round(this.start.x),s=Math.round(this.start.y),n=Math.round(this.end.x),o=Math.round(this.end.y),a=Math.abs(n-i),r=Math.abs(o-s),h=i<n?1:-1,l=s<o?1:-1,c=a-r;e.push([i,s]);for(var u=1;i!==n||s!==o;){var d=c<<1;d>-r&&(c-=r,i+=h),d<a&&(c+=a,s+=l),u%t==0&&e.push([i,s]),u++}return e},clone:function(t){return void 0===t||null===t?t=new o.Line(this.start.x,this.start.y,this.end.x,this.end.y):t.setTo(this.start.x,this.start.y,this.end.x,this.end.y),t}},Object.defineProperty(o.Line.prototype,"length",{get:function(){return Math.sqrt((this.end.x-this.start.x)*(this.end.x-this.start.x)+(this.end.y-this.start.y)*(this.end.y-this.start.y))}}),Object.defineProperty(o.Line.prototype,"angle",{get:function(){return Math.atan2(this.end.y-this.start.y,this.end.x-this.start.x)}}),Object.defineProperty(o.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(o.Line.prototype,"perpSlope",{get:function(){return-(this.end.x-this.start.x)/(this.end.y-this.start.y)}}),Object.defineProperty(o.Line.prototype,"x",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(o.Line.prototype,"y",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(o.Line.prototype,"left",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(o.Line.prototype,"right",{get:function(){return Math.max(this.start.x,this.end.x)}}),Object.defineProperty(o.Line.prototype,"top",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(o.Line.prototype,"bottom",{get:function(){return Math.max(this.start.y,this.end.y)}}),Object.defineProperty(o.Line.prototype,"width",{get:function(){return Math.abs(this.start.x-this.end.x)}}),Object.defineProperty(o.Line.prototype,"height",{get:function(){return Math.abs(this.start.y-this.end.y)}}),Object.defineProperty(o.Line.prototype,"normalX",{get:function(){return Math.cos(this.angle-1.5707963267948966)}}),Object.defineProperty(o.Line.prototype,"normalY",{get:function(){return Math.sin(this.angle-1.5707963267948966)}}),Object.defineProperty(o.Line.prototype,"normalAngle",{get:function(){return o.Math.wrap(this.angle-1.5707963267948966,-Math.PI,Math.PI)}}),o.Line.intersectsPoints=function(t,e,i,s,n,a){void 0===n&&(n=!0),void 0===a&&(a=new o.Point);var r=e.y-t.y,h=s.y-i.y,l=t.x-e.x,c
* @author Mat Groves http://matgroves.com/ @Doormat23
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Matrix=function(t,e,i,s,n,a){void 0!==t&&null!==t||(t=1),void 0!==e&&null!==e||(e=0),void 0!==i&&null!==i||(i=0),void 0!==s&&null!==s||(s=1),void 0!==n&&null!==n||(n=0),void 0!==a&&null!==a||(a=0),this.a=t,this.b=e,this.c=i,this.d=s,this.tx=n,this.ty=a,this.type=o.MATRIX},o.Matrix.prototype={fromArray:function(t){return this.setTo(t[0],t[1],t[3],t[4],t[2],t[5])},setTo:function(t,e,i,s,n,o){return this.a=t,this.b=e,this.c=i,this.d=s,this.tx=n,this.ty=o,this},clone:function(t){return void 0===t||null===t?t=new o.Matrix(this.a,this.b,this.c,this.d,this.tx,this.ty):(t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty),t},copyTo:function(t){return t.copyFrom(this),t},copyFrom:function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},toArray:function(t,e){return void 0===e&&(e=new PIXI.Float32Array(9)),t?(e[0]=this.a,e[1]=this.b,e[2]=0,e[3]=this.c,e[4]=this.d,e[5]=0,e[6]=this.tx,e[7]=this.ty,e[8]=1):(e[0]=this.a,e[1]=this.c,e[2]=this.tx,e[3]=this.b,e[4]=this.d,e[5]=this.ty,e[6]=0,e[7]=0,e[8]=1),e},apply:function(t,e){return void 0===e&&(e=new o.Point),e.x=this.a*t.x+this.c*t.y+this.tx,e.y=this.b*t.x+this.d*t.y+this.ty,e},applyInverse:function(t,e){void 0===e&&(e=new o.Point);var i=1/(this.a*this.d+this.c*-this.b),s=t.x,n=t.y;return e.x=this.d*i*s+-this.c*i*n+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*n+-this.b*i*s+(-this.ty*this.a+this.tx*this.b)*i,e},translate:function(t,e){return this.tx+=t,this.ty+=e,this},scale:function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},rotate:function(t){var e=Math.cos(t),i=Math.sin(t),s=this.a,n=this.c,o=this.tx;return this.a=s*e-this.b*i,this.b=s*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this},append:function(t){var e=this.a,i=this.b,s=this.c,n=this.d;return this.a=t.a*e+t.b*s,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*s,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*s+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this},identity:function(){return this.setTo(1,0,0,1,0,0)}},o.identityMatrix=new o.Matrix,PIXI.Matrix=o.Matrix,PIXI.identityMatrix=o.identityMatrix,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Point=function(t,e){t=t||0,e=e||0,this.x=t,this.y=e,this.type=o.POINT},o.Point.prototype={copyFrom:function(t){return this.setTo(t.x,t.y)},invert:function(){return this.setTo(this.y,this.x)},setTo:function(t,e){return this.x=t||0,this.y=e||(0!==e?this.x:0),this},set:function(t,e){return this.x=t||0,this.y=e||(0!==e?this.x:0),this},add:function(t,e){return this.x+=t,this.y+=e,this},subtract:function(t,e){return this.x-=t,this.y-=e,this},multiply:function(t,e){return this.x*=t,this.y*=e,this},divide:function(t,e){return this.x/=t,this.y/=e,this},clampX:function(t,e){return this.x=o.Math.clamp(this.x,t,e),this},clampY:function(t,e){return this.y=o.Math.clamp(this.y,t,e),this},clamp:function(t,e){return this.x=o.Math.clamp(this.x,t,e),this.y=o.Math.clamp(this.y,t,e),this},clone:function(t){return void 0===t||null===t?t=new o.Point(this.x,this.y):t.setTo(this.x,this.y),t},copyTo:function(t){return t.x=this.x,t.y=this.y,t},distance:function(t,e){return o.Point.distance(this,t,e)},equals:function(t){return t.x===this.x&&t.y===this.y},angle:function(t,e){return void 0===e&&(e=!1),e?o.Math.radToDeg(Math.atan2(t.y-this.y,t.x-this.x)):Math.atan2(t.y-this.y,t.x-this.x)},rotate:function(t,e,i,s,n){return o.Point.rotate(this,t,e,i,s,n)},getMagnitude:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},getMagnitudeSq:function(){return this.x*this.x+this.y*this.y},setMagnitude:function(t){return this.normalize().multiply(t,t)},normalize:function(){if(!this.isZero()){var t=this.getMagnitude();this.x/=t,this.y/=t}return this},isZero:function(){return 0===this.x&&0===this.y},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},perp:function(){return this.setTo(-this.y,this.x)},rperp:function(){return this.setTo(this.y,-this.x)},normalRightHand:function(){return this.setTo(-1*this.y,this.x)},floor:function(){return this.setTo(Math.floor(this.x),Math.floor(this.y))},ceil:function(){return this.setTo(Math.ceil(this.x),Math.ceil(this.y))},toString:function(){return"[{Point (x="+this.x+" y="+this.y+")}]"}},o.Point.prototype.constructor=o.Point,o.Point.add=function(t,e,i){return void 0===i&&(i=new o.Point),i.x=t.x+e.x,i.y=t.y+e.y,i},o.Point.subtract=function(t,e,i){return void 0===i&&(i=new o.Point),i.x=t.x-e.x,i.y=t.y-e.y,i},o.Point.multiply=function(t,e,i){return void 0===i&&(i=new o.Point),i.x=t.x*e.x,i.y=t.y*e.y,i},o.Point.divide=function(t,e,i){return void 0===i&&(i=new o.Point),i.x=t.x/e.x,i.y=t.y/e.y,i},o.Point.equals=function(t,e){return t.x===e.x&&t.y===e.y},o.Point.angle=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},o.Point.negative=function(t,e){return void 0===e&&(e=new o.Point),e.setTo(-t.x,-t.y)},o.Point.multiplyAdd=function(t,e,i,s){return void 0===s&&(s=new o.Point),s.setTo(t.x+e.x*i,t.y+e.y*i)},o.Point.interpolate=function(t,e,i,s){return void 0===s&&(s=new o.Point),s.setTo(t.x+(e.x-t.x)*i,t.y+(e.y-t.y)*i)},o.Point.perp=function(t,e){return void 0===e&&(e=new o.Point),e.setTo(-t.y,t.x)},o.Point.rperp=function(t,e){return void 0===e&&(e=new o.Point),e.setTo(t.y,-t.x)},o.Point.distance=function(t,e,i){var s=o.Math.distance(t.x,t.y,e.x,e.y);return i?Math.round(s):s},o.Point.project=function(t,e,i){void 0===i&&(i=new o.Point);var s=t.dot(e)/e.getMagnitudeSq();return 0!==s&&i.setTo(s*e.x,s*e.y),i},o.Point.projectUnit=function(t,e,i){void 0===i&&(i=new o.Point);var s=t.dot(e);return 0!==s&&i.setTo(s*e.x,s*e.y),i},o.Point.normalRightHand=function(t,e){return void 0===e&&(e=new o.Point),e.setTo(-1*t.y,t.x)},o.Point.normalize=function(t,e){void 0===e&&(e=new o.Point);var i=t.getMagnitude();return 0!==i&&e.setTo(t.x/i,t.y/i),e},o.Point.rotate=function(t,e,i,s,n,a){if(n&&(s=o.Math.degToRad(s)),void 0===a){t.subtract(e,i);var r=Math.sin(s),h=Math.cos(s),l=h*t.x-r*t.y,c=r*t.x+h*t.y;t.x=l+e,t.y=c+i}else{var u=s+Math.atan2(t.y-i,t.x-e);t.x=e+a*Math.cos(u),t.y=i+a*Math.sin(u)}return t},o.Point.centroid=function(t,e){if(void 0===e&&(e=new o.Point),"[object Array]"!==Object.prototype.toString.call(t))throw new Error("Phaser.Point. Parameter 'points' must be an array");var i=t.length;if(i<1)thro
* @author Richard Davey <rich@photonstorm.com>
* @author Adrien Brault <adrien.brault@gmail.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Polygon=function(){this.area=0,this._points=[],arguments.length>0&&this.setTo.apply(this,arguments),this.closed=!0,this.flattened=!1,this.type=o.POLYGON},o.Polygon.prototype={toNumberArray:function(t){void 0===t&&(t=[]);for(var e=0;e<this._points.length;e++)"number"==typeof this._points[e]?(t.push(this._points[e]),t.push(this._points[e+1]),e++):(t.push(this._points[e].x),t.push(this._points[e].y));return t},flatten:function(){return this._points=this.toNumberArray(),this.flattened=!0,this},clone:function(t){var e=this._points.slice();return void 0===t||null===t?t=new o.Polygon(e):t.setTo(e),t},contains:function(t,e){var i=!1;if(this.flattened)for(var s=-2,n=this._points.length-2;(s+=2)<this._points.length;n=s){var o=this._points[s],a=this._points[s+1],r=this._points[n],h=this._points[n+1];(a<=e&&e<h||h<=e&&e<a)&&t<(r-o)*(e-a)/(h-a)+o&&(i=!i)}else for(var s=-1,n=this._points.length-1;++s<this._points.length;n=s){var o=this._points[s].x,a=this._points[s].y,r=this._points[n].x,h=this._points[n].y;(a<=e&&e<h||h<=e&&e<a)&&t<(r-o)*(e-a)/(h-a)+o&&(i=!i)}return i},setTo:function(t){if(this.area=0,this._points=[],arguments.length>0){Array.isArray(t)||(t=Array.prototype.slice.call(arguments));for(var e=Number.MAX_VALUE,i=0,s=t.length;i<s;i++){if("number"==typeof t[i]){var n=new PIXI.Point(t[i],t[i+1]);i++}else if(Array.isArray(t[i]))var n=new PIXI.Point(t[i][0],t[i][1]);else var n=new PIXI.Point(t[i].x,t[i].y);this._points.push(n),n.y<e&&(e=n.y)}this.calculateArea(e)}return this},calculateArea:function(t){for(var e,i,s,n,o=0,a=this._points.length;o<a;o++)e=this._points[o],i=o===a-1?this._points[0]:this._points[o+1],s=(e.y-t+(i.y-t))/2,n=e.x-i.x,this.area+=s*n;return this.area}},o.Polygon.prototype.constructor=o.Polygon,Object.defineProperty(o.Polygon.prototype,"points",{get:function(){return this._points},set:function(t){null!=t?this.setTo(t):this.setTo()}}),PIXI.Polygon=o.Polygon,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Rectangle=function(t,e,i,s){t=t||0,e=e||0,i=i||0,s=s||0,this.x=t,this.y=e,this.width=i,this.height=s,this.type=o.RECTANGLE},o.Rectangle.prototype={offset:function(t,e){return this.x+=t,this.y+=e,this},offsetPoint:function(t){return this.offset(t.x,t.y)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},scale:function(t,e){return void 0===e&&(e=t),this.width*=t,this.height*=e,this},centerOn:function(t,e){return this.centerX=t,this.centerY=e,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},ceil:function(){this.x=Math.ceil(this.x),this.y=Math.ceil(this.y)},ceilAll:function(){this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.width=Math.ceil(this.width),this.height=Math.ceil(this.height)},copyFrom:function(t){return this.setTo(t.x,t.y,t.width,t.height)},copyTo:function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},inflate:function(t,e){return o.Rectangle.inflate(this,t,e)},size:function(t){return o.Rectangle.size(this,t)},resize:function(t,e){return this.width=t,this.height=e,this},clone:function(t){return o.Rectangle.clone(this,t)},contains:function(t,e){return o.Rectangle.contains(this,t,e)},containsRect:function(t){return o.Rectangle.containsRect(t,this)},equals:function(t){return o.Rectangle.equals(this,t)},intersection:function(t,e){return o.Rectangle.intersection(this,t,e)},intersects:function(t){return o.Rectangle.intersects(this,t)},intersectsRaw:function(t,e,i,s,n){return o.Rectangle.intersectsRaw(this,t,e,i,s,n)},union:function(t,e){return o.Rectangle.union(this,t,e)},random:function(t){return void 0===t&&(t=new o.Point),t.x=this.randomX,t.y=this.randomY,t},getPoint:function(t,e){switch(void 0===e&&(e=new o.Point),t){default:case o.TOP_LEFT:return e.set(this.x,this.y);case o.TOP_CENTER:return e.set(this.centerX,this.y);case o.TOP_RIGHT:return e.set(this.right,this.y);case o.LEFT_CENTER:return e.set(this.x,this.centerY);case o.CENTER:return e.set(this.centerX,this.centerY);case o.RIGHT_CENTER:return e.set(this.right,this.centerY);case o.BOTTOM_LEFT:return e.set(this.x,this.bottom);case o.BOTTOM_CENTER:return e.set(this.centerX,this.bottom);case o.BOTTOM_RIGHT:return e.set(this.right,this.bottom)}},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(o.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(o.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(o.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}}),Object.defineProperty(o.Rectangle.prototype,"bottomLeft",{get:function(){return new o.Point(this.x,this.bottom)},set:function(t){this.x=t.x,this.bottom=t.y}}),Object.defineProperty(o.Rectangle.prototype,"bottomRight",{get:function(){return new o.Point(this.right,this.bottom)},set:function(t){this.right=t.x,this.bottom=t.y}}),Object.defineProperty(o.Rectangle.prototype,"left",{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}}),Object.defineProperty(o.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}}),Object.defineProperty(o.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(o.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(o.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(t){this.x=t-this.halfWidth}}),Object.defineProperty(o.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(t){this.y=t-this.halfHeight}}),Object.defineProperty(o.Rectangle.prototype,"randomX",{get:fun
* @author Mat Groves http://matgroves.com/
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.RoundedRectangle=function(t,e,i,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=s,this.radius=n||20,this.type=o.ROUNDEDRECTANGLE},o.RoundedRectangle.prototype={clone:function(){return new o.RoundedRectangle(this.x,this.y,this.width,this.height,this.radius)},contains:function(t,e){if(this.width<=0||this.height<=0)return!1;var i=this.x;if(t>=i&&t<=i+this.width){var s=this.y;if(e>=s&&e<=s+this.height)return!0}return!1}},o.RoundedRectangle.prototype.constructor=o.RoundedRectangle,PIXI.RoundedRectangle=o.RoundedRectangle,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Camera=function(t,e,i,s,n,a){this.game=t,this.world=t.world,this.id=0,this.view=new o.Rectangle(i,s,n,a),this.bounds=new o.Rectangle(i,s,n,a),this.deadzone=null,this.visible=!0,this.roundPx=!0,this.atLimit={x:!1,y:!1},this.target=null,this.displayObject=null,this.scale=null,this.totalInView=0,this.lerp=new o.Point(1,1),this.onShakeComplete=new o.Signal,this.onFlashComplete=new o.Signal,this.onFadeComplete=new o.Signal,this.fx=null,this._targetPosition=new o.Point,this._edge=0,this._position=new o.Point,this._shake={intensity:0,duration:0,horizontal:!1,vertical:!1,shakeBounds:!0,x:0,y:0},this._fxDuration=0,this._fxType=0},o.Camera.FOLLOW_LOCKON=0,o.Camera.FOLLOW_PLATFORMER=1,o.Camera.FOLLOW_TOPDOWN=2,o.Camera.FOLLOW_TOPDOWN_TIGHT=3,o.Camera.SHAKE_BOTH=4,o.Camera.SHAKE_HORIZONTAL=5,o.Camera.SHAKE_VERTICAL=6,o.Camera.ENABLE_FX=!0,o.Camera.prototype={boot:function(){this.displayObject=this.game.world,this.scale=this.game.world.scale,this.game.camera=this,o.Graphics&&o.Camera.ENABLE_FX&&(this.fx=new o.Graphics(this.game),this.game.stage.addChild(this.fx))},preUpdate:function(){this.totalInView=0},follow:function(t,e,i,s){void 0===e&&(e=o.Camera.FOLLOW_LOCKON),void 0===i&&(i=1),void 0===s&&(s=1),this.target=t,this.lerp.set(i,s);var n;switch(e){case o.Camera.FOLLOW_PLATFORMER:var a=this.width/8,r=this.height/3;this.deadzone=new o.Rectangle((this.width-a)/2,(this.height-r)/2-.25*r,a,r);break;case o.Camera.FOLLOW_TOPDOWN:n=Math.max(this.width,this.height)/4,this.deadzone=new o.Rectangle((this.width-n)/2,(this.height-n)/2,n,n);break;case o.Camera.FOLLOW_TOPDOWN_TIGHT:n=Math.max(this.width,this.height)/8,this.deadzone=new o.Rectangle((this.width-n)/2,(this.height-n)/2,n,n);break;case o.Camera.FOLLOW_LOCKON:default:this.deadzone=null}},unfollow:function(){this.target=null},focusOn:function(t){this.setPosition(Math.round(t.x-this.view.halfWidth),Math.round(t.y-this.view.halfHeight))},focusOnXY:function(t,e){this.setPosition(Math.round(t-this.view.halfWidth),Math.round(e-this.view.halfHeight))},shake:function(t,e,i,s,n){return void 0===t&&(t=.05),void 0===e&&(e=500),void 0===i&&(i=!0),void 0===s&&(s=o.Camera.SHAKE_BOTH),void 0===n&&(n=!0),!(!i&&this._shake.duration>0)&&(this._shake.intensity=t,this._shake.duration=e,this._shake.shakeBounds=n,this._shake.x=0,this._shake.y=0,this._shake.horizontal=s===o.Camera.SHAKE_BOTH||s===o.Camera.SHAKE_HORIZONTAL,this._shake.vertical=s===o.Camera.SHAKE_BOTH||s===o.Camera.SHAKE_VERTICAL,!0)},flash:function(t,e,i){return void 0===t&&(t=16777215),void 0===e&&(e=500),void 0===i&&(i=!1),!(!this.fx||!i&&this._fxDuration>0)&&(this.fx.clear(),this.fx.beginFill(t),this.fx.drawRect(0,0,this.width,this.height),this.fx.endFill(),this.fx.alpha=1,this._fxDuration=e,this._fxType=0,!0)},fade:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=500),void 0===i&&(i=!1),!(!this.fx||!i&&this._fxDuration>0)&&(this.fx.clear(),this.fx.beginFill(t),this.fx.drawRect(0,0,this.width,this.height),this.fx.endFill(),this.fx.alpha=0,this._fxDuration=e,this._fxType=1,!0)},update:function(){this._fxDuration>0&&this.updateFX(),this._shake.duration>0&&this.updateShake(),this.bounds&&this.checkBounds(),this.roundPx&&(this.view.floor(),this._shake.x=Math.floor(this._shake.x),this._shake.y=Math.floor(this._shake.y)),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateFX:function(){0===this._fxType?(this.fx.alpha-=this.game.time.elapsedMS/this._fxDuration,this.fx.alpha<=0&&(this._fxDuration=0,this.fx.alpha=0,this.onFlashComplete.dispatch())):(this.fx.alpha+=this.game.time.elapsedMS/this._fxDuration,this.fx.alpha>=1&&(this._fxDuration=0,this.fx.alpha=1,this.onFadeComplete.dispatch()))},updateShake:function(){this._shake.duration-=this.game.time.elapsedMS,this._shake.duration<=0?(this.onShakeComplete.dispatch(),this._shake.x=0,this._shake.y=0):(this._shake.horizontal&&(this._shake.x=this.game.rnd.frac()*this._shake.intensity*this.view.width*2-this._shake.intensity*this.view.width),this._shake.vertical&&(this._shake.y=this.game.rnd.frac()*this._shake.intensity*this.view.height*2-this._shake.in
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.State=function(){this.game=null,this.key="",this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.state=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},o.State.prototype={init:function(){},preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},preRender:function(){},render:function(){},resize:function(){},paused:function(){},resumed:function(){},pauseUpdate:function(){},shutdown:function(){}},o.State.prototype.constructor=o.State,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.StateManager=function(t,e){this.game=t,this.states={},this._pendingState=null,void 0!==e&&null!==e&&(this._pendingState=e),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onStateChange=new o.Signal,this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onResizeCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null,this.onShutDownCallback=null},o.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),null!==this._pendingState&&"string"!=typeof this._pendingState&&this.add("default",this._pendingState,!0)},add:function(t,e,i){void 0===i&&(i=!1);var s;return e instanceof o.State?s=e:"object"==typeof e?(s=e,s.game=this.game):"function"==typeof e&&(s=new e(this.game)),this.states[t]=s,i&&(this.game.isBooted?this.start(t):this._pendingState=t),s},remove:function(t){this.current===t&&(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.onPreRenderCallback=null,this.onRenderCallback=null,this.onResizeCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null),delete this.states[t]},start:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.checkState(t)&&(this._pendingState=t,this._clearWorld=e,this._clearCache=i,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},restart:function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),this._pendingState=this.current,this._clearWorld=t,this._clearCache=e,arguments.length>2&&(this._args=Array.prototype.slice.call(arguments,2))},dummy:function(){},preUpdate:function(){if(this._pendingState&&this.game.isBooted){var t=this.current;if(this.clearCurrentState(),this.setCurrentState(this._pendingState),this.onStateChange.dispatch(this.current,t),this.current!==this._pendingState)return;this._pendingState=null,this.onPreloadCallback?(this.game.load.reset(!0),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()&&0===this.game.load.totalQueuedPacks()?this.loadComplete():this.game.load.start()):this.loadComplete()}},clearCurrentState:function(){this.current&&(this.onShutDownCallback&&this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this.game.scale.reset(this._clearWorld),this.game.debug&&this.game.debug.reset(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache&&this.game.cache.destroy()))},checkState:function(t){return!!this.states[t]&&!!(this.states[t].preload||this.states[t].create||this.states[t].update||this.states[t].render)},link:function(t){this.states[t].game=this.game,this.states[t].add=this.game.add,this.states[t].make=this.game.make,this.states[t].camera=this.game.camera,this.states[t].cache=this.game.cache,this.states[t].input=this.game.input,this.states[t].load=this.game.load,this.states[t].math=this.game.math,this.states[t].sound=this.game.sound,this.states[t].scale=this.game.scale,this.states[t].state=this,this.states[t].stage=this.game.stage,this.states[t].time=this.game.time,this.states[t].tweens=this.game.tweens,this.states[t].world=this.game.world,this.states[t].particles=this.game.particles,this.states[t].rnd=this.game.rnd,this.states[t].physics=this.game.physics,this.states[t].key=t},unlink:function(t){this.states[t]&&(this.states[t].game=null,this.states[t].add=null,this.states[t].make=null,this.states[t].camera=null,this.states[t].cache=null,this.states[t].input=null,this.states[t].load=null,this.states[t].math=null,this.states[t].sound=null,this.states[t].scale=null,this.states[t].state=null,this.states[t].st
* @author Miller Medeiros http://millermedeiros.github.com/js-signals/
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Signal=function(){},o.Signal.prototype={_bindings:null,_prevParams:null,memorize:!1,_shouldPropagate:!0,active:!0,_boundDispatch:!1,validateListener:function(t,e){if("function"!=typeof t)throw new Error("Phaser.Signal: listener is a required param of {fn}() and should be a Function.".replace("{fn}",e))},_registerListener:function(t,e,i,s,n){var a=this._indexOfListener(t,i),r;if(-1!==a){if(r=this._bindings[a],r.isOnce()!==e)throw new Error("You cannot add"+(e?"":"Once")+"() then add"+(e?"Once":"")+"() the same listener without removing the relationship first.")}else r=new o.SignalBinding(this,t,e,i,s,n),this._addBinding(r);return this.memorize&&this._prevParams&&r.execute(this._prevParams),r},_addBinding:function(t){this._bindings||(this._bindings=[]);var e=this._bindings.length;do{e--}while(this._bindings[e]&&t._priority<=this._bindings[e]._priority);this._bindings.splice(e+1,0,t)},_indexOfListener:function(t,e){if(!this._bindings)return-1;void 0===e&&(e=null);for(var i=this._bindings.length,s;i--;)if(s=this._bindings[i],s._listener===t&&s.context===e)return i;return-1},has:function(t,e){return-1!==this._indexOfListener(t,e)},add:function(t,e,i){this.validateListener(t,"add");var s=[];if(arguments.length>3)for(var n=3;n<arguments.length;n++)s.push(arguments[n]);return this._registerListener(t,!1,e,i,s)},addOnce:function(t,e,i){this.validateListener(t,"addOnce");var s=[];if(arguments.length>3)for(var n=3;n<arguments.length;n++)s.push(arguments[n]);return this._registerListener(t,!0,e,i,s)},remove:function(t,e){this.validateListener(t,"remove");var i=this._indexOfListener(t,e);return-1!==i&&(this._bindings[i]._destroy(),this._bindings.splice(i,1)),t},removeAll:function(t){if(void 0===t&&(t=null),this._bindings){for(var e=this._bindings.length;e--;)t?this._bindings[e].context===t&&(this._bindings[e]._destroy(),this._bindings.splice(e,1)):this._bindings[e]._destroy();t||(this._bindings.length=0)}},getNumListeners:function(){return this._bindings?this._bindings.length:0},halt:function(){this._shouldPropagate=!1},dispatch:function(){if(this.active&&this._bindings){var t=Array.prototype.slice.call(arguments),e=this._bindings.length,i;if(this.memorize&&(this._prevParams=t),e){i=this._bindings.slice(),this._shouldPropagate=!0;do{e--}while(i[e]&&this._shouldPropagate&&!1!==i[e].execute(t))}}},forget:function(){this._prevParams&&(this._prevParams=null)},dispose:function(){this.removeAll(),this._bindings=null,this._prevParams&&(this._prevParams=null)},toString:function(){return"[Phaser.Signal active:"+this.active+" numListeners:"+this.getNumListeners()+"]"}},Object.defineProperty(o.Signal.prototype,"boundDispatch",{get:function(){var t=this;return this._boundDispatch||(this._boundDispatch=function(){return t.dispatch.apply(t,arguments)})}}),o.Signal.prototype.constructor=o.Signal,/**
* @author Miller Medeiros http://millermedeiros.github.com/js-signals/
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.SignalBinding=function(t,e,i,s,n,o){this._listener=e,i&&(this._isOnce=!0),null!=s&&(this.context=s),this._signal=t,n&&(this._priority=n),o&&o.length&&(this._args=o)},o.SignalBinding.prototype={context:null,_isOnce:!1,_priority:0,_args:null,callCount:0,active:!0,params:null,execute:function(t){var e,i;return this.active&&this._listener&&(i=this.params?this.params.concat(t):t,this._args&&(i=i.concat(this._args)),e=this._listener.apply(this.context,i),this.callCount++,this._isOnce&&this.detach()),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+"]"}},o.SignalBinding.prototype.constructor=o.SignalBinding,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Filter=function(t,e,i){this.game=t,this.type=o.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.prevPoint=new o.Point;var s=new Date;if(this.uniforms={resolution:{type:"2f",value:{x:256,y:256}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:0,y:0}},date:{type:"4fv",value:[s.getFullYear(),s.getMonth(),s.getDate(),60*s.getHours()*60+60*s.getMinutes()+s.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}},e)for(var n in e)this.uniforms[n]=e[n];this.fragmentSrc=i||""},o.Filter.prototype={init:function(){},setResolution:function(t,e){this.uniforms.resolution.value.x=t,this.uniforms.resolution.value.y=e},update:function(t){if(void 0!==t){var e=t.x/this.game.width,i=1-t.y/this.game.height;e===this.prevPoint.x&&i===this.prevPoint.y||(this.uniforms.mouse.value.x=e.toFixed(2),this.uniforms.mouse.value.y=i.toFixed(2),this.prevPoint.set(e,i))}this.uniforms.time.value=this.game.time.totalElapsedSeconds()},addToWorld:function(t,e,i,s,n,o){void 0===n&&(n=0),void 0===o&&(o=0),void 0!==i&&null!==i?this.width=i:i=this.width,void 0!==s&&null!==s?this.height=s:s=this.height;var a=this.game.add.image(t,e,"__default");return a.width=i,a.height=s,a.anchor.set(n,o),a.filters=[this],a},destroy:function(){this.game=null}},o.Filter.prototype.constructor=o.Filter,Object.defineProperty(o.Filter.prototype,"width",{get:function(){return this.uniforms.resolution.value.x},set:function(t){this.uniforms.resolution.value.x=t}}),Object.defineProperty(o.Filter.prototype,"height",{get:function(){return this.uniforms.resolution.value.y},set:function(t){this.uniforms.resolution.value.y=t}}),/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Plugin=function(t,e){void 0===e&&(e=null),this.game=t,this.parent=e,this.active=!1,this.visible=!1,this.hasPreUpdate=!1,this.hasUpdate=!1,this.hasPostUpdate=!1,this.hasRender=!1,this.hasPostRender=!1},o.Plugin.prototype={preUpdate:function(){},update:function(){},render:function(){},postRender:function(){},destroy:function(){this.game=null,this.parent=null,this.active=!1,this.visible=!1}},o.Plugin.prototype.constructor=o.Plugin,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.PluginManager=function(t){this.game=t,this.plugins=[],this._len=0,this._i=0},o.PluginManager.prototype={add:function(t){var e=Array.prototype.slice.call(arguments,1),i=!1;return"function"==typeof t?t=new t(this.game,this):(t.game=this.game,t.parent=this),"function"==typeof t.preUpdate&&(t.hasPreUpdate=!0,i=!0),"function"==typeof t.update&&(t.hasUpdate=!0,i=!0),"function"==typeof t.postUpdate&&(t.hasPostUpdate=!0,i=!0),"function"==typeof t.render&&(t.hasRender=!0,i=!0),"function"==typeof t.postRender&&(t.hasPostRender=!0,i=!0),i?((t.hasPreUpdate||t.hasUpdate||t.hasPostUpdate)&&(t.active=!0),(t.hasRender||t.hasPostRender)&&(t.visible=!0),this._len=this.plugins.push(t),"function"==typeof t.init&&t.init.apply(t,e),t):null},remove:function(t,e){for(void 0===e&&(e=!0),this._i=this._len;this._i--;)if(this.plugins[this._i]===t)return e&&t.destroy(),this.plugins.splice(this._i,1),void this._len--},removeAll:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].destroy();this.plugins.length=0,this._len=0},preUpdate:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].active&&this.plugins[this._i].hasPreUpdate&&this.plugins[this._i].preUpdate()},update:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].active&&this.plugins[this._i].hasUpdate&&this.plugins[this._i].update()},postUpdate:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].active&&this.plugins[this._i].hasPostUpdate&&this.plugins[this._i].postUpdate()},render:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].visible&&this.plugins[this._i].hasRender&&this.plugins[this._i].render()},postRender:function(){for(this._i=this._len;this._i--;)this.plugins[this._i].visible&&this.plugins[this._i].hasPostRender&&this.plugins[this._i].postRender()},destroy:function(){this.removeAll(),this.game=null}},o.PluginManager.prototype.constructor=o.PluginManager,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Stage=function(t){this.game=t,PIXI.DisplayObjectContainer.call(this),this.name="_stage_root",this.disableVisibilityChange=!1,this.exists=!0,this.worldTransform=new PIXI.Matrix,this.stage=this,this.currentRenderOrderID=0,this._hiddenVar="hidden",this._onChange=null,this._bgColor={r:0,g:0,b:0,a:0,color:0,rgba:"#000000"},this.game.transparent||(this._bgColor.a=1),t.config&&this.parseConfig(t.config)},o.Stage.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),o.Stage.prototype.constructor=o.Stage,o.Stage.prototype.parseConfig=function(t){t.disableVisibilityChange&&(this.disableVisibilityChange=t.disableVisibilityChange),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor)},o.Stage.prototype.boot=function(){o.DOM.getOffset(this.game.canvas,this.offset),o.Canvas.setUserSelect(this.game.canvas,"none"),o.Canvas.setTouchAction(this.game.canvas,"none"),this.checkVisibility()},o.Stage.prototype.preUpdate=function(){this.currentRenderOrderID=0;for(var t=0;t<this.children.length;t++)this.children[t].preUpdate()},o.Stage.prototype.update=function(){for(var t=this.children.length;t--;)this.children[t].update()},o.Stage.prototype.postUpdate=function(){this.game.camera.update(),this.game.camera.target&&(this.game.camera.target.postUpdate(),this.updateTransform(),this.game.camera.updateTarget());for(var t=0;t<this.children.length;t++)this.children[t].postUpdate();this.updateTransform()},o.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var t=0;t<this.children.length;t++)this.children[t].updateTransform()},o.Stage.prototype.checkVisibility=function(){void 0!==document.hidden?this._hiddenVar="visibilitychange":void 0!==document.webkitHidden?this._hiddenVar="webkitvisibilitychange":void 0!==document.mozHidden?this._hiddenVar="mozvisibilitychange":void 0!==document.msHidden?this._hiddenVar="msvisibilitychange":this._hiddenVar=null;var t=this;this._onChange=function(e){return t.visibilityChange(e)},this._hiddenVar&&document.addEventListener(this._hiddenVar,this._onChange,!1),window.onblur=this._onChange,window.onfocus=this._onChange,window.onpagehide=this._onChange,window.onpageshow=this._onChange,this.game.device.cocoonJSApp&&(CocoonJS.App.onSuspended.addEventListener(function(){o.Stage.prototype.visibilityChange.call(t,{type:"pause"})}),CocoonJS.App.onActivated.addEventListener(function(){o.Stage.prototype.visibilityChange.call(t,{type:"resume"})}))},o.Stage.prototype.visibilityChange=function(t){if("pagehide"===t.type||"blur"===t.type||"pageshow"===t.type||"focus"===t.type)return void("pagehide"===t.type||"blur"===t.type?this.game.focusLoss(t):"pageshow"!==t.type&&"focus"!==t.type||this.game.focusGain(t));this.disableVisibilityChange||(document.hidden||document.mozHidden||document.msHidden||document.webkitHidden||"pause"===t.type?this.game.gamePaused(t):this.game.gameResumed(t))},o.Stage.prototype.setBackgroundColor=function(t){this.game.transparent||(o.Color.valueToColor(t,this._bgColor),o.Color.updateColor(this._bgColor),this._bgColor.r/=255,this._bgColor.g/=255,this._bgColor.b/=255,this._bgColor.a=1)},o.Stage.prototype.destroy=function(){this._hiddenVar&&document.removeEventListener(this._hiddenVar,this._onChange,!1),window.onpagehide=null,window.onpageshow=null,window.onblur=null,window.onfocus=null},Object.defineProperty(o.Stage.prototype,"backgroundColor",{get:function(){return this._bgColor.color},set:function(t){this.setBackgroundColor(t)}}),Object.defineProperty(o.Stage.prototype,"smoothed",{get:function(){return PIXI.scaleModes.DEFAULT===PIXI.scaleModes.LINEAR},set:function(t){PIXI.scaleModes.DEFAULT=t?PIXI.scaleModes.LINEAR:PIXI.scaleModes.NEAREST}}),/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Group=function(t,e,i,s,n,a){void 0===s&&(s=!1),void 0===n&&(n=!1),void 0===a&&(a=o.Physics.ARCADE),this.game=t,void 0===e&&(e=t.world),this.name=i||"group",this.z=0,PIXI.DisplayObjectContainer.call(this),s?(this.game.stage.addChild(this),this.z=this.game.stage.children.length):e&&(e.addChild(this),this.z=e.children.length),this.type=o.GROUP,this.physicsType=o.GROUP,this.alive=!0,this.exists=!0,this.ignoreDestroy=!1,this.pendingDestroy=!1,this.classType=o.Sprite,this.cursor=null,this.inputEnableChildren=!1,this.onChildInputDown=new o.Signal,this.onChildInputUp=new o.Signal,this.onChildInputOver=new o.Signal,this.onChildInputOut=new o.Signal,this.enableBody=n,this.enableBodyDebug=!1,this.physicsBodyType=a,this.physicsSortDirection=null,this.onDestroy=new o.Signal,this.cursorIndex=0,this.fixedToCamera=!1,this.cameraOffset=new o.Point,this.hash=[],this._sortProperty="z"},o.Group.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),o.Group.prototype.constructor=o.Group,o.Group.RETURN_NONE=0,o.Group.RETURN_TOTAL=1,o.Group.RETURN_CHILD=2,o.Group.RETURN_ALL=3,o.Group.SORT_ASCENDING=-1,o.Group.SORT_DESCENDING=1,o.Group.prototype.add=function(t,e,i){return void 0===e&&(e=!1),t.parent===this?t:(t.body&&t.parent&&t.parent.hash&&t.parent.removeFromHash(t),void 0===i?(t.z=this.children.length,this.addChild(t)):(this.addChildAt(t,i),this.updateZ()),this.enableBody&&t.hasOwnProperty("body")&&null===t.body?this.game.physics.enable(t,this.physicsBodyType):t.body&&this.addToHash(t),!this.inputEnableChildren||t.input&&!t.inputEnabled||(t.inputEnabled=!0),!e&&t.events&&t.events.onAddedToGroup$dispatch(t,this),null===this.cursor&&(this.cursor=t),t)},o.Group.prototype.addAt=function(t,e,i){this.add(t,i,e)},o.Group.prototype.addToHash=function(t){if(t.parent===this){if(-1===this.hash.indexOf(t))return this.hash.push(t),!0}return!1},o.Group.prototype.removeFromHash=function(t){if(t){var e=this.hash.indexOf(t);if(-1!==e)return this.hash.splice(e,1),!0}return!1},o.Group.prototype.addMultiple=function(t,e){if(t instanceof o.Group)t.moveAll(this,e);else if(Array.isArray(t))for(var i=0;i<t.length;i++)this.add(t[i],e);return t},o.Group.prototype.getAt=function(t){return t<0||t>=this.children.length?-1:this.getChildAt(t)},o.Group.prototype.create=function(t,e,i,s,n,o){void 0===n&&(n=!0);var a=new this.classType(this.game,t,e,i,s);return a.exists=n,a.visible=n,a.alive=n,this.add(a,!1,o)},o.Group.prototype.createMultiple=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=!1),Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);var n=this,o=[];return e.forEach(function(e){i.forEach(function(i){for(var a=0;a<t;a++)o.push(n.create(0,0,e,i,s))})}),o},o.Group.prototype.updateZ=function(){for(var t=this.children.length;t--;)this.children[t].z=t};o.Group.prototype.align=function(t,e,i,s,n,a){if(void 0===n&&(n=o.TOP_LEFT),void 0===a&&(a=0),0===this.children.length||a>this.children.length||-1===t&&-1===e)return!1;for(var r=new o.Rectangle(0,0,i,s),h=t*i,l=e*s,c=a;c<this.children.length;c++){var u=this.children[c];if(u.alignIn)if(u.alignIn(r,n),-1===t)r.y+=s,r.y===l&&(r.x+=i,r.y=0);else if(-1===e)r.x+=i,r.x===h&&(r.x=0,r.y+=s);else if(r.x+=i,r.x===h&&(r.x=0,r.y+=s,r.y===l))return!0}return!0},o.Group.prototype.resetCursor=function(t){if(void 0===t&&(t=0),t>this.children.length-1&&(t=0),this.cursor)return this.cursorIndex=t,this.cursor=this.children[this.cursorIndex],this.cursor},o.Group.prototype.next=function(){if(this.cursor)return this.cursorIndex>=this.children.length-1?this.cursorIndex=0:this.cursorIndex++,this.cursor=this.children[this.cursorIndex],this.cursor},o.Group.prototype.previous=function(){if(this.cursor)return 0===this.cursorIndex?this.cursorIndex=this.children.length-1:this.cursorIndex--,this.cursor=this.children[this.cursorIndex],this.cursor},o.Group.prototype.swap=function(t,e){this.swapChildren(t,e),this.updateZ()},o.Group.prototype.bringToTop=function(t){return t.parent===this&&this.getIndex(t)<this.children.length&&(this.remove(t,!1,!0),this.add(t,!0)),t},o.Group.prototype.sendToBack=function(t){return t.parent===this&&this.getInde
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.World=function(t){o.Group.call(this,t,null,"__world",!1),this.bounds=new o.Rectangle(0,0,t.width,t.height),this.camera=null,this._definedSize=!1,this._width=t.width,this._height=t.height,this.game.state.onStateChange.add(this.stateChange,this)},o.World.prototype=Object.create(o.Group.prototype),o.World.prototype.constructor=o.World,o.World.prototype.boot=function(){this.camera=new o.Camera(this.game,0,0,0,this.game.width,this.game.height),this.game.stage.addChild(this),this.camera.boot()},o.World.prototype.stateChange=function(){this.x=0,this.y=0,this.camera.reset()},o.World.prototype.setBounds=function(t,e,i,s){this._definedSize=!0,this._width=i,this._height=s,this.bounds.setTo(t,e,i,s),this.x=t,this.y=e,this.camera.bounds&&this.camera.bounds.setTo(t,e,Math.max(i,this.game.width),Math.max(s,this.game.height)),this.game.physics.setBoundsToWorld()},o.World.prototype.resize=function(t,e){this._definedSize&&(t<this._width&&(t=this._width),e<this._height&&(e=this._height)),this.bounds.width=t,this.bounds.height=e,this.game.camera.setBoundsToWorld(),this.game.physics.setBoundsToWorld()},o.World.prototype.shutdown=function(){this.destroy(!0,!0)},o.World.prototype.wrap=function(t,e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=!1),void 0===s&&(s=!0),void 0===n&&(n=!0),i?(t.getBounds(),s&&(t.x+t._currentBounds.width<this.bounds.x?t.x=this.bounds.right:t.x>this.bounds.right&&(t.x=this.bounds.left)),n&&(t.y+t._currentBounds.height<this.bounds.top?t.y=this.bounds.bottom:t.y>this.bounds.bottom&&(t.y=this.bounds.top))):(s&&t.x+e<this.bounds.x?t.x=this.bounds.right+e:s&&t.x-e>this.bounds.right&&(t.x=this.bounds.left-e),n&&t.y+e<this.bounds.top?t.y=this.bounds.bottom+e:n&&t.y-e>this.bounds.bottom&&(t.y=this.bounds.top-e))},Object.defineProperty(o.World.prototype,"width",{get:function(){return this.bounds.width},set:function(t){t<this.game.width&&(t=this.game.width),this.bounds.width=t,this._width=t,this._definedSize=!0}}),Object.defineProperty(o.World.prototype,"height",{get:function(){return this.bounds.height},set:function(t){t<this.game.height&&(t=this.game.height),this.bounds.height=t,this._height=t,this._definedSize=!0}}),Object.defineProperty(o.World.prototype,"centerX",{get:function(){return this.bounds.halfWidth+this.bounds.x}}),Object.defineProperty(o.World.prototype,"centerY",{get:function(){return this.bounds.halfHeight+this.bounds.y}}),Object.defineProperty(o.World.prototype,"randomX",{get:function(){return this.bounds.x<0?this.game.rnd.between(this.bounds.x,this.bounds.width-Math.abs(this.bounds.x)):this.game.rnd.between(this.bounds.x,this.bounds.width)}}),Object.defineProperty(o.World.prototype,"randomY",{get:function(){return this.bounds.y<0?this.game.rnd.between(this.bounds.y,this.bounds.height-Math.abs(this.bounds.y)):this.game.rnd.between(this.bounds.y,this.bounds.height)}}),/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Game=function(t,e,i,s,n,a,r,h){return this.id=o.GAMES.push(this)-1,this.config=null,this.physicsConfig=h,this.parent="",this.width=800,this.height=600,this.resolution=1,this._width=800,this._height=600,this.transparent=!1,this.antialias=!0,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!0,this.renderer=null,this.renderType=o.AUTO,this.state=null,this.isBooted=!1,this.isRunning=!1,this.raf=null,this.add=null,this.make=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.net=null,this.scale=null,this.sound=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.physics=null,this.plugins=null,this.rnd=null,this.device=o.Device,this.camera=null,this.canvas=null,this.context=null,this.debug=null,this.particles=null,this.create=null,this.lockRender=!1,this.stepping=!1,this.pendingStep=!1,this.stepCount=0,this.onPause=null,this.onResume=null,this.onBlur=null,this.onFocus=null,this._paused=!1,this._codePaused=!1,this.currentUpdateID=0,this.updatesThisFrame=1,this._deltaTime=0,this._lastCount=0,this._spiraling=0,this._kickstart=!0,this.fpsProblemNotifier=new o.Signal,this.forceSingleUpdate=!0,this._nextFpsNotification=0,1===arguments.length&&"object"==typeof arguments[0]?this.parseConfig(arguments[0]):(this.config={enableDebug:!0},void 0!==t&&(this._width=t),void 0!==e&&(this._height=e),void 0!==i&&(this.renderType=i),void 0!==s&&(this.parent=s),void 0!==a&&(this.transparent=a),void 0!==r&&(this.antialias=r),this.rnd=new o.RandomDataGenerator([(Date.now()*Math.random()).toString()]),this.state=new o.StateManager(this,n)),this.device.whenReady(this.boot,this),this},o.Game.prototype={parseConfig:function(t){this.config=t,void 0===t.enableDebug&&(this.config.enableDebug=!0),t.width&&(this._width=t.width),t.height&&(this._height=t.height),t.renderer&&(this.renderType=t.renderer),t.parent&&(this.parent=t.parent),void 0!==t.transparent&&(this.transparent=t.transparent),void 0!==t.antialias&&(this.antialias=t.antialias),t.resolution&&(this.resolution=t.resolution),void 0!==t.preserveDrawingBuffer&&(this.preserveDrawingBuffer=t.preserveDrawingBuffer),t.physicsConfig&&(this.physicsConfig=t.physicsConfig);var e=[(Date.now()*Math.random()).toString()];t.seed&&(e=t.seed),this.rnd=new o.RandomDataGenerator(e);var i=null;t.state&&(i=t.state),this.state=new o.StateManager(this,i)},boot:function(){this.isBooted||(this.onPause=new o.Signal,this.onResume=new o.Signal,this.onBlur=new o.Signal,this.onFocus=new o.Signal,this.isBooted=!0,PIXI.game=this,this.math=o.Math,this.scale=new o.ScaleManager(this,this._width,this._height),this.stage=new o.Stage(this),this.setUpRenderer(),this.world=new o.World(this),this.add=new o.GameObjectFactory(this),this.make=new o.GameObjectCreator(this),this.cache=new o.Cache(this),this.load=new o.Loader(this),this.time=new o.Time(this),this.tweens=new o.TweenManager(this),this.input=new o.Input(this),this.sound=new o.SoundManager(this),this.physics=new o.Physics(this,this.physicsConfig),this.particles=new o.Particles(this),this.create=new o.Create(this),this.plugins=new o.PluginManager(this),this.net=new o.Net(this),this.time.boot(),this.stage.boot(),this.world.boot(),this.scale.boot(),this.input.boot(),this.sound.boot(),this.state.boot(),this.config.enableDebug?(this.debug=new o.Utils.Debug(this),this.debug.boot()):this.debug={preUpdate:function(){},update:function(){},reset:function(){}},this.showDebugHeader(),this.isRunning=!0,this.config&&this.config.forceSetTimeOut?this.raf=new o.RequestAnimationFrame(this,this.config.forceSetTimeOut):this.raf=new o.RequestAnimationFrame(this,!1),this._kickstart=!0,window.focus&&(!window.PhaserGlobal||window.PhaserGlobal&&!window.PhaserGlobal.stopFocus)&&window.focus(),this.raf.start())},showDebugHeader:function(){if(!window.PhaserGlobal||!window.PhaserGlobal.hideBanner){var t=o.VERSION,e="Canvas",i="HTML Audio",s=1;if(this.renderType===o.WEBGL?(e="WebGL",s++):this.renderType===o.HEADLESS&&(e="Headless"),this.device.webAudio&&(i="WebAudio",s++),this.device.chrome)for(var n=["%c %c %c @orange-games/phaser v"+t+" | Pixi.js | "+e+" | "+i+"
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Input=function(t){this.game=t,this.hitCanvas=null,this.hitContext=null,this.moveCallbacks=[],this.customCandidateHandler=null,this.customCandidateHandlerContext=null,this.pollRate=0,this.enabled=!0,this.multiInputOverride=o.Input.MOUSE_TOUCH_COMBINE,this.position=null,this.speed=null,this.circle=null,this.scale=null,this.maxPointers=-1,this.tapRate=200,this.doubleTapRate=300,this.holdRate=2e3,this.justPressedRate=200,this.justReleasedRate=200,this.recordPointerHistory=!1,this.recordRate=100,this.recordLimit=100,this.pointer1=null,this.pointer2=null,this.pointer3=null,this.pointer4=null,this.pointer5=null,this.pointer6=null,this.pointer7=null,this.pointer8=null,this.pointer9=null,this.pointer10=null,this.pointers=[],this.activePointer=null,this.mousePointer=null,this.mouse=null,this.keyboard=null,this.touch=null,this.mspointer=null,this.gamepad=null,this.resetLocked=!1,this.onDown=null,this.onUp=null,this.onTap=null,this.onHold=null,this.minPriorityID=0,this.interactiveItems=new o.ArraySet,this._localPoint=new o.Point,this._pollCounter=0,this._oldPosition=null,this._x=0,this._y=0},o.Input.MOUSE_OVERRIDES_TOUCH=0,o.Input.TOUCH_OVERRIDES_MOUSE=1,o.Input.MOUSE_TOUCH_COMBINE=2,o.Input.MAX_POINTERS=10,o.Input.prototype={boot:function(){this.mousePointer=new o.Pointer(this.game,0,o.PointerMode.CURSOR),this.addPointer(),this.addPointer(),this.mouse=new o.Mouse(this.game),this.touch=new o.Touch(this.game),this.mspointer=new o.MSPointer(this.game),o.Keyboard&&(this.keyboard=new o.Keyboard(this.game)),o.Gamepad&&(this.gamepad=new o.Gamepad(this.game)),this.onDown=new o.Signal,this.onUp=new o.Signal,this.onTap=new o.Signal,this.onHold=new o.Signal,this.scale=new o.Point(1,1),this.speed=new o.Point,this.position=new o.Point,this._oldPosition=new o.Point,this.circle=new o.Circle(0,0,44),this.activePointer=this.mousePointer,this.hitCanvas=PIXI.CanvasPool.create(this,1,1),this.hitContext=this.hitCanvas.getContext("2d"),this.mouse.start(),this.touch.start(),this.mspointer.start(),this.mousePointer.active=!0,this.keyboard&&this.keyboard.start();var t=this;this._onClickTrampoline=function(e){t.onClickTrampoline(e)},this.game.canvas.addEventListener("click",this._onClickTrampoline,!1)},destroy:function(){this.mouse.stop(),this.touch.stop(),this.mspointer.stop(),this.keyboard&&this.keyboard.stop(),this.gamepad&&this.gamepad.stop(),this.moveCallbacks=[],PIXI.CanvasPool.remove(this),this.game.canvas.removeEventListener("click",this._onClickTrampoline)},setInteractiveCandidateHandler:function(t,e){this.customCandidateHandler=t,this.customCandidateHandlerContext=e},addMoveCallback:function(t,e){this.moveCallbacks.push({callback:t,context:e})},deleteMoveCallback:function(t,e){for(var i=this.moveCallbacks.length;i--;)if(this.moveCallbacks[i].callback===t&&this.moveCallbacks[i].context===e)return void this.moveCallbacks.splice(i,1)},addPointer:function(){if(this.pointers.length>=o.Input.MAX_POINTERS)return null;var t=this.pointers.length+1,e=new o.Pointer(this.game,t,o.PointerMode.TOUCH);return this.pointers.push(e),this["pointer"+t]=e,e},update:function(){if(this.keyboard&&this.keyboard.update(),this.pollRate>0&&this._pollCounter<this.pollRate)return void this._pollCounter++;this.speed.x=this.position.x-this._oldPosition.x,this.speed.y=this.position.y-this._oldPosition.y,this._oldPosition.copyFrom(this.position),this.mousePointer.update(),this.gamepad&&this.gamepad.active&&this.gamepad.update();for(var t=0;t<this.pointers.length;t++)this.pointers[t].update();this._pollCounter=0},reset:function(t){if(this.game.isBooted&&!this.resetLocked){void 0===t&&(t=!1),this.mousePointer.reset(),this.keyboard&&this.keyboard.reset(t),this.gamepad&&this.gamepad.reset();for(var e=0;e<this.pointers.length;e++)this.pointers[e].reset();"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),t&&(this.onDown.dispose(),this.onUp.dispose(),this.onTap.dispose(),this.onHold.dispose(),this.onDown=new o.Signal,this.onUp=new o.Signal,this.onTap=new o.Signal,this.onHold=new o.Signal,this.moveCallbacks=[]),this._pollCounter=0}},resetSpeed:function(t
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Mouse=function(t){this.game=t,this.input=t.input,this.callbackContext=this.game,this.mouseDownCallback=null,this.mouseUpCallback=null,this.mouseOutCallback=null,this.mouseOverCallback=null,this.mouseWheelCallback=null,this.capture=!1,this.button=-1,this.wheelDelta=0,this.enabled=!0,this.locked=!1,this.stopOnGameOut=!1,this.pointerLock=new o.Signal,this.event=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null,this._onMouseOut=null,this._onMouseOver=null,this._onMouseWheel=null,this._wheelEvent=null},o.Mouse.NO_BUTTON=-1,o.Mouse.LEFT_BUTTON=0,o.Mouse.MIDDLE_BUTTON=1,o.Mouse.RIGHT_BUTTON=2,o.Mouse.BACK_BUTTON=3,o.Mouse.FORWARD_BUTTON=4,o.Mouse.WHEEL_UP=1,o.Mouse.WHEEL_DOWN=-1,o.Mouse.prototype={start:function(){if((!this.game.device.android||!1!==this.game.device.chrome)&&null===this._onMouseDown){var t=this;this._onMouseDown=function(e){return t.onMouseDown(e)},this._onMouseMove=function(e){return t.onMouseMove(e)},this._onMouseUp=function(e){return t.onMouseUp(e)},this._onMouseUpGlobal=function(e){return t.onMouseUpGlobal(e)},this._onMouseOutGlobal=function(e){return t.onMouseOutGlobal(e)},this._onMouseOut=function(e){return t.onMouseOut(e)},this._onMouseOver=function(e){return t.onMouseOver(e)},this._onMouseWheel=function(e){return t.onMouseWheel(e)};var e=this.game.canvas;e.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("mousemove",this._onMouseMove,!0),e.addEventListener("mouseup",this._onMouseUp,!0),this.game.device.cocoonJS||(window.addEventListener("mouseup",this._onMouseUpGlobal,!0),window.addEventListener("mouseout",this._onMouseOutGlobal,!0),e.addEventListener("mouseover",this._onMouseOver,!0),e.addEventListener("mouseout",this._onMouseOut,!0));var i=this.game.device.wheelEvent;i&&(e.addEventListener(i,this._onMouseWheel,!0),"mousewheel"===i?this._wheelEvent=new s(-.025,1):"DOMMouseScroll"===i&&(this._wheelEvent=new s(1,1)))}},onMouseDown:function(t){this.event=t,this.capture&&t.preventDefault(),this.mouseDownCallback&&this.mouseDownCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=0,this.input.mousePointer.start(t))},onMouseMove:function(t){this.event=t,this.capture&&t.preventDefault(),this.mouseMoveCallback&&this.mouseMoveCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=0,this.input.mousePointer.move(t))},onMouseUp:function(t){this.event=t,this.capture&&t.preventDefault(),this.mouseUpCallback&&this.mouseUpCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=0,this.input.mousePointer.stop(t))},onMouseUpGlobal:function(t){this.input.mousePointer.withinGame||(this.mouseUpCallback&&this.mouseUpCallback.call(this.callbackContext,t),t.identifier=0,this.input.mousePointer.stop(t))},onMouseOutGlobal:function(t){this.event=t,this.capture&&t.preventDefault(),this.input.mousePointer.withinGame=!1,this.input.enabled&&this.enabled&&(this.input.mousePointer.stop(t),this.input.mousePointer.leftButton.stop(t),this.input.mousePointer.rightButton.stop(t))},onMouseOut:function(t){this.event=t,this.capture&&t.preventDefault(),this.input.mousePointer.withinGame=!1,this.mouseOutCallback&&this.mouseOutCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&this.stopOnGameOut&&(t.identifier=0,this.input.mousePointer.stop(t))},onMouseOver:function(t){this.event=t,this.capture&&t.preventDefault(),this.input.mousePointer.withinGame=!0,this.mouseOverCallback&&this.mouseOverCallback.call(this.callbackContext,t)},onMouseWheel:function(t){this._wheelEvent&&(t=this._wheelEvent.bindEvent(t)),this.event=t,this.capture&&t.preventDefault(),this.wheelDelta=o.Math.clamp(-t.deltaY,-1,1),this.mouseWheelCallback&&this.mouseWheelCallback.call(this.callbackContext,t)},requestPointerLock:function(){if(this.game.device.pointerLock){var t=this.game.canvas;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock();var e=this;this._pointerLockChange=function(t){return e.pointerLockChange(t)},document.addEventListener("pointerlockchang
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.MSPointer=function(t){this.game=t,this.input=t.input,this.callbackContext=this.game,this.pointerDownCallback=null,this.pointerMoveCallback=null,this.pointerUpCallback=null,this.capture=!0,this.button=-1,this.event=null,this.enabled=!0,this._onMSPointerDown=null,this._onMSPointerMove=null,this._onMSPointerUp=null,this._onMSPointerUpGlobal=null,this._onMSPointerOut=null,this._onMSPointerOver=null},o.MSPointer.prototype={start:function(){if(null===this._onMSPointerDown){var t=this;if(this.game.device.mspointer){this._onMSPointerDown=function(e){return t.onPointerDown(e)},this._onMSPointerMove=function(e){return t.onPointerMove(e)},this._onMSPointerUp=function(e){return t.onPointerUp(e)},this._onMSPointerUpGlobal=function(e){return t.onPointerUpGlobal(e)},this._onMSPointerOut=function(e){return t.onPointerOut(e)},this._onMSPointerOver=function(e){return t.onPointerOver(e)};var e=this.game.canvas;e.addEventListener("MSPointerDown",this._onMSPointerDown,!1),e.addEventListener("MSPointerMove",this._onMSPointerMove,!1),e.addEventListener("MSPointerUp",this._onMSPointerUp,!1),e.addEventListener("pointerdown",this._onMSPointerDown,!1),e.addEventListener("pointermove",this._onMSPointerMove,!1),e.addEventListener("pointerup",this._onMSPointerUp,!1),e.style["-ms-content-zooming"]="none",e.style["-ms-touch-action"]="none",this.game.device.cocoonJS||(window.addEventListener("MSPointerUp",this._onMSPointerUpGlobal,!0),e.addEventListener("MSPointerOver",this._onMSPointerOver,!0),e.addEventListener("MSPointerOut",this._onMSPointerOut,!0),window.addEventListener("pointerup",this._onMSPointerUpGlobal,!0),e.addEventListener("pointerover",this._onMSPointerOver,!0),e.addEventListener("pointerout",this._onMSPointerOut,!0))}}},onPointerDown:function(t){this.event=t,this.capture&&t.preventDefault(),this.pointerDownCallback&&this.pointerDownCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=t.pointerId,"mouse"===t.pointerType||4===t.pointerType?this.input.mousePointer.start(t):this.input.startPointer(t))},onPointerMove:function(t){this.event=t,this.capture&&t.preventDefault(),this.pointerMoveCallback&&this.pointerMoveCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=t.pointerId,"mouse"===t.pointerType||4===t.pointerType?this.input.mousePointer.move(t):this.input.updatePointer(t))},onPointerUp:function(t){this.event=t,this.capture&&t.preventDefault(),this.pointerUpCallback&&this.pointerUpCallback.call(this.callbackContext,t),this.input.enabled&&this.enabled&&(t.identifier=t.pointerId,"mouse"===t.pointerType||4===t.pointerType?this.input.mousePointer.stop(t):this.input.stopPointer(t))},onPointerUpGlobal:function(t){if("mouse"!==t.pointerType&&4!==t.pointerType||this.input.mousePointer.withinGame){var e=this.input.getPointerFromIdentifier(t.identifier);e&&e.withinGame&&this.onPointerUp(t)}else this.onPointerUp(t)},onPointerOut:function(t){if(this.event=t,this.capture&&t.preventDefault(),"mouse"===t.pointerType||4===t.pointerType)this.input.mousePointer.withinGame=!1;else{var e=this.input.getPointerFromIdentifier(t.identifier);e&&(e.withinGame=!1)}this.input.mouse.mouseOutCallback&&this.input.mouse.mouseOutCallback.call(this.input.mouse.callbackContext,t),this.input.enabled&&this.enabled&&this.input.mouse.stopOnGameOut&&(t.identifier=0,e?e.stop(t):this.input.mousePointer.stop(t))},onPointerOver:function(t){if(this.event=t,this.capture&&t.preventDefault(),"mouse"===t.pointerType||4===t.pointerType)this.input.mousePointer.withinGame=!0;else{var e=this.input.getPointerFromIdentifier(t.identifier);e&&(e.withinGame=!0)}this.input.mouse.mouseOverCallback&&this.input.mouse.mouseOverCallback.call(this.input.mouse.callbackContext,t)},stop:function(){var t=this.game.canvas;t.removeEventListener("MSPointerDown",this._onMSPointerDown,!1),t.removeEventListener("MSPointerMove",this._onMSPointerMove,!1),t.removeEventListener("MSPointerUp",this._onMSPointerUp,!1),t.removeEventListener("pointerdown",this._onMSPointerDown,!1),t.removeEventListener("pointermove",this._onMSPointerMove,!1),t.removeE
* @author Richard Davey <rich@photonstorm.com>
* @author @karlmacklin <tacklemcclean@gmail.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.DeviceButton=function(t,e){this.parent=t,this.game=t.game,this.event=null,this.isDown=!1,this.isUp=!0,this.timeDown=0,this.timeUp=0,this.repeats=0,this.altKey=!1,this.shiftKey=!1,this.ctrlKey=!1,this.value=0,this.buttonCode=e,this.onDown=new o.Signal,this.onUp=new o.Signal,this.onFloat=new o.Signal},o.DeviceButton.prototype={start:function(t,e){this.isDown||(this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.time,this.repeats=0,this.event=t,this.value=e,t&&(this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.ctrlKey=t.ctrlKey),this.onDown.dispatch(this,e))},stop:function(t,e){this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.time,this.event=t,this.value=e,t&&(this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.ctrlKey=t.ctrlKey),this.onUp.dispatch(this,e))},padFloat:function(t){this.value=t,this.onFloat.dispatch(this,t)},justPressed:function(t){return t=t||250,this.isDown&&this.timeDown+t>this.game.time.time},justReleased:function(t){return t=t||250,this.isUp&&this.timeUp+t>this.game.time.time},reset:function(){this.isDown=!1,this.isUp=!0,this.timeDown=this.game.time.time,this.repeats=0,this.altKey=!1,this.shiftKey=!1,this.ctrlKey=!1},destroy:function(){this.onDown.dispose(),this.onUp.dispose(),this.onFloat.dispose(),this.parent=null,this.game=null}},o.DeviceButton.prototype.constructor=o.DeviceButton,Object.defineProperty(o.DeviceButton.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.time-this.timeDown}}),/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Pointer=function(t,e,i){this.game=t,this.id=e,this.type=o.POINTER,this.exists=!0,this.identifier=0,this.pointerId=null,this.pointerMode=i||o.PointerMode.CURSOR|o.PointerMode.CONTACT,this.target=null,this.button=null,this.leftButton=new o.DeviceButton(this,o.Pointer.LEFT_BUTTON),this.middleButton=new o.DeviceButton(this,o.Pointer.MIDDLE_BUTTON),this.rightButton=new o.DeviceButton(this,o.Pointer.RIGHT_BUTTON),this.backButton=new o.DeviceButton(this,o.Pointer.BACK_BUTTON),this.forwardButton=new o.DeviceButton(this,o.Pointer.FORWARD_BUTTON),this.eraserButton=new o.DeviceButton(this,o.Pointer.ERASER_BUTTON),this._holdSent=!1,this._history=[],this._nextDrop=0,this._stateReset=!1,this.withinGame=!1,this.clientX=-1,this.clientY=-1,this.pageX=-1,this.pageY=-1,this.screenX=-1,this.screenY=-1,this.rawMovementX=0,this.rawMovementY=0,this.movementX=0,this.movementY=0,this.x=-1,this.y=-1,this.isMouse=0===e,this.isDown=!1,this.isUp=!0,this.timeDown=0,this.timeUp=0,this.previousTapTime=0,this.totalTouches=0,this.msSinceLastClick=Number.MAX_VALUE,this.targetObject=null,this.interactiveCandidates=[],this.active=!1,this.dirty=!1,this.position=new o.Point,this.positionDown=new o.Point,this.positionUp=new o.Point,this.circle=new o.Circle(0,0,44),this._clickTrampolines=null,this._trampolineTargetObject=null},o.Pointer.NO_BUTTON=0,o.Pointer.LEFT_BUTTON=1,o.Pointer.RIGHT_BUTTON=2,o.Pointer.MIDDLE_BUTTON=4,o.Pointer.BACK_BUTTON=8,o.Pointer.FORWARD_BUTTON=16,o.Pointer.ERASER_BUTTON=32,o.Pointer.prototype={resetButtons:function(){this.isDown=!1,this.isUp=!0,this.isMouse&&(this.leftButton.reset(),this.middleButton.reset(),this.rightButton.reset(),this.backButton.reset(),this.forwardButton.reset(),this.eraserButton.reset())},processButtonsDown:function(t,e){o.Pointer.LEFT_BUTTON&t&&this.leftButton.start(e),o.Pointer.RIGHT_BUTTON&t&&this.rightButton.start(e),o.Pointer.MIDDLE_BUTTON&t&&this.middleButton.start(e),o.Pointer.BACK_BUTTON&t&&this.backButton.start(e),o.Pointer.FORWARD_BUTTON&t&&this.forwardButton.start(e),o.Pointer.ERASER_BUTTON&t&&this.eraserButton.start(e)},processButtonsUp:function(t,e){t===o.Mouse.LEFT_BUTTON&&this.leftButton.stop(e),t===o.Mouse.RIGHT_BUTTON&&this.rightButton.stop(e),t===o.Mouse.MIDDLE_BUTTON&&this.middleButton.stop(e),t===o.Mouse.BACK_BUTTON&&this.backButton.stop(e),t===o.Mouse.FORWARD_BUTTON&&this.forwardButton.stop(e),5===t&&this.eraserButton.stop(e)},updateButtons:function(t){this.button=t.button;var e="down"===t.type.toLowerCase().substr(-4);void 0!==t.buttons?e?this.processButtonsDown(t.buttons,t):this.processButtonsUp(t.button,t):e?this.leftButton.start(t):(this.leftButton.stop(t),this.rightButton.stop(t)),1===t.buttons&&t.ctrlKey&&this.leftButton.isDown&&(this.leftButton.stop(t),this.rightButton.start(t)),this.isUp=!0,this.isDown=!1,(this.leftButton.isDown||this.rightButton.isDown||this.middleButton.isDown||this.backButton.isDown||this.forwardButton.isDown||this.eraserButton.isDown)&&(this.isUp=!1,this.isDown=!0)},start:function(t){var e=this.game.input;return t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.isMouse?this.updateButtons(t):(this.isDown=!0,this.isUp=!1),this.active=!0,this.withinGame=!0,this.dirty=!1,this._history=[],this._clickTrampolines=null,this._trampolineTargetObject=null,this.msSinceLastClick=this.game.time.time-this.timeDown,this.timeDown=this.game.time.time,this._holdSent=!1,this.move(t,!0),this.positionDown.setTo(this.x,this.y),(e.multiInputOverride===o.Input.MOUSE_OVERRIDES_TOUCH||e.multiInputOverride===o.Input.MOUSE_TOUCH_COMBINE||e.multiInputOverride===o.Input.TOUCH_OVERRIDES_MOUSE&&0===e.totalActivePointers)&&(e.x=this.x,e.y=this.y,e.position.setTo(this.x,this.y),e.onDown.dispatch(this,t),e.resetSpeed(this.x,this.y)),this._stateReset=!1,this.totalTouches++,null!==this.targetObject&&this.targetObject._touchedHandler(this),this},update:function(){var t=this.game.input;this.active&&(this.dirty&&(t.interactiveItems.total>0&&this.processInteractiveObjects(!1),this.dirty=!1),!1===this._holdSent&&this.duration>=t.holdRate&&((t.multiInputOver
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Touch=function(t){this.game=t,this.enabled=!0,this.touchLockCallbacks=[],this.callbackContext=this.game,this.touchStartCallback=null,this.touchMoveCallback=null,this.touchEndCallback=null,this.touchEnterCallback=null,this.touchLeaveCallback=null,this.touchCancelCallback=null,this.preventDefault=!0,this.event=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null,this._onTouchEnter=null,this._onTouchLeave=null,this._onTouchCancel=null,this._onTouchMove=null},o.Touch.prototype={start:function(){if(null===this._onTouchStart){var t=this;this.game.device.touch&&(this._onTouchStart=function(e){return t.onTouchStart(e)},this._onTouchMove=function(e){return t.onTouchMove(e)},this._onTouchEnd=function(e){return t.onTouchEnd(e)},this._onTouchEnter=function(e){return t.onTouchEnter(e)},this._onTouchLeave=function(e){return t.onTouchLeave(e)},this._onTouchCancel=function(e){return t.onTouchCancel(e)},this.game.canvas.addEventListener("touchstart",this._onTouchStart,!1),this.game.canvas.addEventListener("touchmove",this._onTouchMove,!1),this.game.canvas.addEventListener("touchend",this._onTouchEnd,!1),this.game.canvas.addEventListener("touchcancel",this._onTouchCancel,!1),this.game.device.cocoonJS||(this.game.canvas.addEventListener("touchenter",this._onTouchEnter,!1),this.game.canvas.addEventListener("touchleave",this._onTouchLeave,!1)))}},consumeDocumentTouches:function(){this._documentTouchMove=function(t){t.preventDefault()},document.addEventListener("touchmove",this._documentTouchMove,!1)},addTouchLockCallback:function(t,e,i){void 0===i&&(i=!1),this.touchLockCallbacks.push({callback:t,context:e,onEnd:i})},removeTouchLockCallback:function(t,e){for(var i=this.touchLockCallbacks.length;i--;)if(this.touchLockCallbacks[i].callback===t&&this.touchLockCallbacks[i].context===e)return this.touchLockCallbacks.splice(i,1),!0;return!1},onTouchStart:function(t){for(var e=this.touchLockCallbacks.length;e--;){var i=this.touchLockCallbacks[e];!i.onEnd&&i.callback.call(i.context,this,t)&&this.touchLockCallbacks.splice(e,1)}if(this.event=t,this.game.input.enabled&&this.enabled){this.touchStartCallback&&this.touchStartCallback.call(this.callbackContext,t),this.preventDefault&&t.preventDefault();for(var e=0;e<t.changedTouches.length;e++)this.game.input.startPointer(t.changedTouches[e])}},onTouchCancel:function(t){if(this.event=t,this.touchCancelCallback&&this.touchCancelCallback.call(this.callbackContext,t),this.game.input.enabled&&this.enabled){this.preventDefault&&t.preventDefault();for(var e=0;e<t.changedTouches.length;e++)this.game.input.stopPointer(t.changedTouches[e])}},onTouchEnter:function(t){this.event=t,this.touchEnterCallback&&this.touchEnterCallback.call(this.callbackContext,t),this.game.input.enabled&&this.enabled&&this.preventDefault&&t.preventDefault()},onTouchLeave:function(t){this.event=t,this.touchLeaveCallback&&this.touchLeaveCallback.call(this.callbackContext,t),this.preventDefault&&t.preventDefault()},onTouchMove:function(t){this.event=t,this.touchMoveCallback&&this.touchMoveCallback.call(this.callbackContext,t),this.preventDefault&&t.preventDefault();for(var e=0;e<t.changedTouches.length;e++)this.game.input.updatePointer(t.changedTouches[e])},onTouchEnd:function(t){for(var e=this.touchLockCallbacks.length;e--;){var i=this.touchLockCallbacks[e];i.onEnd&&i.callback.call(i.context,this,t)&&this.touchLockCallbacks.splice(e,1)}this.event=t,this.touchEndCallback&&this.touchEndCallback.call(this.callbackContext,t),this.preventDefault&&t.preventDefault();for(var e=0;e<t.changedTouches.length;e++)this.game.input.stopPointer(t.changedTouches[e])},stop:function(){this.game.device.touch&&(this.game.canvas.removeEventListener("touchstart",this._onTouchStart),this.game.canvas.removeEventListener("touchmove",this._onTouchMove),this.game.canvas.removeEventListener("touchend",this._onTouchEnd),this.game.canvas.removeEventListener("touchenter",this._onTouchEnter),this.game.canvas.removeEventListener("touchleave",this._onTouchLeave),this.game.canvas.removeEventListener("touchcancel",this._onTouchCancel))}},o.Touch.prototype
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.InputHandler=function(t){this.sprite=t,this.game=t.game,this.enabled=!1,this.checked=!1,this.priorityID=0,this.useHandCursor=!1,this._setHandCursor=!1,this.isDragged=!1,this.allowHorizontalDrag=!0,this.allowVerticalDrag=!0,this.bringToTop=!1,this.snapOffset=null,this.snapOnDrag=!1,this.snapOnRelease=!1,this.snapX=0,this.snapY=0,this.snapOffsetX=0,this.snapOffsetY=0,this.pixelPerfectOver=!1,this.pixelPerfectClick=!1,this.pixelPerfectAlpha=255,this.draggable=!1,this.boundsRect=null,this.boundsSprite=null,this.scaleLayer=!1,this.dragOffset=new o.Point,this.dragFromCenter=!1,this.dragStopBlocksInputUp=!1,this.dragStartPoint=new o.Point,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this.downPoint=new o.Point,this.snapPoint=new o.Point,this._dragPoint=new o.Point,this._dragPhase=!1,this._pendingDrag=!1,this._dragTimePass=!1,this._dragDistancePass=!1,this._wasEnabled=!1,this._tempPoint=new o.Point,this._pointerData=[],this._pointerData.push({id:0,x:0,y:0,camX:0,camY:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1})},o.InputHandler.prototype={start:function(t,e){if(t=t||0,void 0===e&&(e=!1),!1===this.enabled){this.game.input.interactiveItems.add(this),this.useHandCursor=e,this.priorityID=t;for(var i=0;i<10;i++)this._pointerData[i]={id:i,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1};this.snapOffset=new o.Point,this.enabled=!0,this._wasEnabled=!0}return this.sprite.events.onAddedToGroup.add(this.addedToGroup,this),this.sprite.events.onRemovedFromGroup.add(this.removedFromGroup,this),this.sprite},addedToGroup:function(){this._dragPhase||this._wasEnabled&&!this.enabled&&this.start()},removedFromGroup:function(){this._dragPhase||(this.enabled?(this._wasEnabled=!0,this.stop()):this._wasEnabled=!1)},reset:function(){this.enabled=!1;for(var t=0;t<10;t++)this._pointerData[t]={id:t,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1}},stop:function(){!1!==this.enabled&&(this.enabled=!1,this.game.input.interactiveItems.remove(this))},destroy:function(){this.sprite&&(this._setHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),this.enabled=!1,this.game.input.interactiveItems.remove(this),this._pointerData.length=0,this.boundsRect=null,this.boundsSprite=null,this.sprite=null)},validForInput:function(t,e,i){return void 0===i&&(i=!0),!(!this.enabled||0===this.sprite.scale.x||0===this.sprite.scale.y||this.priorityID<this.game.input.minPriorityID||this.sprite.parent&&this.sprite.parent.ignoreChildInput)&&(!(!i&&(this.pixelPerfectClick||this.pixelPerfectOver))&&(this.priorityID>t||this.priorityID===t&&this.sprite.renderOrderID>e))},isPixelPerfect:function(){return this.pixelPerfectClick||this.pixelPerfectOver},pointerX:function(t){return t=t||0,this._pointerData[t].x},pointerY:function(t){return t=t||0,this._pointerData[t].y},pointerDown:function(t){return t=t||0,this._pointerData[t].isDown},pointerUp:function(t){return t=t||0,this._pointerData[t].isUp},pointerTimeDown:function(t){return t=t||0,this._pointerData[t].timeDown},pointerTimeUp:function(t){return t=t||0,this._pointerData[t].timeUp},pointerOver:function(t){if(!this.enabled)return!1;if(void 0===t){for(var e=0;e<10;e++)if(this._pointerData[e].isOver)return!0;return!1}return this._pointerData[t].isOver},pointerOut:function(t){if(!this.enabled)return!1;if(void 0!==t)return this._pointerData[t].isOut;for(var e=0;e<10;e++)if(this._pointerData[e].isOut)return!0},pointerTimeOver:function(t){return t=t||0,this._pointerData[t].timeOver},pointerTimeOut:function(t){return t=t||0,this._pointerData[t].timeOut},pointerDragged:function(t){return t=t||0,this._pointerData[t].isDragged},checkPointerDown:function(t,e){return!!(t.isDown&&this.enabled&&this.sprite&&this.sprite.parent&&this.sprite.visible&&this.sprite.parent.visible&&0!==this.sprite.worldScale.x&&0!==this.sprite.worldScale.y)&&(!!this.game.input.hitTest(this.sprite,t,this._tempPoint)&&(void 0===e&&(e=!1),!(!e&&this.pixe
* @author @karlmacklin <tacklemcclean@gmail.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Gamepad=function(t){this.game=t,this._gamepadIndexMap={},this._rawPads=[],this._active=!1,this.enabled=!0,this._gamepadSupportAvailable=!!navigator.webkitGetGamepads||!!navigator.webkitGamepads||-1!==navigator.userAgent.indexOf("Firefox/")||!!navigator.getGamepads,this._prevRawGamepadTypes=[],this._prevTimestamps=[],this.callbackContext=this,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null,this._ongamepadconnected=null,this._gamepaddisconnected=null,this._gamepads=[new o.SinglePad(t,this),new o.SinglePad(t,this),new o.SinglePad(t,this),new o.SinglePad(t,this)]},o.Gamepad.prototype={addCallbacks:function(t,e){void 0!==e&&(this.onConnectCallback="function"==typeof e.onConnect?e.onConnect:this.onConnectCallback,this.onDisconnectCallback="function"==typeof e.onDisconnect?e.onDisconnect:this.onDisconnectCallback,this.onDownCallback="function"==typeof e.onDown?e.onDown:this.onDownCallback,this.onUpCallback="function"==typeof e.onUp?e.onUp:this.onUpCallback,this.onAxisCallback="function"==typeof e.onAxis?e.onAxis:this.onAxisCallback,this.onFloatCallback="function"==typeof e.onFloat?e.onFloat:this.onFloatCallback,this.callbackContext=t)},start:function(){if(!this._active){this._active=!0;var t=this;this._onGamepadConnected=function(e){return t.onGamepadConnected(e)},this._onGamepadDisconnected=function(e){return t.onGamepadDisconnected(e)},window.addEventListener("gamepadconnected",this._onGamepadConnected,!1),window.addEventListener("gamepaddisconnected",this._onGamepadDisconnected,!1)}},onGamepadConnected:function(t){var e=t.gamepad;this._rawPads.push(e),this._gamepads[e.index].connect(e)},onGamepadDisconnected:function(t){var e=t.gamepad;for(var i in this._rawPads)this._rawPads[i].index===e.index&&this._rawPads.splice(i,1);this._gamepads[e.index].disconnect()},update:function(){this._pollGamepads(),this.pad1.pollStatus(),this.pad2.pollStatus(),this.pad3.pollStatus(),this.pad4.pollStatus()},_pollGamepads:function(){if(this._active){if(navigator.getGamepads)var t=navigator.getGamepads();else if(navigator.webkitGetGamepads)var t=navigator.webkitGetGamepads();else if(navigator.webkitGamepads)var t=navigator.webkitGamepads();if(t){this._rawPads=[];for(var e=!1,i=0;i<t.length&&(typeof t[i]!==this._prevRawGamepadTypes[i]&&(e=!0,this._prevRawGamepadTypes[i]=typeof t[i]),t[i]&&this._rawPads.push(t[i]),3!==i);i++);for(var s=0;s<this._gamepads.length;s++)this._gamepads[s]._rawPad=this._rawPads[s];if(e){for(var n={rawIndices:{},padIndices:{}},o,a=0;a<this._gamepads.length;a++)if(o=this._gamepads[a],o.connected)for(var r=0;r<this._rawPads.length;r++)this._rawPads[r].index===o.index&&(n.rawIndices[o.index]=!0,n.padIndices[a]=!0);for(var h=0;h<this._gamepads.length;h++)if(o=this._gamepads[h],!n.padIndices[h]){this._rawPads.length<1&&o.disconnect();for(var l=0;l<this._rawPads.length&&!n.padIndices[h];l++){var c=this._rawPads[l];if(c){if(n.rawIndices[c.index]){o.disconnect();continue}o.connect(c),n.rawIndices[c.index]=!0,n.padIndices[h]=!0}else o.disconnect()}}}}}},setDeadZones:function(t){for(var e=0;e<this._gamepads.length;e++)this._gamepads[e].deadZone=t},stop:function(){this._active=!1,window.removeEventListener("gamepadconnected",this._onGamepadConnected),window.removeEventListener("gamepaddisconnected",this._onGamepadDisconnected)},reset:function(){this.update();for(var t=0;t<this._gamepads.length;t++)this._gamepads[t].reset()},justPressed:function(t,e){for(var i=0;i<this._gamepads.length;i++)if(!0===this._gamepads[i].justPressed(t,e))return!0;return!1},justReleased:function(t,e){for(var i=0;i<this._gamepads.length;i++)if(!0===this._gamepads[i].justReleased(t,e))return!0;return!1},isDown:function(t){for(var e=0;e<this._gamepads.length;e++)if(!0===this._gamepads[e].isDown(t))return!0;return!1},destroy:function(){this.stop();for(var t=0;t<this._gamepads.length;t++)this._gamepads[t].destroy()}},o.Gamepad.prototype.constructor=o.Gamepad,Object.defineProperty(o.Gamepad.prototype,"active",{get:function(){return this._active}}),Objec
* @author @karlmacklin <tacklemcclean@gmail.com>
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.SinglePad=function(t,e){this.game=t,this.index=null,this.connected=!1,this.callbackContext=this,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null,this.deadZone=.26,this._padParent=e,this._rawPad=null,this._prevTimestamp=null,this._buttons=[],this._buttonsLen=0,this._axes=[],this._axesLen=0},o.SinglePad.prototype={addCallbacks:function(t,e){void 0!==e&&(this.onConnectCallback="function"==typeof e.onConnect?e.onConnect:this.onConnectCallback,this.onDisconnectCallback="function"==typeof e.onDisconnect?e.onDisconnect:this.onDisconnectCallback,this.onDownCallback="function"==typeof e.onDown?e.onDown:this.onDownCallback,this.onUpCallback="function"==typeof e.onUp?e.onUp:this.onUpCallback,this.onAxisCallback="function"==typeof e.onAxis?e.onAxis:this.onAxisCallback,this.onFloatCallback="function"==typeof e.onFloat?e.onFloat:this.onFloatCallback,this.callbackContext=t)},getButton:function(t){return this._buttons[t]?this._buttons[t]:null},pollStatus:function(){if(this.connected&&this.game.input.enabled&&this.game.input.gamepad.enabled&&(!this._rawPad.timestamp||this._rawPad.timestamp!==this._prevTimestamp)){for(var t=0;t<this._buttonsLen;t++){var e=isNaN(this._rawPad.buttons[t])?this._rawPad.buttons[t].value:this._rawPad.buttons[t];e!==this._buttons[t].value&&(1===e?this.processButtonDown(t,e):0===e?this.processButtonUp(t,e):this.processButtonFloat(t,e))}for(var i=0;i<this._axesLen;i++){var s=this._rawPad.axes[i];s>0&&s>this.deadZone||s<0&&s<-this.deadZone?this.processAxisChange(i,s):this.processAxisChange(i,0)}this._prevTimestamp=this._rawPad.timestamp}},connect:function(t){var e=!this.connected;this.connected=!0,this.index=t.index,this._rawPad=t,this._buttons=[],this._buttonsLen=t.buttons.length,this._axes=[],this._axesLen=t.axes.length;for(var i=0;i<this._axesLen;i++)this._axes[i]=t.axes[i];for(var s in t.buttons)s=parseInt(s,10),this._buttons[s]=new o.DeviceButton(this,s);e&&this._padParent.onConnectCallback&&this._padParent.onConnectCallback.call(this._padParent.callbackContext,this.index),e&&this.onConnectCallback&&this.onConnectCallback.call(this.callbackContext)},disconnect:function(){var t=this.connected,e=this.index;this.connected=!1,this.index=null,this._rawPad=void 0;for(var i=0;i<this._buttonsLen;i++)this._buttons[i].destroy();this._buttons=[],this._buttonsLen=0,this._axes=[],this._axesLen=0,t&&this._padParent.onDisconnectCallback&&this._padParent.onDisconnectCallback.call(this._padParent.callbackContext,e),t&&this.onDisconnectCallback&&this.onDisconnectCallback.call(this.callbackContext)},destroy:function(){this._rawPad=void 0;for(var t=0;t<this._buttonsLen;t++)this._buttons[t].destroy();this._buttons=[],this._buttonsLen=0,this._axes=[],this._axesLen=0,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null},processAxisChange:function(t,e){this._axes[t]!==e&&(this._axes[t]=e,this._padParent.onAxisCallback&&this._padParent.onAxisCallback.call(this._padParent.callbackContext,this,t,e),this.onAxisCallback&&this.onAxisCallback.call(this.callbackContext,this,t,e))},processButtonDown:function(t,e){this._buttons[t]&&this._buttons[t].start(null,e),this._padParent.onDownCallback&&this._padParent.onDownCallback.call(this._padParent.callbackContext,t,e,this.index),this.onDownCallback&&this.onDownCallback.call(this.callbackContext,t,e)},processButtonUp:function(t,e){this._padParent.onUpCallback&&this._padParent.onUpCallback.call(this._padParent.callbackContext,t,e,this.index),this.onUpCallback&&this.onUpCallback.call(this.callbackContext,t,e),this._buttons[t]&&this._buttons[t].stop(null,e)},processButtonFloat:function(t,e){this._padParent.onFloatCallback&&this._padParent.onFloatCallback.call(this._padParent.callbackContext,t,e,this.index),this.onFloatCallback&&this.onFloatCallback.call(this.callbackContext,t,e),this._buttons[t]&&this._buttons[t].padFloat(e)},axis:function(t){return!!this._axes[t]&&this._axes[t]},isDown:
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Key=function(t,e){this.game=t,this._enabled=!0,this.event=null,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=-2500,this.repeats=0,this.keyCode=e,this.onDown=new o.Signal,this.onHoldCallback=null,this.onHoldContext=null,this.onUp=new o.Signal,this._justDown=!1,this._justUp=!1},o.Key.prototype={update:function(){this._enabled&&this.isDown&&(this.duration=this.game.time.time-this.timeDown,this.repeats++,this.onHoldCallback&&this.onHoldCallback.call(this.onHoldContext,this))},processKeyDown:function(t){this._enabled&&(this.event=t,this.isDown||(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.time,this.duration=0,this.repeats=0,this._justDown=!0,this.onDown.dispatch(this)))},processKeyUp:function(t){this._enabled&&(this.event=t,this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.time,this.duration=this.game.time.time-this.timeDown,this._justUp=!0,this.onUp.dispatch(this)))},reset:function(t){void 0===t&&(t=!0),this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.time,this.duration=0,this._enabled=!0,this._justDown=!1,this._justUp=!1,t&&(this.onDown.removeAll(),this.onUp.removeAll(),this.onHoldCallback=null,this.onHoldContext=null)},downDuration:function(t){return void 0===t&&(t=50),this.isDown&&this.duration<t},upDuration:function(t){return void 0===t&&(t=50),!this.isDown&&this.game.time.time-this.timeUp<t}},Object.defineProperty(o.Key.prototype,"justDown",{get:function(){var t=this._justDown;return this._justDown=!1,t}}),Object.defineProperty(o.Key.prototype,"justUp",{get:function(){var t=this._justUp;return this._justUp=!1,t}}),Object.defineProperty(o.Key.prototype,"enabled",{get:function(){return this._enabled},set:function(t){(t=!!t)!==this._enabled&&(t||this.reset(!1),this._enabled=t)}}),o.Key.prototype.constructor=o.Key,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Keyboard=function(t){this.game=t,this.enabled=!0,this.event=null,this.pressEvent=null,this.callbackContext=this,this.onDownCallback=null,this.onPressCallback=null,this.onUpCallback=null,this._keys=[],this._capture=[],this._onKeyDown=null,this._onKeyPress=null,this._onKeyUp=null,this._i=0,this._k=0},o.Keyboard.prototype={addCallbacks:function(t,e,i,s){this.callbackContext=t,void 0!==e&&null!==e&&(this.onDownCallback=e),void 0!==i&&null!==i&&(this.onUpCallback=i),void 0!==s&&null!==s&&(this.onPressCallback=s)},addKey:function(t){return this._keys[t]||(this._keys[t]=new o.Key(this.game,t),this.addKeyCapture(t)),this._keys[t]},addKeys:function(t){var e={};for(var i in t)e[i]=this.addKey(t[i]);return e},removeKey:function(t){this._keys[t]&&(this._keys[t]=null,this.removeKeyCapture(t))},createCursorKeys:function(){return this.addKeys({up:o.KeyCode.UP,down:o.KeyCode.DOWN,left:o.KeyCode.LEFT,right:o.KeyCode.RIGHT})},start:function(){if(!this.game.device.cocoonJS&&null===this._onKeyDown){var t=this;this._onKeyDown=function(e){return t.processKeyDown(e)},this._onKeyUp=function(e){return t.processKeyUp(e)},this._onKeyPress=function(e){return t.processKeyPress(e)},window.addEventListener("keydown",this._onKeyDown,!1),window.addEventListener("keyup",this._onKeyUp,!1),window.addEventListener("keypress",this._onKeyPress,!1)}},stop:function(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),window.removeEventListener("keypress",this._onKeyPress),this._onKeyDown=null,this._onKeyUp=null,this._onKeyPress=null},destroy:function(){this.stop(),this.clearCaptures(),this._keys.length=0,this._i=0},addKeyCapture:function(t){if("object"==typeof t)for(var e in t)this._capture[t[e]]=!0;else this._capture[t]=!0},removeKeyCapture:function(t){delete this._capture[t]},clearCaptures:function(){this._capture={}},update:function(){for(this._i=this._keys.length;this._i--;)this._keys[this._i]&&this._keys[this._i].update()},processKeyDown:function(t){if(this.event=t,this.game.input.enabled&&this.enabled){var e=t.keyCode;this._capture[e]&&t.preventDefault(),this._keys[e]||(this._keys[e]=new o.Key(this.game,e)),this._keys[e].processKeyDown(t),this._k=e,this.onDownCallback&&this.onDownCallback.call(this.callbackContext,t)}},processKeyPress:function(t){this.pressEvent=t,this.game.input.enabled&&this.enabled&&this.onPressCallback&&this.onPressCallback.call(this.callbackContext,String.fromCharCode(t.charCode),t)},processKeyUp:function(t){if(this.event=t,this.game.input.enabled&&this.enabled){var e=t.keyCode;this._capture[e]&&t.preventDefault(),this._keys[e]||(this._keys[e]=new o.Key(this.game,e)),this._keys[e].processKeyUp(t),this.onUpCallback&&this.onUpCallback.call(this.callbackContext,t)}},reset:function(t){void 0===t&&(t=!0),this.event=null;for(var e=this._keys.length;e--;)this._keys[e]&&this._keys[e].reset(t)},downDuration:function(t,e){return this._keys[t]?this._keys[t].downDuration(e):null},upDuration:function(t,e){return this._keys[t]?this._keys[t].upDuration(e):null},isDown:function(t){return this._keys[t]?this._keys[t].isDown:null}},Object.defineProperty(o.Keyboard.prototype,"lastChar",{get:function(){return 32===this.event.charCode?"":String.fromCharCode(this.pressEvent.charCode)}}),Object.defineProperty(o.Keyboard.prototype,"lastKey",{get:function(){return this._keys[this._k]}}),o.Keyboard.prototype.constructor=o.Keyboard,o.KeyCode={A:"A".charCodeAt(0),B:"B".charCodeAt(0),C:"C".charCodeAt(0),D:"D".charCodeAt(0),E:"E".charCodeAt(0),F:"F".charCodeAt(0),G:"G".charCodeAt(0),H:"H".charCodeAt(0),I:"I".charCodeAt(0),J:"J".charCodeAt(0),K:"K".charCodeAt(0),L:"L".charCodeAt(0),M:"M".charCodeAt(0),N:"N".charCodeAt(0),O:"O".charCodeAt(0),P:"P".charCodeAt(0),Q:"Q".charCodeAt(0),R:"R".charCodeAt(0),S:"S".charCodeAt(0),T:"T".charCodeAt(0),U:"U".charCodeAt(0),V:"V".charCodeAt(0),W:"W".charCodeAt(0),X:"X".charCodeAt(0),Y:"Y".charCodeAt(0),Z:"Z".charCodeAt(0),ZERO:"0".charCodeAt(0),ONE:"1".charCodeAt(0),TWO:"2".charCodeAt(0),THREE:"3".charCodeAt(0),FOUR:"4".charCodeAt(0),FIVE:"5".charCodeAt(0),SIX:"6".charCodeAt(
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component=function(){},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Angle=function(){},o.Component.Angle.prototype={angle:{get:function(){return o.Math.wrapAngle(o.Math.radToDeg(this.rotation))},set:function(t){this.rotation=o.Math.degToRad(o.Math.wrapAngle(t))}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Animation=function(){},o.Component.Animation.prototype={play:function(t,e,i,s){if(this.animations)return this.animations.play(t,e,i,s)}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.AutoCull=function(){},o.Component.AutoCull.prototype={autoCull:!1,inCamera:{get:function(){return this.autoCull||this.checkWorldBounds||(this._bounds.copyFrom(this.getBounds()),this._bounds.x+=this.game.camera.view.x,this._bounds.y+=this.game.camera.view.y),this.game.world.camera.view.intersects(this._bounds)}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Bounds=function(){},o.Component.Bounds.prototype={offsetX:{get:function(){return this.anchor.x*this.width}},offsetY:{get:function(){return this.anchor.y*this.height}},centerX:{get:function(){return this.x-this.offsetX+.5*this.width},set:function(t){this.x=t+this.offsetX-.5*this.width}},centerY:{get:function(){return this.y-this.offsetY+.5*this.height},set:function(t){this.y=t+this.offsetY-.5*this.height}},left:{get:function(){return this.x-this.offsetX},set:function(t){this.x=t+this.offsetX}},right:{get:function(){return this.x+this.width-this.offsetX},set:function(t){this.x=t-this.width+this.offsetX}},top:{get:function(){return this.y-this.offsetY},set:function(t){this.y=t+this.offsetY}},bottom:{get:function(){return this.y+this.height-this.offsetY},set:function(t){this.y=t-this.height+this.offsetY}},alignIn:function(t,e,i,s){switch(void 0===i&&(i=0),void 0===s&&(s=0),e){default:case o.TOP_LEFT:this.left=t.left-i,this.top=t.top-s;break;case o.TOP_CENTER:this.centerX=t.centerX+i,this.top=t.top-s;break;case o.TOP_RIGHT:this.right=t.right+i,this.top=t.top-s;break;case o.LEFT_CENTER:this.left=t.left-i,this.centerY=t.centerY+s;break;case o.CENTER:this.centerX=t.centerX+i,this.centerY=t.centerY+s;break;case o.RIGHT_CENTER:this.right=t.right+i,this.centerY=t.centerY+s;break;case o.BOTTOM_LEFT:this.left=t.left-i,this.bottom=t.bottom+s;break;case o.BOTTOM_CENTER:this.centerX=t.centerX+i,this.bottom=t.bottom+s;break;case o.BOTTOM_RIGHT:this.right=t.right+i,this.bottom=t.bottom+s}return this},alignTo:function(t,e,i,s){switch(void 0===i&&(i=0),void 0===s&&(s=0),e){default:case o.TOP_LEFT:this.left=t.left-i,this.bottom=t.top-s;break;case o.TOP_CENTER:this.centerX=t.centerX+i,this.bottom=t.top-s;break;case o.TOP_RIGHT:this.right=t.right+i,this.bottom=t.top-s;break;case o.LEFT_TOP:this.right=t.left-i,this.top=t.top-s;break;case o.LEFT_CENTER:this.right=t.left-i,this.centerY=t.centerY+s;break;case o.LEFT_BOTTOM:this.right=t.left-i,this.bottom=t.bottom+s;break;case o.RIGHT_TOP:this.left=t.right+i,this.top=t.top-s;break;case o.RIGHT_CENTER:this.left=t.right+i,this.centerY=t.centerY+s;break;case o.RIGHT_BOTTOM:this.left=t.right+i,this.bottom=t.bottom+s;break;case o.BOTTOM_LEFT:this.left=t.left-i,this.top=t.bottom+s;break;case o.BOTTOM_CENTER:this.centerX=t.centerX+i,this.top=t.bottom+s;break;case o.BOTTOM_RIGHT:this.right=t.right+i,this.top=t.bottom+s}return this}},o.Group.prototype.alignIn=o.Component.Bounds.prototype.alignIn,o.Group.prototype.alignTo=o.Component.Bounds.prototype.alignTo,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.BringToTop=function(){},o.Component.BringToTop.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},o.Component.BringToTop.prototype.sendToBack=function(){return this.parent&&this.parent.sendToBack(this),this},o.Component.BringToTop.prototype.moveUp=function(){return this.parent&&this.parent.moveUp(this),this},o.Component.BringToTop.prototype.moveDown=function(){return this.parent&&this.parent.moveDown(this),this},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Core=function(){},o.Component.Core.install=function(t){o.Utils.mixinPrototype(this,o.Component.Core.prototype),this.components={};for(var e=0;e<t.length;e++){var i=t[e],s=!1;"Destroy"===i&&(s=!0),o.Utils.mixinPrototype(this,o.Component[i].prototype,s),this.components[i]=!0}},o.Component.Core.init=function(t,e,i,s,n){this.game=t,this.key=s,this.data={},this.position.set(e,i),this.world=new o.Point(e,i),this.previousPosition=new o.Point(e,i),this.events=new o.Events(this),this._bounds=new o.Rectangle,this.components.PhysicsBody&&(this.body=this.body),this.components.Animation&&(this.animations=new o.AnimationManager(this)),this.components.LoadTexture&&null!==s&&this.loadTexture(s,n),this.components.FixedToCamera&&(this.cameraOffset=new o.Point(e,i))},o.Component.Core.preUpdate=function(){if(this.pendingDestroy)return void this.destroy();if(this.previousPosition.set(this.world.x,this.world.y),this.previousRotation=this.rotation,!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this.renderOrderID=this.game.stage.currentRenderOrderID++),this.animations&&this.animations.update(),this.body&&this.body.preUpdate();for(var t=0;t<this.children.length;t++)this.children[t].preUpdate();return!0},o.Component.Core.prototype={game:null,name:"",data:{},components:{},z:0,events:void 0,animations:void 0,key:"",world:null,debug:!1,previousPosition:null,previousRotation:0,renderOrderID:0,fresh:!0,pendingDestroy:!1,_bounds:null,_exists:!0,exists:{get:function(){return this._exists},set:function(t){t?(this._exists=!0,this.body&&this.body.type===o.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._exists=!1,this.body&&this.body.type===o.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}},update:function(){},postUpdate:function(){this.customRender&&this.key.render(),this.components.PhysicsBody&&o.Component.PhysicsBody.postUpdate.call(this),this.components.FixedToCamera&&o.Component.FixedToCamera.postUpdate.call(this);for(var t=0;t<this.children.length;t++)this.children[t].postUpdate()}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Crop=function(){},o.Component.Crop.prototype={cropRect:null,_crop:null,crop:function(t,e){void 0===e&&(e=!1),t?(e&&null!==this.cropRect?this.cropRect.setTo(t.x,t.y,t.width,t.height):e&&null===this.cropRect?this.cropRect=new o.Rectangle(t.x,t.y,t.width,t.height):this.cropRect=t,this.updateCrop()):(this._crop=null,this.cropRect=null,this.resetFrame())},updateCrop:function(){if(this.cropRect){var t=this.texture.crop.x,e=this.texture.crop.y,i=this.texture.crop.width,s=this.texture.crop.height;this._crop=o.Rectangle.clone(this.cropRect,this._crop),this._crop.x+=this._frame.x,this._crop.y+=this._frame.y;var n=Math.max(this._frame.x,this._crop.x),a=Math.max(this._frame.y,this._crop.y),r=Math.min(this._frame.right,this._crop.right)-n,h=Math.min(this._frame.bottom,this._crop.bottom)-a;this.texture.crop.x=n,this.texture.crop.y=a,this.texture.crop.width=r,this.texture.crop.height=h,this.texture.frame.width=Math.min(r,this.cropRect.width),this.texture.frame.height=Math.min(h,this.cropRect.height),this.texture.width=this.texture.frame.width,this.texture.height=this.texture.frame.height,this.texture._updateUvs(),16777215===this.tint||t===n&&e===a&&i===r&&s===h||(this.texture.requiresReTint=!0)}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Delta=function(){},o.Component.Delta.prototype={deltaX:{get:function(){return this.world.x-this.previousPosition.x}},deltaY:{get:function(){return this.world.y-this.previousPosition.y}},deltaZ:{get:function(){return this.rotation-this.previousRotation}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Destroy=function(){},o.Component.Destroy.prototype={destroyPhase:!1,destroy:function(t,e){if(null!==this.game&&!this.destroyPhase){void 0===t&&(t=!0),void 0===e&&(e=!1),this.destroyPhase=!0,this.events&&this.events.onDestroy$dispatch(this),this.parent&&(this.parent instanceof o.Group?this.parent.remove(this):this.parent.removeChild(this)),this.input&&this.input.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.events&&this.events.destroy(),this.game.tweens.removeFrom(this);var i=this.children.length;if(t)for(;i--;)this.children[i].destroy(t);else for(;i--;)this.removeChild(this.children[i]);this._crop&&(this._crop=null,this.cropRect=null),this._frame&&(this._frame=null),o.Video&&this.key instanceof o.Video&&this.key.onChangeSource.remove(this.resizeFrame,this),o.BitmapText&&this._glyphs&&(this._glyphs=[]),this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null,this.data={},this.renderable=!1,this.transformCallback&&(this.transformCallback=null,this.transformCallbackContext=null),this.hitArea=null,this.parent=null,this.stage=null,this.worldTransform=null,this.filterArea=null,this._bounds=null,this._currentBounds=null,this._mask=null,this._destroyCachedSprite(),e&&this.texture.destroy(!0),this.destroyPhase=!1,this.pendingDestroy=!1}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Events=function(t){this.parent=t},o.Events.prototype={destroy:function(){this._parent=null,this._onDestroy&&this._onDestroy.dispose(),this._onAddedToGroup&&this._onAddedToGroup.dispose(),this._onRemovedFromGroup&&this._onRemovedFromGroup.dispose(),this._onRemovedFromWorld&&this._onRemovedFromWorld.dispose(),this._onKilled&&this._onKilled.dispose(),this._onRevived&&this._onRevived.dispose(),this._onEnterBounds&&this._onEnterBounds.dispose(),this._onOutOfBounds&&this._onOutOfBounds.dispose(),this._onInputOver&&this._onInputOver.dispose(),this._onInputOut&&this._onInputOut.dispose(),this._onInputDown&&this._onInputDown.dispose(),this._onInputUp&&this._onInputUp.dispose(),this._onDragStart&&this._onDragStart.dispose(),this._onDragUpdate&&this._onDragUpdate.dispose(),this._onDragStop&&this._onDragStop.dispose(),this._onAnimationStart&&this._onAnimationStart.dispose(),this._onAnimationComplete&&this._onAnimationComplete.dispose(),this._onAnimationLoop&&this._onAnimationLoop.dispose()},onAddedToGroup:null,onRemovedFromGroup:null,onRemovedFromWorld:null,onDestroy:null,onKilled:null,onRevived:null,onOutOfBounds:null,onEnterBounds:null,onInputOver:null,onInputOut:null,onInputDown:null,onInputUp:null,onDragStart:null,onDragUpdate:null,onDragStop:null,onAnimationStart:null,onAnimationComplete:null,onAnimationLoop:null},o.Events.prototype.constructor=o.Events;for(var h in o.Events.prototype)o.Events.prototype.hasOwnProperty(h)&&0===h.indexOf("on")&&null===o.Events.prototype[h]&&function(t,e){"use strict";Object.defineProperty(o.Events.prototype,t,{get:function(){return this[e]||(this[e]=new o.Signal)}}),o.Events.prototype[t+"$dispatch"]=function(){return this[e]?this[e].dispatch.apply(this[e],arguments):null}}(h,"_"+h);/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.FixedToCamera=function(){},o.Component.FixedToCamera.postUpdate=function(){this.fixedToCamera&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},o.Component.FixedToCamera.prototype={_fixedToCamera:!1,fixedToCamera:{get:function(){return this._fixedToCamera},set:function(t){t?(this._fixedToCamera=!0,this.cameraOffset.set(this.x,this.y)):this._fixedToCamera=!1}},cameraOffset:new o.Point},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Health=function(){},o.Component.Health.prototype={health:1,maxHealth:100,damage:function(t){return this.alive&&(this.health-=t,this.health<=0&&this.kill()),this},setHealth:function(t){return this.health=t,this.health>this.maxHealth&&(this.health=this.maxHealth),this},heal:function(t){return this.alive&&(this.health+=t,this.health>this.maxHealth&&(this.health=this.maxHealth)),this}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.InCamera=function(){},o.Component.InCamera.prototype={inCamera:{get:function(){return this.game.world.camera.view.intersects(this._bounds)}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.InputEnabled=function(){},o.Component.InputEnabled.prototype={input:null,inputEnabled:{get:function(){return this.input&&this.input.enabled},set:function(t){t?null===this.input?(this.input=new o.InputHandler(this),this.input.start()):this.input&&!this.input.enabled&&this.input.start():this.input&&this.input.enabled&&this.input.stop()}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.InWorld=function(){},o.Component.InWorld.preUpdate=function(){if(this.autoCull||this.checkWorldBounds){if(this._bounds.copyFrom(this.getBounds()),this._bounds.x+=this.game.camera.view.x,this._bounds.y+=this.game.camera.view.y,this.autoCull)if(this.game.world.camera.view.intersects(this._bounds))this.renderable=!0,this.game.world.camera.totalInView++;else if(this.renderable=!1,this.outOfCameraBoundsKill)return this.kill(),!1;if(this.checkWorldBounds)if(this._outOfBoundsFired&&this.game.world.bounds.intersects(this._bounds))this._outOfBoundsFired=!1,this.events.onEnterBounds$dispatch(this);else if(!this._outOfBoundsFired&&!this.game.world.bounds.intersects(this._bounds)&&(this._outOfBoundsFired=!0,this.events.onOutOfBounds$dispatch(this),this.outOfBoundsKill))return this.kill(),!1}return!0},o.Component.InWorld.prototype={checkWorldBounds:!1,outOfBoundsKill:!1,outOfCameraBoundsKill:!1,_outOfBoundsFired:!1,inWorld:{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.LifeSpan=function(){},o.Component.LifeSpan.preUpdate=function(){return!(this.lifespan>0&&(this.lifespan-=this.game.time.physicsElapsedMS,this.lifespan<=0))||(this.kill(),!1)},o.Component.LifeSpan.prototype={alive:!0,lifespan:0,revive:function(t){return void 0===t&&(t=100),this.alive=!0,this.exists=!0,this.visible=!0,"function"==typeof this.setHealth&&this.setHealth(t),this.events&&this.events.onRevived$dispatch(this),this},kill:function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled$dispatch(this),this}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.LoadTexture=function(){},o.Component.LoadTexture.prototype={customRender:!1,_frame:null,loadTexture:function(t,e,i){t===o.PENDING_ATLAS?(t=e,e=0):e=e||0,(i||void 0===i)&&this.animations&&this.animations.stop(),this.key=t,this.customRender=!1;var s=this.game.cache,n=!0,a=!this.texture.baseTexture.scaleMode;if(o.RenderTexture&&t instanceof o.RenderTexture)this.key=t.key,this.setTexture(t);else if(o.BitmapData&&t instanceof o.BitmapData)this.customRender=!0,this.setTexture(t.texture),n=s.hasFrameData(t.key,o.Cache.BITMAPDATA)?!this.animations.loadFrameData(s.getFrameData(t.key,o.Cache.BITMAPDATA),e):!this.animations.loadFrameData(t.frameData,0);else if(o.Video&&t instanceof o.Video){this.customRender=!0;var r=t.texture.valid;this.setTexture(t.texture),this.setFrame(t.texture.frame.clone()),t.onChangeSource.add(this.resizeFrame,this),this.texture.valid=r}else if(o.Tilemap&&t instanceof o.TilemapLayer)this.setTexture(PIXI.Texture.fromCanvas(t.canvas));else if(t instanceof PIXI.Texture)this.setTexture(t);else{var h=s.getImage(t,!0);this.key=h.key,this.setTexture(new PIXI.Texture(h.base)),this.texture.baseTexture.skipRender="__default"===t,n=!this.animations.loadFrameData(h.frameData,e)}n&&(this._frame=o.Rectangle.clone(this.texture.frame)),a||(this.texture.baseTexture.scaleMode=1)},setFrame:function(t){this._frame=t,this.texture.frame.x=t.x,this.texture.frame.y=t.y,this.texture.frame.width=t.width,this.texture.frame.height=t.height,this.texture.crop.x=t.x,this.texture.crop.y=t.y,this.texture.crop.width=t.width,this.texture.crop.height=t.height,t.trimmed?(this.texture.trim?(this.texture.trim.x=t.spriteSourceSizeX,this.texture.trim.y=t.spriteSourceSizeY,this.texture.trim.width=t.sourceSizeW,this.texture.trim.height=t.sourceSizeH):this.texture.trim={x:t.spriteSourceSizeX,y:t.spriteSourceSizeY,width:t.sourceSizeW,height:t.sourceSizeH},this.texture.width=t.sourceSizeW,this.texture.height=t.sourceSizeH,this.texture.frame.width=t.sourceSizeW,this.texture.frame.height=t.sourceSizeH):!t.trimmed&&this.texture.trim&&(this.texture.trim=null),this.cropRect&&this.updateCrop(),this.texture.requiresReTint=!0,this.texture._updateUvs(),this.tilingTexture&&(this.refreshTexture=!0)},resizeFrame:function(t,e,i){this.texture.frame.resize(e,i),this.texture.setFrame(this.texture.frame)},resetFrame:function(){this._frame&&this.setFrame(this._frame)},frame:{get:function(){return this.animations.frame},set:function(t){this.animations.frame=t}},frameName:{get:function(){return this.animations.frameName},set:function(t){this.animations.frameName=t}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Overlap=function(){},o.Component.Overlap.prototype={overlap:function(t){return o.Rectangle.intersects(this.getBounds(),t.getBounds())}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.PhysicsBody=function(){},o.Component.PhysicsBody.preUpdate=function(){return this.fresh&&this.exists?(this.world.setTo(this.parent.position.x+this.position.x,this.parent.position.y+this.position.y),this.worldTransform.tx=this.world.x,this.worldTransform.ty=this.world.y,this.previousPosition.set(this.world.x,this.world.y),this.previousRotation=this.rotation,this.body&&this.body.preUpdate(),this.fresh=!1,!1):(this.previousPosition.set(this.world.x,this.world.y),this.previousRotation=this.rotation,!(!this._exists||!this.parent.exists)||(this.renderOrderID=-1,!1))},o.Component.PhysicsBody.postUpdate=function(){this.exists&&this.body&&this.body.postUpdate()},o.Component.PhysicsBody.prototype={body:null,x:{get:function(){return this.position.x},set:function(t){this.position.x=t,this.body&&!this.body.dirty&&(this.body._reset=!0)}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t,this.body&&!this.body.dirty&&(this.body._reset=!0)}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Reset=function(){},o.Component.Reset.prototype.reset=function(t,e,i){return void 0===i&&(i=1),this.world.set(t,e),this.position.set(t,e),this.fresh=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this.components.InWorld&&(this._outOfBoundsFired=!1),this.components.LifeSpan&&(this.alive=!0,this.health=i),this.components.PhysicsBody&&this.body&&this.body.reset(t,e,!1,!1),this},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.ScaleMinMax=function(){},o.Component.ScaleMinMax.prototype={transformCallback:null,transformCallbackContext:this,scaleMin:null,scaleMax:null,checkTransform:function(t){this.scaleMin&&(t.a<this.scaleMin.x&&(t.a=this.scaleMin.x),t.d<this.scaleMin.y&&(t.d=this.scaleMin.y)),this.scaleMax&&(t.a>this.scaleMax.x&&(t.a=this.scaleMax.x),t.d>this.scaleMax.y&&(t.d=this.scaleMax.y))},setScaleMinMax:function(t,e,i,s){void 0===e?e=i=s=t:void 0===i&&(i=s=e,e=t),null===t?this.scaleMin=null:this.scaleMin?this.scaleMin.set(t,e):this.scaleMin=new o.Point(t,e),null===i?this.scaleMax=null:this.scaleMax?this.scaleMax.set(i,s):this.scaleMax=new o.Point(i,s),null===this.scaleMin?this.transformCallback=null:(this.transformCallback=this.checkTransform,this.transformCallbackContext=this)}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Component.Smoothed=function(){},o.Component.Smoothed.prototype={smoothed:{get:function(){return!this.texture.baseTexture.scaleMode},set:function(t){t?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.GameObjectFactory=function(t){this.game=t,this.world=this.game.world},o.GameObjectFactory.prototype={existing:function(t){return this.world.add(t)},weapon:function(t,e,i,s){var n=this.game.plugins.add(o.Weapon);return n.createBullets(t,e,i,s),n},image:function(t,e,i,s,n){return void 0===n&&(n=this.world),n.add(new o.Image(this.game,t,e,i,s))},sprite:function(t,e,i,s,n){return void 0===n&&(n=this.world),n.create(t,e,i,s)},creature:function(t,e,i,s,n){void 0===n&&(n=this.world);var a=new o.Creature(this.game,t,e,i,s);return n.add(a),a},tween:function(t){return this.game.tweens.create(t)},group:function(t,e,i,s,n){return new o.Group(this.game,t,e,i,s,n)},physicsGroup:function(t,e,i,s){return new o.Group(this.game,e,i,s,!0,t)},spriteBatch:function(t,e,i){return void 0===t&&(t=null),void 0===e&&(e="group"),void 0===i&&(i=!1),new o.SpriteBatch(this.game,t,e,i)},audio:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},sound:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},audioSprite:function(t){return this.game.sound.addSprite(t)},tileSprite:function(t,e,i,s,n,a,r){return void 0===r&&(r=this.world),r.add(new o.TileSprite(this.game,t,e,i,s,n,a))},rope:function(t,e,i,s,n,a){return void 0===a&&(a=this.world),a.add(new o.Rope(this.game,t,e,i,s,n))},text:function(t,e,i,s,n){return void 0===n&&(n=this.world),n.add(new o.Text(this.game,t,e,i,s))},button:function(t,e,i,s,n,a,r,h,l,c){return void 0===c&&(c=this.world),c.add(new o.Button(this.game,t,e,i,s,n,a,r,h,l))},graphics:function(t,e,i){return void 0===i&&(i=this.world),i.add(new o.Graphics(this.game,t,e))},emitter:function(t,e,i){return this.game.particles.add(new o.Particles.Arcade.Emitter(this.game,t,e,i))},retroFont:function(t,e,i,s,n,a,r,h,l){return new o.RetroFont(this.game,t,e,i,s,n,a,r,h,l)},bitmapText:function(t,e,i,s,n,a){return void 0===a&&(a=this.world),a.add(new o.BitmapText(this.game,t,e,i,s,n))},tilemap:function(t,e,i,s,n){return new o.Tilemap(this.game,t,e,i,s,n)},renderTexture:function(t,e,i,s){void 0!==i&&""!==i||(i=this.game.rnd.uuid()),void 0===s&&(s=!1);var n=new o.RenderTexture(this.game,t,e,i);return s&&this.game.cache.addRenderTexture(i,n),n},video:function(t,e){return new o.Video(this.game,t,e)},bitmapData:function(t,e,i,s){void 0===s&&(s=!1),void 0!==i&&""!==i||(i=this.game.rnd.uuid());var n=new o.BitmapData(this.game,i,t,e);return s&&this.game.cache.addBitmapData(i,n),n},filter:function(t){var e=Array.prototype.slice.call(arguments,1),t=new o.Filter[t](this.game);return t.init.apply(t,e),t},plugin:function(t){return this.game.plugins.add(t)}},o.GameObjectFactory.prototype.constructor=o.GameObjectFactory,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.GameObjectCreator=function(t){this.game=t,this.world=this.game.world},o.GameObjectCreator.prototype={image:function(t,e,i,s){return new o.Image(this.game,t,e,i,s)},sprite:function(t,e,i,s){return new o.Sprite(this.game,t,e,i,s)},tween:function(t){return new o.Tween(t,this.game,this.game.tweens)},group:function(t,e,i,s,n){return new o.Group(this.game,t,e,i,s,n)},spriteBatch:function(t,e,i){return void 0===e&&(e="group"),void 0===i&&(i=!1),new o.SpriteBatch(this.game,t,e,i)},audio:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},audioSprite:function(t){return this.game.sound.addSprite(t)},sound:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},tileSprite:function(t,e,i,s,n,a){return new o.TileSprite(this.game,t,e,i,s,n,a)},rope:function(t,e,i,s,n){return new o.Rope(this.game,t,e,i,s,n)},text:function(t,e,i,s){return new o.Text(this.game,t,e,i,s)},button:function(t,e,i,s,n,a,r,h,l){return new o.Button(this.game,t,e,i,s,n,a,r,h,l)},graphics:function(t,e){return new o.Graphics(this.game,t,e)},emitter:function(t,e,i){return new o.Particles.Arcade.Emitter(this.game,t,e,i)},retroFont:function(t,e,i,s,n,a,r,h,l){return new o.RetroFont(this.game,t,e,i,s,n,a,r,h,l)},bitmapText:function(t,e,i,s,n,a){return new o.BitmapText(this.game,t,e,i,s,n,a)},tilemap:function(t,e,i,s,n){return new o.Tilemap(this.game,t,e,i,s,n)},renderTexture:function(t,e,i,s){void 0!==i&&""!==i||(i=this.game.rnd.uuid()),void 0===s&&(s=!1);var n=new o.RenderTexture(this.game,t,e,i);return s&&this.game.cache.addRenderTexture(i,n),n},bitmapData:function(t,e,i,s){void 0===s&&(s=!1),void 0!==i&&""!==i||(i=this.game.rnd.uuid());var n=new o.BitmapData(this.game,i,t,e);return s&&this.game.cache.addBitmapData(i,n),n},filter:function(t){var e=Array.prototype.slice.call(arguments,1),t=new o.Filter[t](this.game);return t.init.apply(t,e),t}},o.GameObjectCreator.prototype.constructor=o.GameObjectCreator,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Sprite=function(t,e,i,s,n){e=e||0,i=i||0,s=s||null,n=n||null,this.type=o.SPRITE,this.physicsType=o.SPRITE,PIXI.Sprite.call(this,o.Cache.DEFAULT),o.Component.Core.init.call(this,t,e,i,s,n)},o.Sprite.prototype=Object.create(PIXI.Sprite.prototype),o.Sprite.prototype.constructor=o.Sprite,o.Component.Core.install.call(o.Sprite.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Delta","Destroy","FixedToCamera","Health","InCamera","InputEnabled","InWorld","LifeSpan","LoadTexture","Overlap","PhysicsBody","Reset","ScaleMinMax","Smoothed"]),o.Sprite.prototype.preUpdatePhysics=o.Component.PhysicsBody.preUpdate,o.Sprite.prototype.preUpdateLifeSpan=o.Component.LifeSpan.preUpdate,o.Sprite.prototype.preUpdateInWorld=o.Component.InWorld.preUpdate,o.Sprite.prototype.preUpdateCore=o.Component.Core.preUpdate,o.Sprite.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Image=function(t,e,i,s,n){e=e||0,i=i||0,s=s||null,n=n||null,this.type=o.IMAGE,PIXI.Sprite.call(this,o.Cache.DEFAULT),o.Component.Core.init.call(this,t,e,i,s,n)},o.Image.prototype=Object.create(PIXI.Sprite.prototype),o.Image.prototype.constructor=o.Image,o.Component.Core.install.call(o.Image.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Destroy","FixedToCamera","InputEnabled","LifeSpan","LoadTexture","Overlap","Reset","ScaleMinMax","Smoothed"]),o.Image.prototype.preUpdateInWorld=o.Component.InWorld.preUpdate,o.Image.prototype.preUpdateCore=o.Component.Core.preUpdate,o.Image.prototype.preUpdate=function(){return!!this.preUpdateInWorld()&&this.preUpdateCore()},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Button=function(t,e,i,s,n,a,r,h,l,c){e=e||0,i=i||0,s=s||null,n=n||null,a=a||this,o.Image.call(this,t,e,i,s,h),this.type=o.BUTTON,this.physicsType=o.SPRITE,this._onOverFrame=null,this._onOutFrame=null,this._onDownFrame=null,this._onUpFrame=null,this.onOverSound=null,this.onOutSound=null,this.onDownSound=null,this.onUpSound=null,this.onOverSoundMarker="",this.onOutSoundMarker="",this.onDownSoundMarker="",this.onUpSoundMarker="",this.onInputOver=new o.Signal,this.onInputOut=new o.Signal,this.onInputDown=new o.Signal,this.onInputUp=new o.Signal,this.onOverMouseOnly=!0,this.justReleasedPreventsOver=o.PointerMode.TOUCH,this.freezeFrames=!1,this.forceOut=!1,this.inputEnabled=!0,this.input.start(0,!0),this.input.useHandCursor=!0,this.setFrames(r,h,l,c),null!==n&&this.onInputUp.add(n,a),this.events.onInputOver.add(this.onInputOverHandler,this),this.events.onInputOut.add(this.onInputOutHandler,this),this.events.onInputDown.add(this.onInputDownHandler,this),this.events.onInputUp.add(this.onInputUpHandler,this),this.events.onRemovedFromWorld.add(this.removedFromWorld,this)},o.Button.prototype=Object.create(o.Image.prototype),o.Button.prototype.constructor=o.Button;var l="Over",c="Out",u="Down",d="Up";o.Button.prototype.clearFrames=function(){this.setFrames(null,null,null,null)},o.Button.prototype.removedFromWorld=function(){this.inputEnabled=!1},o.Button.prototype.setStateFrame=function(t,e,i){var s="_on"+t+"Frame";null!==e?(this[s]=e,i&&this.changeStateFrame(t)):this[s]=null},o.Button.prototype.changeStateFrame=function(t){if(this.freezeFrames)return!1;var e="_on"+t+"Frame",i=this[e];return"string"==typeof i?(this.frameName=i,!0):"number"==typeof i&&(this.frame=i,!0)},o.Button.prototype.setFrames=function(t,e,i,s){this.setStateFrame("Over",t,this.input.pointerOver()),this.setStateFrame("Out",e,!this.input.pointerOver()),this.setStateFrame("Down",i,this.input.pointerDown()),this.setStateFrame("Up",s,this.input.pointerUp())},o.Button.prototype.setStateSound=function(t,e,i){var s="on"+t+"Sound",n="on"+t+"SoundMarker";e instanceof o.Sound||e instanceof o.AudioSprite?(this[s]=e,this[n]="string"==typeof i?i:""):(this[s]=null,this[n]="")},o.Button.prototype.playStateSound=function(t){var e="on"+t+"Sound",i=this[e];if(i){var s="on"+t+"SoundMarker",n=this[s];return i.play(n),!0}return!1},o.Button.prototype.setSounds=function(t,e,i,s,n,o,a,r){this.setStateSound("Over",t,e),this.setStateSound("Out",n,o),this.setStateSound("Down",i,s),this.setStateSound("Up",a,r)},o.Button.prototype.setOverSound=function(t,e){this.setStateSound("Over",t,e)},o.Button.prototype.setOutSound=function(t,e){this.setStateSound("Out",t,e)},o.Button.prototype.setDownSound=function(t,e){this.setStateSound("Down",t,e)},o.Button.prototype.setUpSound=function(t,e){this.setStateSound("Up",t,e)},o.Button.prototype.onInputOverHandler=function(t,e){e.justReleased()&&(this.justReleasedPreventsOver&e.pointerMode)===e.pointerMode||(this.changeStateFrame("Over"),this.onOverMouseOnly&&!e.isMouse||(this.playStateSound("Over"),this.onInputOver&&this.onInputOver.dispatch(this,e)))},o.Button.prototype.onInputOutHandler=function(t,e){this.changeStateFrame("Out"),this.playStateSound("Out"),this.onInputOut&&this.onInputOut.dispatch(this,e)},o.Button.prototype.onInputDownHandler=function(t,e){this.changeStateFrame("Down"),this.playStateSound("Down"),this.onInputDown&&this.onInputDown.dispatch(this,e)},o.Button.prototype.onInputUpHandler=function(t,e,i){if(this.playStateSound("Up"),this.onInputUp&&this.onInputUp.dispatch(this,e,i),!this.freezeFrames)if(!0===this.forceOut||(this.forceOut&e.pointerMode)===e.pointerMode)this.changeStateFrame("Out");else{var s=this.changeStateFrame("Up");s||(i?this.changeStateFrame("Over"):this.changeStateFrame("Out"))}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.SpriteBatch=function(t,e,i,s){void 0!==e&&null!==e||(e=t.world),PIXI.SpriteBatch.call(this),o.Group.call(this,t,e,i,s),this.type=o.SPRITEBATCH},o.SpriteBatch.prototype=o.Utils.extend(!0,o.SpriteBatch.prototype,PIXI.SpriteBatch.prototype,o.Group.prototype),o.SpriteBatch.prototype.constructor=o.SpriteBatch,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.BitmapData=function(t,e,i,s,n){void 0!==i&&0!==i||(i=256),void 0!==s&&0!==s||(s=256),void 0===n&&(n=!1),this.game=t,this.key=e,this.width=i,this.height=s,this.canvas=o.Canvas.create(this,i,s,null,n),this.context=this.canvas.getContext("2d",{alpha:!0}),this.ctx=this.context,this.smoothProperty=t.renderType===o.CANVAS?t.renderer.renderSession.smoothProperty:o.Canvas.getSmoothingPrefix(this.context),this.imageData=this.context.getImageData(0,0,i,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.frameData=new o.FrameData,this.textureFrame=this.frameData.addFrame(new o.Frame(0,0,0,i,s,"bitmapData")),this.texture.frame=this.textureFrame,this.type=o.BITMAPDATA,this.disableTextureUpload=!1,this.dirty=!1,this.cls=this.clear,this._image=null,this._pos=new o.Point,this._size=new o.Point,this._scale=new o.Point,this._rotate=0,this._alpha={prev:1,current:1},this._anchor=new o.Point,this._tempR=0,this._tempG=0,this._tempB=0,this._circle=new o.Circle,this._swapCanvas=void 0},o.BitmapData.prototype={move:function(t,e,i){return 0!==t&&this.moveH(t,i),0!==e&&this.moveV(e,i),this},moveH:function(t,e){void 0===e&&(e=!0),void 0===this._swapCanvas&&(this._swapCanvas=PIXI.CanvasPool.create(this,this.width,this.height));var i=this._swapCanvas,s=i.getContext("2d"),n=this.height,o=this.canvas;if(s.clearRect(0,0,this.width,this.height),t<0){t=Math.abs(t);var a=this.width-t;e&&s.drawImage(o,0,0,t,n,a,0,t,n),s.drawImage(o,t,0,a,n,0,0,a,n)}else{var a=this.width-t;e&&s.drawImage(o,a,0,t,n,0,0,t,n),s.drawImage(o,0,0,a,n,t,0,a,n)}return this.clear(),this.copy(this._swapCanvas)},moveV:function(t,e){void 0===e&&(e=!0),void 0===this._swapCanvas&&(this._swapCanvas=PIXI.CanvasPool.create(this,this.width,this.height));var i=this._swapCanvas,s=i.getContext("2d"),n=this.width,o=this.canvas;if(s.clearRect(0,0,this.width,this.height),t<0){t=Math.abs(t);var a=this.height-t;e&&s.drawImage(o,0,0,n,t,0,a,n,t),s.drawImage(o,0,t,n,a,0,0,n,a)}else{var a=this.height-t;e&&s.drawImage(o,0,a,n,t,0,0,n,t),s.drawImage(o,0,0,n,a,0,t,n,a)}return this.clear(),this.copy(this._swapCanvas)},add:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)t[e].loadTexture&&t[e].loadTexture(this);else t.loadTexture(this);return this},load:function(t){if("string"==typeof t&&(t=this.game.cache.getImage(t)),t)return this.resize(t.width,t.height),this.cls(),this.draw(t),this.update(),this},clear:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),this.context.clearRect(t,e,i,s),this.dirty=!0,this},fill:function(t,e,i,s){return void 0===s&&(s=1),this.context.fillStyle="rgba("+t+","+e+","+i+","+s+")",this.context.fillRect(0,0,this.width,this.height),this.dirty=!0,this},generateTexture:function(t){var e=new Image;e.src=this.canvas.toDataURL("image/png");var i=this.game.cache.addImage(t,"",e);return new PIXI.Texture(i.base)},resize:function(t,e){return t===this.width&&e===this.height||(this.width=t,this.height=e,this.canvas.width=t,this.canvas.height=e,void 0!==this._swapCanvas&&(this._swapCanvas.width=t,this._swapCanvas.height=e),this.baseTexture.width=t,this.baseTexture.height=e,this.textureFrame.width=t,this.textureFrame.height=e,this.texture.width=t,this.texture.height=e,this.texture.crop.width=t,this.texture.crop.height=e,this.update(),this.dirty=!0),this},update:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=Math.max(1,this.width)),void 0===s&&(s=Math.max(1,this.height)),this.imageData=this.context.getImageData(t,e,i,s),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Graphics=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),this.type=o.GRAPHICS,this.physicsType=o.SPRITE,this.anchor=new o.Point,PIXI.Graphics.call(this),o.Component.Core.init.call(this,t,e,i,"",null)},o.Graphics.prototype=Object.create(PIXI.Graphics.prototype),o.Graphics.prototype.constructor=o.Graphics,o.Component.Core.install.call(o.Graphics.prototype,["Angle","AutoCull","Bounds","Destroy","FixedToCamera","InputEnabled","InWorld","LifeSpan","PhysicsBody","Reset"]),o.Graphics.prototype.preUpdatePhysics=o.Component.PhysicsBody.preUpdate,o.Graphics.prototype.preUpdateLifeSpan=o.Component.LifeSpan.preUpdate,o.Graphics.prototype.preUpdateInWorld=o.Component.InWorld.preUpdate,o.Graphics.prototype.preUpdateCore=o.Component.Core.preUpdate,o.Graphics.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},o.Graphics.prototype.postUpdate=function(){o.Component.PhysicsBody.postUpdate.call(this),o.Component.FixedToCamera.postUpdate.call(this),this._boundsDirty&&(this.updateLocalBounds(),this._boundsDirty=!1);for(var t=0;t<this.children.length;t++)this.children[t].postUpdate()},o.Graphics.prototype.destroy=function(t){this.clear(),o.Component.Destroy.prototype.destroy.call(this,t)},o.Graphics.prototype.drawTriangle=function(t,e){void 0===e&&(e=!1);var i=new o.Polygon(t);if(e){var s=new o.Point(this.game.camera.x-t[0].x,this.game.camera.y-t[0].y),n=new o.Point(t[1].x-t[0].x,t[1].y-t[0].y),a=new o.Point(t[1].x-t[2].x,t[1].y-t[2].y),r=a.cross(n);s.dot(r)>0&&this.drawPolygon(i)}else this.drawPolygon(i)},o.Graphics.prototype.drawTriangles=function(t,e,i){void 0===i&&(i=!1);var s=new o.Point,n=new o.Point,a=new o.Point,r=[],h;if(e)if(t[0]instanceof o.Point)for(h=0;h<e.length/3;h++)r.push(t[e[3*h]]),r.push(t[e[3*h+1]]),r.push(t[e[3*h+2]]),3===r.length&&(this.drawTriangle(r,i),r=[]);else for(h=0;h<e.length;h++)s.x=t[2*e[h]],s.y=t[2*e[h]+1],r.push(s.copyTo({})),3===r.length&&(this.drawTriangle(r,i),r=[]);else if(t[0]instanceof o.Point)for(h=0;h<t.length/3;h++)this.drawTriangle([t[3*h],t[3*h+1],t[3*h+2]],i);else for(h=0;h<t.length/6;h++)s.x=t[6*h+0],s.y=t[6*h+1],n.x=t[6*h+2],n.y=t[6*h+3],a.x=t[6*h+4],a.y=t[6*h+5],this.drawTriangle([s,n,a],i)},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.RenderTexture=function(t,e,i,s,n,a){void 0===s&&(s=""),void 0===n&&(n=o.scaleModes.DEFAULT),void 0===a&&(a=1),this.game=t,this.key=s,this.type=o.RENDERTEXTURE,this._tempMatrix=new PIXI.Matrix,PIXI.RenderTexture.call(this,e,i,this.game.renderer,n,a),this.render=o.RenderTexture.prototype.render},o.RenderTexture.prototype=Object.create(PIXI.RenderTexture.prototype),o.RenderTexture.prototype.constructor=o.RenderTexture,o.RenderTexture.prototype.renderXY=function(t,e,i,s){t.updateTransform(),this._tempMatrix.copyFrom(t.worldTransform),this._tempMatrix.tx=e,this._tempMatrix.ty=i,this.renderer.type===PIXI.WEBGL_RENDERER?this.renderWebGL(t,this._tempMatrix,s):this.renderCanvas(t,this._tempMatrix,s)},o.RenderTexture.prototype.renderRawXY=function(t,e,i,s){this._tempMatrix.identity().translate(e,i),this.renderer.type===PIXI.WEBGL_RENDERER?this.renderWebGL(t,this._tempMatrix,s):this.renderCanvas(t,this._tempMatrix,s)},o.RenderTexture.prototype.render=function(t,e,i){void 0===e||null===e?this._tempMatrix.copyFrom(t.worldTransform):this._tempMatrix.copyFrom(e),this.renderer.type===PIXI.WEBGL_RENDERER?this.renderWebGL(t,this._tempMatrix,i):this.renderCanvas(t,this._tempMatrix,i)},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Text=function(t,e,i,s,n){e=e||0,i=i||0,s=void 0===s||null===s?"":s.toString(),n=o.Utils.extend({},n),this.type=o.TEXT,this.physicsType=o.SPRITE,this.padding=new o.Point,this.textBounds=null,this.canvas=PIXI.CanvasPool.create(this),this.context=this.canvas.getContext("2d"),this.colors=[],this.strokeColors=[],this.fontStyles=[],this.fontWeights=[],this.autoRound=!1,this.useAdvancedWrap=!1,this._res=t.renderer.resolution,this._text=s,this._fontComponents=null,this._lineSpacing=0,this._charCount=0,this._width=0,this._height=0,o.Sprite.call(this,t,e,i,PIXI.Texture.fromCanvas(this.canvas)),this.setStyle(n),""!==s&&this.updateText()},o.Text.prototype=Object.create(o.Sprite.prototype),o.Text.prototype.constructor=o.Text,o.Text.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},o.Text.prototype.update=function(){},o.Text.prototype.destroy=function(t){this.texture.destroy(!0),o.Component.Destroy.prototype.destroy.call(this,t)},o.Text.prototype.setShadow=function(t,e,i,s,n,o){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="rgba(0, 0, 0, 1)"),void 0===s&&(s=0),void 0===n&&(n=!0),void 0===o&&(o=!0),this.style.shadowOffsetX=t,this.style.shadowOffsetY=e,this.style.shadowColor=i,this.style.shadowBlur=s,this.style.shadowStroke=n,this.style.shadowFill=o,this.dirty=!0,this},o.Text.prototype.setStyle=function(t,e){void 0===e&&(e=!1),t=t||{},t.font=t.font||"bold 20pt Arial",t.backgroundColor=t.backgroundColor||null,t.fill=t.fill||"black",t.align=t.align||"left",t.boundsAlignH=t.boundsAlignH||"left",t.boundsAlignV=t.boundsAlignV||"top",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.maxLines=t.maxLines||0,t.shadowOffsetX=t.shadowOffsetX||0,t.shadowOffsetY=t.shadowOffsetY||0,t.shadowColor=t.shadowColor||"rgba(0,0,0,0)",t.shadowBlur=t.shadowBlur||0,t.tabs=t.tabs||0;var i=this.fontToComponents(t.font);return t.fontStyle&&(i.fontStyle=t.fontStyle),t.fontVariant&&(i.fontVariant=t.fontVariant),t.fontWeight&&(i.fontWeight=t.fontWeight),t.fontSize&&("number"==typeof t.fontSize&&(t.fontSize=t.fontSize+"px"),i.fontSize=t.fontSize),this._fontComponents=i,t.font=this.componentsToFont(this._fontComponents),this.style=t,this.dirty=!0,e&&this.updateText(),this},o.Text.prototype.updateText=function(){this.texture.baseTexture.resolution=this._res,this.context.font=this.style.font;var t=this.text;this.style.wordWrap&&(t=this.runWordWrap(this.text));var e=t.split(/(?:\r\n|\r|\n)/),i=this.style.tabs,s=[],n=0,o=this.determineFontProperties(this.style.font),a=e.length;this.style.maxLines>0&&this.style.maxLines<e.length&&(a=this.style.maxLines),this._charCount=0;for(var r=0;r<a;r++){if(0===i){var h=this.style.strokeThickness+this.padding.x;this.colors.length>0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?h+=this.measureLine(e[r]):h+=this.context.measureText(e[r]).width,this.style.wordWrap&&(h-=this.context.measureText(" ").width)}else{var l=e[r].split(/(?:\t)/),h=this.padding.x+this.style.strokeThickness;if(Array.isArray(i))for(var c=0,u=0;u<l.length;u++){var d=0;d=this.colors.length>0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?this.measureLine(l[u]):Math.ceil(this.context.measureText(l[u]).width),u>0&&(c+=i[u-1]),h=c+d}else for(var u=0;u<l.length;u++){this.colors.length>0||this.strokeColors.length>0||this.fontWeights.length>0||this.fontStyles.length>0?h+=this.measureLine(l[u]):h+=Math.ceil(this.context.measureText(l[u]).width);var p=this.game.math.snapToCeil(h,i)-h;h+=p}}s[r]=Math.ceil(h),n=Math.max(n,s[r])}this.canvas.width=n*this._res;var f=o.fontSize+this.style.strokeThickness+this.padding.y,y=f*a,g=this._lineSpacing;g<0&&Math.abs(g)>f&&(g=-f),0!==g&&(y+=g>0?g*e.length:g*(e.length-1)),this.canvas.height=y*this._res,this.context.scale(this._res,this._res),navigator.isCocoonJS&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.style.backgroundColor&&(this.context.fillStyle=this.style.backg
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.BitmapText=function(t,e,i,s,n,a,r){e=e||0,i=i||0,s=s||"",n=n||"",a=a||32,r=r||"left",PIXI.DisplayObjectContainer.call(this),this.type=o.BITMAPTEXT,this.physicsType=o.SPRITE,this.textWidth=0,this.textHeight=0,this.anchor=new o.Point,this._prevAnchor=new o.Point,this._glyphs=[],this._maxWidth=0,this._text=n.toString()||"",this._data=t.cache.getBitmapFont(s),this._font=s,this._fontSize=a,this._align=r,this._tint=16777215,this.updateText(),this.dirty=!1,o.Component.Core.init.call(this,t,e,i,"",null)},o.BitmapText.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),o.BitmapText.prototype.constructor=o.BitmapText,o.Component.Core.install.call(o.BitmapText.prototype,["Angle","AutoCull","Bounds","Destroy","FixedToCamera","InputEnabled","InWorld","LifeSpan","PhysicsBody","Reset"]),o.BitmapText.prototype.preUpdatePhysics=o.Component.PhysicsBody.preUpdate,o.BitmapText.prototype.preUpdateLifeSpan=o.Component.LifeSpan.preUpdate,o.BitmapText.prototype.preUpdateInWorld=o.Component.InWorld.preUpdate,o.BitmapText.prototype.preUpdateCore=o.Component.Core.preUpdate,o.BitmapText.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},o.BitmapText.prototype.postUpdate=function(){o.Component.PhysicsBody.postUpdate.call(this),o.Component.FixedToCamera.postUpdate.call(this),this.body&&this.body.type===o.Physics.ARCADE&&(this.textWidth===this.body.sourceWidth&&this.textHeight===this.body.sourceHeight||this.body.setSize(this.textWidth,this.textHeight))},o.BitmapText.prototype.setText=function(t){this.text=t};o.BitmapText.prototype.scanLine=function(t,e,i){for(var s=0,n=0,o=-1,a=0,r=null,h=this._maxWidth>0?this._maxWidth:null,l=[],c=0;c<i.length;c++){var u=c===i.length-1;if(/(?:\r\n|\r|\n)/.test(i.charAt(c)))return{width:n,text:i.substr(0,c),end:u,chars:l};var d=i.charCodeAt(c),p=t.chars[d],f=0;void 0===p&&(d=32,p=t.chars[d]);var y=r&&p.kerning[r]?p.kerning[r]:0;if(/(\s)/.test(i.charAt(c))&&(o=c,a=n),f=(y+p.texture.width+p.xOffset)*e,h&&n+f>=h&&o>-1)return{width:a||n,text:i.substr(0,c-(c-o)),end:u,chars:l};n+=(p.xAdvance+y)*e,l.push(s+(p.xOffset+y)*e),s+=(p.xAdvance+y)*e,r=d}return{width:n,text:i,end:u,chars:l}},o.BitmapText.prototype.cleanText=function(t,e){void 0===e&&(e="");var i=this._data.font;if(!i)return"";for(var s=/\r\n|\n\r|\n|\r/g,n=t.replace(s,"\n").split("\n"),o=0;o<n.length;o++){for(var a="",r=n[o],h=0;h<r.length;h++)a=i.chars[r.charCodeAt(h)]?a.concat(r[h]):a.concat(e);n[o]=a}return n.join("\n")},o.BitmapText.prototype.updateText=function(){var t=this._data.font;if(t){var e=this.text,i=this._fontSize/t.size,s=[],n=0;this.textWidth=0;do{var o=this.scanLine(t,i,e);o.y=n,s.push(o),o.width>this.textWidth&&(this.textWidth=o.width),n+=t.lineHeight*i,e=e.substr(o.text.length+1)}while(!1===o.end);this.textHeight=n;for(var a=0,r=0,h=this.textWidth*this.anchor.x,l=this.textHeight*this.anchor.y,c=0;c<s.length;c++){var o=s[c];"right"===this._align?r=this.textWidth-o.width:"center"===this._align&&(r=(this.textWidth-o.width)/2);for(var u=0;u<o.text.length;u++){var d=o.text.charCodeAt(u),p=t.chars[d];void 0===p&&(d=32,p=t.chars[d]);var f=this._glyphs[a];f?f.texture=p.texture:(f=new PIXI.Sprite(p.texture),f.name=o.text[u],this._glyphs.push(f)),f.position.x=o.chars[u]+r-h,f.position.y=o.y+p.yOffset*i-l,f.scale.set(i),f.tint=this.tint,f.texture.requiresReTint=!0,f.parent||this.addChild(f),a++}}for(c=a;c<this._glyphs.length;c++)this.removeChild(this._glyphs[c])}},o.BitmapText.prototype.purgeGlyphs=function(){for(var t=this._glyphs.length,e=[],i=0;i<this._glyphs.length;i++)this._glyphs[i].parent!==this?this._glyphs[i].destroy():e.push(this._glyphs[i]);return this._glyphs=[],this._glyphs=e,this.updateText(),t-e.length},o.BitmapText.prototype.updateTransform=function(){!this.dirty&&this.anchor.equals(this._prevAnchor)||(this.updateText(),this.dirty=!1,this._prevAnchor.copyFrom(this.anchor)),PIXI.DisplayObjectContainer.prototype.updateTransform.call(this)},Object.defineProperty(o.BitmapText.prototype,"align",{get:function(){return this._align},set:function(t){
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.RetroFont=function(t,e,i,s,n,a,r,h,l,c){if(!t.cache.checkImageKey(e))return!1;void 0!==a&&null!==a||(a=t.cache.getImage(e).width/i),this.characterWidth=i,this.characterHeight=s,this.characterSpacingX=r||0,this.characterSpacingY=h||0,this.characterPerRow=a,this.offsetX=l||0,this.offsetY=c||0,this.align="left",this.multiLine=!1,this.autoUpperCase=!0,this.customSpacingX=0,this.customSpacingY=0,this.fixedWidth=0,this.fontSet=t.cache.getImage(e),this._text="",this.grabData=[],this.frameData=new o.FrameData;for(var u=this.offsetX,d=this.offsetY,p=0,f=0;f<n.length;f++){var y=this.frameData.addFrame(new o.Frame(f,u,d,this.characterWidth,this.characterHeight));this.grabData[n.charCodeAt(f)]=y.index,p++,p===this.characterPerRow?(p=0,u=this.offsetX,d+=this.characterHeight+this.characterSpacingY):u+=this.characterWidth+this.characterSpacingX}t.cache.updateFrameData(e,this.frameData),this.stamp=new o.Image(t,0,0,e,0),o.RenderTexture.call(this,t,100,100,"",o.scaleModes.NEAREST),this.type=o.RETROFONT},o.RetroFont.prototype=Object.create(o.RenderTexture.prototype),o.RetroFont.prototype.constructor=o.RetroFont,o.RetroFont.ALIGN_LEFT="left",o.RetroFont.ALIGN_RIGHT="right",o.RetroFont.ALIGN_CENTER="center",o.RetroFont.TEXT_SET1=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",o.RetroFont.TEXT_SET2=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",o.RetroFont.TEXT_SET3="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",o.RetroFont.TEXT_SET4="ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",o.RetroFont.TEXT_SET5="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",o.RetroFont.TEXT_SET6="ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",o.RetroFont.TEXT_SET7="AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",o.RetroFont.TEXT_SET8="0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",o.RetroFont.TEXT_SET9="ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",o.RetroFont.TEXT_SET10="ABCDEFGHIJKLMNOPQRSTUVWXYZ",o.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",o.RetroFont.prototype.setFixedWidth=function(t,e){void 0===e&&(e="left"),this.fixedWidth=t,this.align=e},o.RetroFont.prototype.setText=function(t,e,i,s,n,o){this.multiLine=e||!1,this.customSpacingX=i||0,this.customSpacingY=s||0,this.align=n||"left",this.autoUpperCase=!o,t.length>0&&(this.text=t)},o.RetroFont.prototype.buildRetroFontText=function(){var t=0,e=0;if(this.clear(),this.multiLine){var i=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,i.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY,!0):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),i.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY,!0);for(var s=0;s<i.length;s++)t=0,this.align===o.RetroFont.ALIGN_RIGHT?t=this.width-i[s].length*(this.characterWidth+this.customSpacingX):this.align===o.RetroFont.ALIGN_CENTER&&(t=this.width/2-i[s].length*(this.characterWidth+this.customSpacingX)/2,t+=this.customSpacingX/2),t<0&&(t=0),this.pasteLine(i[s],t,e,this.customSpacingX),e+=this.characterHeight+this.customSpacingY}else this.fixedWidth>0?this.resize(this.fixedWidth,this.characterHeight,!0):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight,!0),t=0,this.align===o.RetroFont.ALIGN_RIGHT?t=this.width-this._text.length*(this.characterWidth+this.customSpacingX):this.align===o.RetroFont.ALIGN_CENTER&&(t=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,t+=this.customSpacingX/2),t<0&&(t=0),this.pasteLine(this._text,t,0,this.customSpacingX);this.requiresReTint=!0},o.RetroFont.prototype.pasteLine=function(t,e,i,s){for(var n=0;n<t.length;n++)if(" "===t.charAt(n))e+=this.characterWidth+s;else if(this.grabData[t.charCodeAt(n)]>=0&&(this.stamp.frame=this.grabData[t.charCodeAt(n)],this.renderXY(this.stamp,e,i,!1),(e+=this.characterWidth+s)>this.width))break},o.RetroFont.prototype.getLongestLine=function(){var t=0;if(this._text.length>0)for(var e=this._text.split("\n"),i=0;i<e.length;i++)e[i].length>t&&(t=e[i].length);return t},o.RetroFont.prototype
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd, Richard Davey
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Rope=function(t,e,i,s,n,a){this.points=[],this.points=a,this._hasUpdateAnimation=!1,this._updateAnimationCallback=null,e=e||0,i=i||0,s=s||null,n=n||null,this.type=o.ROPE,PIXI.Rope.call(this,o.Cache.DEFAULT,this.points),o.Component.Core.init.call(this,t,e,i,s,n)},o.Rope.prototype=Object.create(PIXI.Rope.prototype),o.Rope.prototype.constructor=o.Rope,o.Component.Core.install.call(o.Rope.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Delta","Destroy","FixedToCamera","InWorld","LifeSpan","LoadTexture","Overlap","PhysicsBody","Reset","ScaleMinMax","Smoothed"]),o.Rope.prototype.preUpdatePhysics=o.Component.PhysicsBody.preUpdate,o.Rope.prototype.preUpdateLifeSpan=o.Component.LifeSpan.preUpdate,o.Rope.prototype.preUpdateInWorld=o.Component.InWorld.preUpdate,o.Rope.prototype.preUpdateCore=o.Component.Core.preUpdate,o.Rope.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},o.Rope.prototype.update=function(){this._hasUpdateAnimation&&this.updateAnimation.call(this)},o.Rope.prototype.reset=function(t,e){return o.Component.Reset.prototype.reset.call(this,t,e),this},Object.defineProperty(o.Rope.prototype,"updateAnimation",{get:function(){return this._updateAnimation},set:function(t){t&&"function"==typeof t?(this._hasUpdateAnimation=!0,this._updateAnimation=t):(this._hasUpdateAnimation=!1,this._updateAnimation=null)}}),Object.defineProperty(o.Rope.prototype,"segments",{get:function(){for(var t=[],e,i,s,n,a,r,h,l,c=0;c<this.points.length;c++)e=4*c,i=this.vertices[e]*this.scale.x,s=this.vertices[e+1]*this.scale.y,n=this.vertices[e+4]*this.scale.x,a=this.vertices[e+3]*this.scale.y,r=o.Math.difference(i,n),h=o.Math.difference(s,a),i+=this.world.x,s+=this.world.y,l=new o.Rectangle(i,s,r,h),t.push(l);return t}}),/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.TileSprite=function(t,e,i,s,n,a,r){e=e||0,i=i||0,s=s||256,n=n||256,a=a||null,r=r||null,this.type=o.TILESPRITE,this.physicsType=o.SPRITE,this._scroll=new o.Point;var h=t.cache.getImage("__default",!0);PIXI.TilingSprite.call(this,new PIXI.Texture(h.base),s,n),o.Component.Core.init.call(this,t,e,i,a,r)},o.TileSprite.prototype=Object.create(PIXI.TilingSprite.prototype),o.TileSprite.prototype.constructor=o.TileSprite,o.Component.Core.install.call(o.TileSprite.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Destroy","FixedToCamera","Health","InCamera","InputEnabled","InWorld","LifeSpan","LoadTexture","Overlap","PhysicsBody","Reset","Smoothed"]),o.TileSprite.prototype.preUpdatePhysics=o.Component.PhysicsBody.preUpdate,o.TileSprite.prototype.preUpdateLifeSpan=o.Component.LifeSpan.preUpdate,o.TileSprite.prototype.preUpdateInWorld=o.Component.InWorld.preUpdate,o.TileSprite.prototype.preUpdateCore=o.Component.Core.preUpdate,o.TileSprite.prototype.preUpdate=function(){return 0!==this._scroll.x&&(this.tilePosition.x+=this._scroll.x*this.game.time.physicsElapsed),0!==this._scroll.y&&(this.tilePosition.y+=this._scroll.y*this.game.time.physicsElapsed),!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},o.TileSprite.prototype.autoScroll=function(t,e){this._scroll.set(t,e)},o.TileSprite.prototype.stopScroll=function(){this._scroll.set(0,0)},o.TileSprite.prototype.destroy=function(t){o.Component.Destroy.prototype.destroy.call(this,t),PIXI.TilingSprite.prototype.destroy.call(this)},o.TileSprite.prototype.reset=function(t,e){return o.Component.Reset.prototype.reset.call(this,t,e),this.tilePosition.x=0,this.tilePosition.y=0,this},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Device=function(){this.deviceReadyAt=0,this.initialized=!1,this.desktop=!1,this.iOS=!1,this.iOSVersion=0,this.cocoonJS=!1,this.cocoonJSApp=!1,this.cordova=!1,this.node=!1,this.nodeWebkit=!1,this.electron=!1,this.ejecta=!1,this.crosswalk=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.canvasBitBltShift=null,this.webGL=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.worker=!1,this.css3D=!1,this.pointerLock=!1,this.typedArray=!1,this.vibration=!1,this.getUserMedia=!0,this.quirksMode=!1,this.touch=!1,this.mspointer=!1,this.wheelEvent=null,this.arora=!1,this.chrome=!1,this.chromeVersion=0,this.epiphany=!1,this.firefox=!1,this.firefoxVersion=0,this.ie=!1,this.ieVersion=0,this.trident=!1,this.tridentVersion=0,this.edge=!1,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.safariVersion=0,this.webApp=!1,this.silk=!1,this.audioData=!1,this.webAudio=!1,this.ogg=!1,this.opus=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.webm=!1,this.dolby=!1,this.oggVideo=!1,this.h264Video=!1,this.mp4Video=!1,this.webmVideo=!1,this.vp9Video=!1,this.hlsVideo=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this.littleEndian=!1,this.LITTLE_ENDIAN=!1,this.support32bit=!1,this.fullscreen=!1,this.requestFullscreen="",this.cancelFullscreen="",this.fullscreenKeyboard=!1},o.Device=new o.Device,o.Device.onInitialized=new o.Signal,o.Device.whenReady=function(t,e,i){var s=this._readyCheck;if(this.deviceReadyAt||!s)t.call(e,this);else if(s._monitor||i)s._queue=s._queue||[],s._queue.push([t,e]);else{s._monitor=s.bind(this),s._queue=s._queue||[],s._queue.push([t,e]);var n=void 0!==window.cordova,o=navigator.isCocoonJS;"complete"===document.readyState||"interactive"===document.readyState?window.setTimeout(s._monitor,0):n&&!o?document.addEventListener("deviceready",s._monitor,!1):(document.addEventListener("DOMContentLoaded",s._monitor,!1),window.addEventListener("load",s._monitor,!1))}},o.Device._readyCheck=function(){var t=this._readyCheck;if(document.body){if(!this.deviceReadyAt){this.deviceReadyAt=Date.now(),document.removeEventListener("deviceready",t._monitor),document.removeEventListener("DOMContentLoaded",t._monitor),window.removeEventListener("load",t._monitor),this._initialize(),this.initialized=!0,this.onInitialized.dispatch(this);for(var e;e=t._queue.shift();){var i=e[0],s=e[1];i.call(s,this)}this._readyCheck=null,this._initialize=null,this.onInitialized=null}}else window.setTimeout(t._monitor,20)},o.Device._initialize=function(){function t(){var t=navigator.userAgent;/Playstation Vita/.test(t)?d.vita=!0:/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?d.kindle=!0:/Android/.test(t)?d.android=!0:/CrOS/.test(t)?d.chromeOS=!0:/iP[ao]d|iPhone/i.test(t)?(d.iOS=!0,navigator.appVersion.match(/OS (\d+)/),d.iOSVersion=parseInt(RegExp.$1,10)):/Linux/.test(t)?d.linux=!0:/Mac OS/.test(t)?d.macOS=!0:/Windows/.test(t)&&(d.windows=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(d.android=!1,d.iOS=!1,d.macOS=!1,d.windows=!0,d.windowsPhone=!0);var e=/Silk/.test(t);(d.windows||d.macOS||d.linux&&!e||d.chromeOS)&&(d.desktop=!0),(d.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(d.desktop=!1)}function e(){d.canvas=!!window.CanvasRenderingContext2D||d.cocoonJS;try{d.localStorage=!!localStorage.getItem}catch(t){d.localStorage=!1}d.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),d.fileSystem=!!window.requestFileSystem;var t={stencil:!0};d.webGL=function(){try{var e=document.createElement("canvas");return e.screencanvas=!1,!!window.WebGLRenderingContext&&(e.getContext("webgl",t)||e.getContext("experimental-webgl",t))}catch(t){return!1}}(),d.webGL=!!d.webGL,d.worker=!!window.Worker,d.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,d.quirksMode="CSS1Compat"!==document.compatMode,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMed
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Canvas={create:function(t,e,i,s,n){e=e||256,i=i||256;var o=n?document.createElement("canvas"):PIXI.CanvasPool.create(t,e,i);return"string"==typeof s&&""!==s&&(o.id=s),o.width=e,o.height=i,o.style.display="block",o},setBackgroundColor:function(t,e){return e=e||"rgb(0,0,0)",t.style.backgroundColor=e,t},setTouchAction:function(t,e){return e=e||"none",t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t},setUserSelect:function(t,e){return e=e||"none",t.style["-webkit-touch-callout"]=e,t.style["-webkit-user-select"]=e,t.style["-khtml-user-select"]=e,t.style["-moz-user-select"]=e,t.style["-ms-user-select"]=e,t.style["user-select"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t},addToDOM:function(t,e,i){var s;return void 0===i&&(i=!0),e&&("string"==typeof e?s=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(s=e)),s||(s=document.body),i&&s.style&&(s.style.overflow="hidden"),s.appendChild(t),t},removeFromDOM:function(t){t.parentNode&&t.parentNode.removeChild(t)},setTransform:function(t,e,i,s,n,o,a){return t.setTransform(s,o,a,n,e,i),t},setSmoothingEnabled:function(t,e){var i=o.Canvas.getSmoothingPrefix(t);return i&&(t[i]=e),t},getSmoothingPrefix:function(t){var e=["i","webkitI","msI","mozI","oI"];for(var i in e){var s=e[i]+"mageSmoothingEnabled";if(s in t)return s}return null},getSmoothingEnabled:function(t){var e=o.Canvas.getSmoothingPrefix(t);if(e)return t[e]},setImageRenderingCrisp:function(t){for(var e=["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"],i=0;i<e.length;i++)t.style["image-rendering"]=e[i];return t.style.msInterpolationMode="nearest-neighbor",t},setImageRenderingBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}},/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.RequestAnimationFrame=function(t,e){void 0===e&&(e=!1),this.game=t,this.isRunning=!1,this.forceSetTimeOut=e;for(var i=["ms","moz","webkit","o"],s=0;s<i.length&&!window.requestAnimationFrame;s++)window.requestAnimationFrame=window[i[s]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[i[s]+"CancelAnimationFrame"];this._isSetTimeOut=!1,this._onLoop=null,this._timeOutID=null},o.RequestAnimationFrame.prototype={start:function(){this.isRunning=!0;var t=this;!window.requestAnimationFrame||this.forceSetTimeOut?(this._isSetTimeOut=!0,this._onLoop=function(){return t.updateSetTimeout()},this._timeOutID=window.setTimeout(this._onLoop,0)):(this._isSetTimeOut=!1,this._onLoop=function(e){return t.updateRAF(e)},this._timeOutID=window.requestAnimationFrame(this._onLoop))},updateRAF:function(t){this.isRunning&&(this.game.update(Math.floor(t)),this._timeOutID=window.requestAnimationFrame(this._onLoop))},updateSetTimeout:function(){this.isRunning&&(this.game.update(Date.now()),this._timeOutID=window.setTimeout(this._onLoop,this.game.time.timeToCall))},stop:function(){this._isSetTimeOut?clearTimeout(this._timeOutID):window.cancelAnimationFrame(this._timeOutID),this.isRunning=!1},isSetTimeOut:function(){return this._isSetTimeOut},isRAF:function(){return!1===this._isSetTimeOut}},o.RequestAnimationFrame.prototype.constructor=o.RequestAnimationFrame,/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
o.Math={PI2:2*Math.PI,between:function(t,e){return Math.floor(Math.random()*(e-t+1)+t)},fuzzyEqual:function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i},fuzzyLessThan:function(t,e,i){return void 0===i&&(i=1e-4),t<e+i},fuzzyGreaterThan:function(t,e,i){return void 0===i&&(i=1e-4),t>e-i},fuzzyCeil:function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)},fuzzyFloor:function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)},average:function(){for(var t=0,e=arguments.length,i=0;i<e;i++)t+=+arguments[i];return t/e},shear:function(t){return t%1},snapTo:function(t,e,i){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),i+t)},snapToFloor:function(t,e,i){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),i+t)},snapToCeil:function(t,e,i){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),i+t)},roundTo:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s},floorTo:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s},ceilTo:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s},rotateToAngle:function(t,e,i){return void 0===i&&(i=.05),t===e?t:(Math.abs(e-t)<=i||Math.abs(e-t)>=o.Math.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=o.Math.PI2:e-=o.Math.PI2),e>t?t+=i:e<t&&(t-=i)),t)},getShortestAngle:function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)},angleBetween:function(t,e,i,s){return Math.atan2(s-e,i-t)},angleBetweenY:function(t,e,i,s){return Math.atan2(i-t,s-e)},angleBetweenPoints:function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},angleBetweenPointsY:function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)},reverseAngle:function(t){return this.normalizeAngle(t+Math.PI,!0)},normalizeAngle:function(t){return t%=2*Math.PI,t>=0?t:t+2*Math.PI},maxAdd:function(t,e,i){return Math.min(t+e,i)},minSub:function(t,e,i){return Math.max(t-e,i)},wrap:function(t,e,i){var s=i-e;if(s<=0)return 0;var n=(t-e)%s;return n<0&&(n+=s),n+e},wrapValue:function(t,e,i){var s;return t=Math.abs(t),e=Math.abs(e),i=Math.abs(i),s=(t+e)%i},isOdd:function(t){return!!(1&t)},isEven:function(t){return!(1&t)},min:function(){if(1===arguments.length&&"object"==typeof arguments[0])var t=arguments[0];else var t=arguments;for(var e=1,i=0,s=t.length;e<s;e++)t[e]<t[i]&&(i=e);return t[i]},max:function(){if(1===arguments.length&&"object"==typeof arguments[0])var t=arguments[0];else var t=arguments;for(var e=1,i=0,s=t.length;e<s;e++)t[e]>t[i]&&(i=e);return t[i]},minProperty:function(t){if(2===arguments.length&&"object"==typeof arguments[1])var e=arguments[1];else var e=arguments.slice(1);for(var i=1,s=0,n=e.length;i<n;i++)e[i][t]<e[s][t]&&(s=i);return e[s][t]},maxProperty:function(t){if(2===arguments.length&&"object"==typeof arguments[1])var e=arguments[1];else var e=arguments.slice(1);for(var i=1,s=0,n=e.length;i<n;i++)e[i][t]>e[s][t]&&(s=i);return e[s][t]},wrapAngle:function(t,e){return e?this.wrap(t,-Math.PI,Math.PI):this.wrap(t,-180,180)},linearInterpolation:function(t,e){var i=t.length-1,s=i*e,n=Math.floor(s);return e<0?this.linear(t[0],t[1],s):e>1?this.linear(t[i],t[i-1],i-s):this.linear(t[n],t[n+1>i?i:n+1],s-n)},bezierInterpolation:function(t,e){for(var i=0,s=t.length-1,n=0;n<=s;n++)i+=Math.pow(1-e,s-n)*Math.pow(e,n)*t[n]*this.bernstein(s,n);return i},catmullRomInterpolation:function(t,e){var i=t.length-1,s=i*e,n=Math.floor(s);return t[0]===t[i]?(e<0&&(n=Math.floor(s=i*(1+e))),this.catmullRom(t[(n-1+i)%i],t[n],t[(n+1)%i],t[(n+2)%i],s-n)):e<0?t[0]-(this.catmullRom(t[0],t[0],t[1],t[1],-s)-t[0]):e>1?t[i]-(this.catmullRom(t[i],t[i],t[i-1],t[i-1],s-i)-t[i]):this.catmullRom(t[n?n-1:0],t[n],t[i<n+1?i:n+1],t[i<n+2?i:n+2],s-n)},linear:function(t,e,i){return(e-t)*i+t},bernstein:function(t,e){return this.factorial(t)/this.factorial(e)/this.factorial(t-e)},factorial:function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e},catmullRom:function(t,e,i,s,n){var o=.5*(i-t),a=.5*(s-e),r=n*n;return(2*e-2*i+o+a)*(n*r)+(-3*e+3*i-2*o-a)*r+o*n+e},difference:function(t,e){return Math.abs(t-e)},roundAwayFromZero:function(t){r
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Timo Hausmann
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Jeremy Dowell <jeremy@codevinsky.com>
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Georgios Kaleadis https://github.com/georgiee
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author George https://github.com/georgiee
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
return o.Math.degToRad=function t(e){return e*p},o.Math.radToDeg=function t(e){return e*f},o.RandomDataGenerator=function(t){void 0===t&&(t=[]),this.c=1,this.s0=0,this.s1=0,this.s2=0,"string"==typeof t?this.state(t):this.sow(t)},o.RandomDataGenerator.prototype={rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},sow:function(t){if(this.s0=this.hash(" "),this.s1=this.hash(this.s0),this.s2=this.hash(this.s1),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},hash:function(t){var e,i,s;for(s=4022871197,t=t.toString(),i=0;i<t.length;i++)s+=t.charCodeAt(i),e=.02519603282416938*s,s=e>>>0,e-=s,e*=s,s=e>>>0,e-=s,s+=4294967296*e;return 2.3283064365386963e-10*(s>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return this.integerInRange(t,e)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick([-1,1])},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")}},o.RandomDataGenerator.prototype.constructor=o.RandomDataGenerator,o.QuadTree=function(t,e,i,s,n,o,a){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this._empty=[],this.reset(t,e,i,s,n,o,a)},o.QuadTree.prototype={reset:function(t,e,i,s,n,o,a){this.maxObjects=n||10,this.maxLevels=o||4,this.level=a||0,this.bounds={x:Math.round(t),y:Math.round(e),width:i,height:s,subWidth:Math.floor(i/2),subHeight:Math.floor(s/2),right:Math.round(t)+Math.floor(i/2),bottom:Math.round(e)+Math.floor(s/2)},this.objects.length=0,this.nodes.length=0},populate:function(t){t.forEach(this.populateHandler,this,!0)},populateHandler:function(t){t.body&&t.exists&&this.insert(t.body)},split:function(){this.nodes[0]=new o.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1),this.nodes[1]=new o.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1),this.nodes[2]=new o.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1),this.nodes[3]=new o.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1)},insert:function(t){var e=0,i;if(null!=this.nodes[0]&&-1!==(i=this.getIndex(t)))return void this.nodes[i].insert(t);if(this.objects.push(t),this.objects.length>this.maxObjects&&this.level<this.maxLevels)for(null==this.nodes[0]&&this.split();e<this.objects.length;)i=this.getIndex(this.objects[e]),-1!==i?this.nodes[i].insert(this.objects.splice(e,1)[0]):e++},getIndex:function(t){var e=-1;return t.x<this.bounds.right&&t.right<this.bounds.right?t.y<this.bounds.bottom&&t.bottom<this.bounds.bottom?e=1:t.y>this.bounds.bottom&&(e=2):t.x>this.bounds.right&&(t.y<this.bounds.bottom&&t.bottom<this.bounds.bottom?e=0:t.y>this.bounds.bottom&&(e=3)),e},retrieve:function(t){if(t instanceof o.Rectangle)var e=this.objects,i=this.getIndex(t);else{if(!t.body)return this