From c6faa7c8a7f1dac9a06a629458c0c05f4eaa6602 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Mon, 1 Oct 2018 14:44:42 +0100 Subject: [PATCH] 3.14 Release --- CHANGELOG.md | 42 +- README.md | 276 +- dist/phaser-arcade-physics.js | 6809 +++++++------ dist/phaser-arcade-physics.min.js | 2 +- dist/phaser-facebook-instant-games.js | 10387 +++++++++++--------- dist/phaser-facebook-instant-games.min.js | 2 +- dist/phaser.js | 8639 ++++++++-------- dist/phaser.min.js | 2 +- package.json | 2 +- src/const.js | 2 +- 10 files changed, 14338 insertions(+), 11825 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 720a77086..bd8715c7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## Version 3.14.0 - Tachikoma - in development +## Version 3.14.0 - Tachikoma - 1st October 2018 ### Tilemap New Features, Updates and Fixes @@ -84,41 +84,11 @@ Also, thanks to the following for helping with the Phaser 3 Examples and TypeScr ### Phaser Doc Jam -31826615 -@16patsle -@bobonthenet -@bobonthenet -@rgk -@samme -@shaneMLK -@wemyss -ajmetal -andiCR -Arian Fornaris -bsparks -Carl -cyantree -DannyT -Elliott Wallace -felixnemis -griga -Hardylr -henriacle -Hsaka -icbat -Kanthi -Kyle -Lee -Nathaniel Foldan -Peter Pedersen -rootasjey -Sam Frantz -SBCGames -snowbillr -Stephen Hamilton -STuFF -TadejZupancic -telinc1 +The [Phaser Doc Jam](http://docjam.phaser.io) is an on-going effort to ensure that the Phaser 3 API has 100% documentation coverage. Thanks to the monumental effort of myself and the following people we're now really close to that goal! My thanks to: + +31826615 - @16patsle - @bobonthenet - @rgk - @samme - @shaneMLK - @wemyss - ajmetal - andiCR - Arian Fornaris - bsparks - Carl - cyantree - DannyT - Elliott Wallace - felixnemis - griga - Hardylr - henriacle - Hsaka - icbat - Kanthi - Kyle - Lee - Nathaniel Foldan - Peter Pedersen - rootasjey - Sam Frantz - SBCGames - snowbillr - Stephen Hamilton - STuFF - TadejZupancic - telinc1 + +If you'd like to help finish off the last parts of documentation then take a look at the [Doc Jam site](http://docjam.phaser.io). ## Version 3.13.0 - Yuuki - 20th September 2018 diff --git a/README.md b/README.md index c77b7e09f..12988116b 100644 --- a/README.md +++ b/README.md @@ -24,25 +24,23 @@ Grab the source and join the fun!
-> 20th September 2018 +> 1st October 2018 -Phaser 3.13 is now available. The main feature introduced in this release is the Facebook Instant Games Plugin. The plugin provides a seamless bridge between Phaser and version 6.2 of the Facebook Instant Games SDK. Every single SDK function is available via the plugin and we will keep track of the official SDK to make sure they stay in sync. My thanks to Facebook for helping make this possible. +I'm pleased to announce that Phaser 3.14 is now out. Hot on the heels of the massive 3.13 release, 3.14 brings some sought-after new features to the party, including support for the new Tiled Map Editor 1.2 file formats, as well as the long-requested feature allowing use of multiple tilesets per single tilemap layer. -Also in this release is the brand new Shape Game Object, which allows for easy and quick addition of geometry onto the display list. Easily add rectangles, triangles, curves, stars and more into your game and treat them just like any other Game Object. Perfect for place-holder art, abstract style games or just really fast iterations game-jam style. +There are also new features to make Matter JS debugging easier and body creation when using lists of vertices is now much cleaner too. It's never just features though. There are lots of important fixes and updates in 3.14, including a fix causing gl canvas resizing to fail, better handling of the game shutdown process and fixes for an issue with Graphics.generateTexture. -It doesn't end there either. There are some important changes to Pointer Events, lots of updates and fixes and more documentation updates too. My thanks to the highly active community for helping out, reporting issues and providing PRs. I'd urge you to carefully read the Change Log, especially if upgrading from an earlier version in an existing project. +If you're building an active project on 3.13 then please upgrade to 3.14 and, as usual, report any issues you find on GitHub so we can look at them immediately. Also, in the 3.14 release we have completed over 1000 new areas of documentation. At the time of writing there are now just 1900 items in the API left to document, which may sound like a lot, but is a fraction of the tens of thousands already done! With our current progress we should have 100% documentation coverage within the next couple of months. -3.13 yet again represents tireless effort on my part to get it fully production ready. I'm seeing lots more games being released with Phaser 3 and stacks of tutorials and plugins are starting to surface. My aim has always been to continue the mission of enhancing Phaser 3 as quickly as I can. It means releasing significant updates in relatively short periods of time. But it also means I'm jumping on bug reports as quickly as I can, keeping the issues list total nice and low (the vast majority of the items in there are feature requests now!) - a massive thank-you to all of you who support Phaser on Patreon and PayPal. It's your support that allows me to work on this full-time, to the benefit of everyone. +In case you missed the notice, Phaser 3.13 introduced the Facebook Instant Games Plugin. The plugin provides a seamless bridge between Phaser and version 6.2 of the Facebook Instant Games SDK. Every single SDK function is available via the plugin and we will keep track of the official SDK to make sure they stay in sync. My thanks to Facebook for helping make this possible. + +Also new in 3.13 were the Shape Game Objects, which allows for quick addition of geometry onto the display list. Easily add rectangles, triangles, curves, stars and more into your game and treat them just like any other Game Object. Perfect for place-holder art, abstract style games or just really fast iterations game-jam style. + +3.14 continues to represent the tireless effort on my part to get it fully production ready. I'm seeing lots more games being released with Phaser 3 and stacks of tutorials and plugins are starting to surface. My aim has always been to continue the mission of enhancing Phaser 3 as quickly as I can. It means releasing significant updates in relatively short periods of time. But it also means I'm jumping on bug reports as quickly as I can, keeping the issues list total nice and low (the vast majority of the items in there are feature requests now!) - a massive thank-you to all of you who support Phaser on Patreon and PayPal. It's your support that allows me to work on this full-time, to the benefit of everyone. As always, please check out the [Change Log](#changelog) for comprehensive details about what recent versions contain. -**About Phaser 3** - -After 1.5 years in the making, tens of thousands of lines of code, hundreds of examples and countless hours of relentless work: Phaser 3 is finally out. It has been a real labor of love and then some! - -This has been a great new chapter in Phaser's life. I will continue to jump on bug reports as quickly as possible and ensure the releases keep flowing. - -If you'd like to stay abreast of developments then I publish the [Developer Logs](https://phaser.io/phaser3/devlog) in the [Phaser World](https://phaser.io/community/newsletter) newsletter. Subscribe to stay in touch and get all the latest news from the core team and the wider community. +If you'd like to stay abreast of developments then I publish my [Developer Logs](https://phaser.io/phaser3/devlog) in the [Phaser World](https://phaser.io/community/newsletter) newsletter. Subscribe to stay in touch and get all the latest news from the core team and the wider community. You can also follow Phaser on [Twitter](https://twitter.com/phaser_) and chat with fellow Phaser devs in our [Slack](https://phaser.io/community/slack) and [Discord](https://phaser.io/community/discord) channels. @@ -191,6 +189,30 @@ The build files are in the git repository in the `dist` folder, and you can also During our development of Phaser 3, we created hundreds of examples with the full source code and assets ready available. Until these examples are fully integrated into the Phaser website, you can browse them on [Phaser 3 Labs](https://labs.phaser.io), or clone the [examples repo][examples]. We are constantly adding to and refining these examples. +### Facebook Instant Games + +Phaser 3.13 introduced the new Facebook Instant Games Plugin. The plugin provides a seamless bridge between Phaser and version 6.2 of the Facebook Instant Games SDK. Every single SDK function is available via the plugin and we will keep track of the official SDK to make sure they stay in sync. + +The plugin offers the following features: + +* Easy integration with the Phaser Loader so load events update the Facebook progress circle. +* Events for every plugin method, allowing the async calls of the SDK to be correctly inserted into the Phaser game flow. When SDK calls resolve they will surface naturally as a Phaser event and you'll know you can safely act upon them without potentially doing something mid-way through the game step. +* All Plugin methods check if the call is part of the supported APIs available in the SDK, without needing to launch an async request first. +* Instant access to platform, player and locale data. +* Easily load player photos directly into the Texture Manager, ready for use with a Game Object. +* Subscribe to game bots. +* The plugin has a built-in Data Manager which makes dealing with data stored on Facebook seamless. Just create whatever data properties you need and they are automatically synced. +* Support for FB stats, to retrieve, store and increment stats into cloud storage. +* Save Session data with built-in session length validation. +* Easy context switching, to swap between game instances and session data retrieval. +* Easily open a Facebook share, invite, request or game challenge window and populate the text and image content using any image stored in the Texture cache. +* Full Leaderboard support. Retrieve, scan and update leaderboard entries, as well as player matching. +* Support for in-app purchases, with product catalogs, the ability to handle purchases, get past purchases and consume previously unlocked purchases. +* Easily preload a set of interstitial ads, in both banner and video form, then display the ad at any point in your game, with in-built tracking of ads displayed and inventory available. +* Plus other features, such as logging to FB Analytics, creating short cuts, switching games, etc. + +The plugin is fully documented and official tutorials and project templates will follow shortly. + ### Create Your First Phaser 3 Example Create an `index.html` page locally and paste the following code into it: @@ -310,175 +332,95 @@ You can then run `webpack` to create a development build in the `build` folder w # Change Log -## Version 3.13.0 - Yuuki - 20th September 2018 +## Version 3.14.0 - Tachikoma - 1st October 2018 -### Facebook Instant Games Plugin +### Tilemap New Features, Updates and Fixes -Phaser 3.13 introduces the new Facebook Instant Games Plugin. The plugin provides a seamless bridge between Phaser and version 6.2 of the Facebook Instant Games SDK. Every single SDK function is available via the plugin and we will keep track of the official SDK to make sure they stay in sync. - -The plugin offers the following features: - -* Easy integration with the Phaser Loader so load events update the Facebook progress circle. -* Events for every plugin method, allowing the async calls of the SDK to be correctly inserted into the Phaser game flow. When SDK calls resolve they will surface naturally as a Phaser event and you'll know you can safely act upon them without potentially doing something mid-way through the game step. -* All Plugin methods check if the call is part of the supported APIs available in the SDK, without needing to launch an async request first. -* Instant access to platform, player and locale data. -* Easily load player photos directly into the Texture Manager, ready for use with a Game Object. -* Subscribe to game bots. -* The plugin has a built-in Data Manager which makes dealing with data stored on Facebook seamless. Just create whatever data properties you need and they are automatically synced. -* Support for FB stats, to retrieve, store and increment stats into cloud storage. -* Save Session data with built-in session length validation. -* Easy context switching, to swap between game instances and session data retrieval. -* Easily open a Facebook share, invite, request or game challenge window and populate the text and image content using any image stored in the Texture cache. -* Full Leaderboard support. Retrieve, scan and update leaderboard entries, as well as player matching. -* Support for in-app purchases, with product catalogs, the ability to handle purchases, get past purchases and consume previously unlocked purchases. -* Easily preload a set of interstitial ads, in both banner and video form, then display the ad at any point in your game, with in-built tracking of ads displayed and inventory available. -* Plus other features, such as logging to FB Analytics, creating short cuts, switching games, etc. - -The plugin is fully documented and official tutorials and project templates will follow shortly. - -### New Shape Game Objects - -Phaser 3.13 has a new Game Object called `Shape`, which by itself isn't much use because it's a base class. However, extending that class are 11 different types of Shape (with more to come) and you can use it to create your own custom Shapes as well. Shapes are added to the display list in the exact same way as any other Game Object. For example: - -``` -this.add.rectangle(400, 300, 500, 120, 0x00ff00); -``` - -Here we're creating a new Rectangle shape. It's positioned at 400 x 300 in the Scene and has a size of 500 x 120 pixels. The final value is the fill color. - -The thing to remember is that you can treat this Shape just like you'd treat any other Game Object. You can scale it, rotate it, alpha it, blend mode it, change its origin, give it a Camera scroll factor, put it inside a Container or Group, give it input abilities or even give it a physics body. It is, to all intents and purposes, a normal Game Object. The only difference is that when rendering it uses its own special bit of display code. - -The shapes available are as follows: - -* `GameObject.Arc` - The arc allows you to draw either a circle, or part of a circle. You can set the start and end angle, if the rotation is clockwise or not, and even set the number of iterations the arc will use during rendering. -* `GameObject.Curve` - The Curve Shape can take any Phaser Curve object, such as a Spline or Bezier Curve, and add it to the display list. -* `GameObject.Ellipse` - An ellipse shape, which is essentially a circle with a differing width and height. It can be filled or stroked (or both!) and as with the arc you can set the 'smoothness' of it, allowing you to decrease the number of points used when creating its polygon data. -* `GameObject.Grid` - The Grid Shape object allows you to generate them. You can set the width and height of the grid itself, as well as for the grid cells. The grid can either have a single color, or alternating cell colors and even have outline spacing between the cells, or not. -* `GameObject.Line` - Create a Line Shape drawn between any two points, with a color and thickness. In WebGL you can also specify a different thickness for the start and end of the line. -* `GameObject.Polygon` - A Polygon is effectively a list of points that is drawn between. The points can be provided in a number of different ways (as Vec2 objects, as an array, etc) and then you can either fill or stroke the resulting shape, or both. -* `GameObject.Rectangle` - Simple, but powerful and endlessly useful. Set a width and height and it'll display a Rectangle, with control over the size, fill color and stroke color. -* `GameObject.Star` - The Star shape does as its name suggests: it displays a star. You can control the number of points in the star as well as the inner and outer radius of it. -* `GameObject.Triangle` - A Triangular shape with full control over the points used to make it and its fill and stroke colors. Internally it uses the `batchFillTriangle` method in WebGL, making it actually faster to draw than a Quad! Use them happily for bullets or abstract space ships, or anything else you feel like. -* `GameObject.IsoTriangle` - This draws an isometric triangle, like a pyramid. You can control the colors of each face, if the pyramid is upside down or not and the width and height of it. -* `GameObject.IsoBox` - This draws an isometric box. You can set the colors for each face of the box, as well as the projection angle and also which of the 3 faces are drawn. - -All of the Shape objects render in both Canvas and WebGL and are available via the Game Object Factory. - -### Pointer and Input Event Updates - -The specificity if the input events has been changed to allow you more control over event handling. Previously, the InputPlugin would emit the global `pointerdown` event first, and then the Game Object itself would emit the `pointerdown` event and finally the InputPlugin would emit the `gameobjectdown` event. - -The order has now changed. The Game Object will dispatch its `pointerdown` event first. The InputPlugin will then dispatch `gameobjectdown` and finally the less specific of them all, `pointerdown` will be dispatched. - -New in 3.13 is the ability to cancel this at any stage. All events are now sent an event object which you can call `event.stopPropagation()` on. This will immediately stop any further listeners from being invoked. If you call `stopPropagation()` after the first Game Object `pointerdown` event, then no more Game Object's will receive their callbacks and the InputPlugin will not dispatch either of its events. - -This change has been introduced for `pointerdown`, `pointerup`, `pointermove`, `pointerover` and `pointerout`. No other data is included in the `event` object in this release. - -* The Game Object `pointerdown` callback signature has changed. It used to send `pointer, x, y, camera` to the listener. It now sends `pointer, x, y, event` to the listener. If you still need the `camera` property you can get it from `pointer.camera`. -* The Game Object `gameobjectdown` callback signature has a new argument. It now sends `event` as the 3rd argument. -* The `pointerdown` event, as dispatched by the InputPlugin, is now sent _after_ the Game Object specific events (`GameObject.pointerdown` and `gameobjectdown`). This gives you the chance to cancel the event before the global listener receives it. -* The Game Object `pointerup` callback signature has a new argument. It now sends the `event` as the 4th argument. -* The Game Object `gameobjectup` callback signature has a new argument. It now sends `event` as the 3rd argument. -* The `pointerup` event, as dispatched by the InputPlugin, is now sent _after_ the Game Object specific events (`GameObject.pointerup` and `gameobjectup`). This gives you the chance to cancel the event before the global listener receives it. -* The Game Object `pointermove` callback signature has a new argument. It now sends the `event` as the 4th argument. -* The Game Object `gameobjectmove` callback signature has a new argument. It now sends `event` as the 3rd argument. -* The `pointermove` event, as dispatched by the InputPlugin, is now sent _after_ the Game Object specific events (`GameObject.pointermove` and `gameobjectmove`). This gives you the chance to cancel the event before the global listener receives it. -* The Game Object `pointerover` callback signature has a new argument. It now sends the `event` as the 4th argument. -* The Game Object `gameobjectover` callback signature has a new argument. It now sends `event` as the 3rd argument. -* The `pointerover` event, as dispatched by the InputPlugin, is now sent _after_ the Game Object specific events (`GameObject.pointerover` and `gameobjectover`). This gives you the chance to cancel the event before the global listener receives it. -* The Game Object `pointerout` callback signature has a new argument. It now sends the `event` as the 2nd argument. -* The Game Object `gameobjectout` callback signature has a new argument. It now sends `event` as the 3rd argument. -* The `pointerout` event, as dispatched by the InputPlugin, is now sent _after_ the Game Object specific events (`GameObject.pointerout` and `gameobjectout`). This gives you the chance to cancel the event before the global listener receives it. - -### Game Object List Updates - -When Sprite's are created they are added to two lists within the Scene - the Display List and the Update List. Under 3.12 when a Scene was shut down it would emit a `shutdown` event, which Sprites listened out for. When they received it, they would destroy themselves. - -After [profiling and testing](https://github.com/photonstorm/phaser/issues/4028) this process has changed slightly. Game Object's no longer listen for the Scene `shutdown` event. Instead, the Display List and Update List will iterate their children and call `destroy` on them in turn. If being destroyed by a Scene in this way, the child will skip several expensive operations in its destroy function. More importantly, in busy Scenes you no longer need thousands of event listeners registered. The result is that changing Scene is now up to 100% faster than before. You need not change your code to benefit from this, however, if you were relying on custom Game Objects listening for the Scene `shutdown` event natively, then this is no longer the case and you'll have to manually add that listener to your classes. - -* The UpdateList will now clear out its internal `_list`, `_pendingRemoval` and `_pendingInsertion` lists on shutdown. Before, it would only clear `_list`. -* `GameObject.destroy` has a new optional boolean argument `fromScene`, which controls how the destroy process flows. - -### Camera Render to Texture - -In 3.12 a new Camera method called `setRenderToTexture` was introduced. However, it had known issues so was placed under the experimental flag and you were advised not to use it unless in testing. - -Thanks to several fixes in this release the experimental flag has been dropped and it's now safe to try using this new feature in production. - -The method sets the Camera to render to a texture instead of to the main canvas. The Camera will redirect all Game Objects it's asked to render to this texture. During the render sequence, the texture itself will then be rendered to the main canvas. - -Doing this gives you the ability to modify the texture before this happens, allowing for special effects such as Camera specific shaders, or post-processing on the texture. - -* `Camera.setRenderToTexture` is a new method that enables the Camera to render to a target texture instead of the main canvas, allowing for application of special effects at run-time. -* `Camera.clearRenderToTexture` is a new method that stops a Camera from rendering to a texture and frees-up all associated resources. -* `Camera.setPipeline` allows you to change the WebGL pipeline being used if the Camera is rendering to a texture, effectively swapping the active shader. Call with no arguments to clear the pipeline. -* `Camera.renderToTexture` is a boolean property that controls where the Camera renders. It can be toggled on the fly. -* `Camera.canvas` is a Canvas Element that the Camera will render to if running under the Canvas Renderer and rendering to a texture. -* `Camera.context` is a Rendering Context that the Camera will render to if running under the Canvas Renderer and rendering to a texture. -* `Camera.glTexture` is a WebGL Texture that the Camera will render to if running under the WebGL Renderer and rendering to a texture. -* `Camera.framebuffer` is a WebGL Frame Buffer that the Camera will render to if running under the WebGL Renderer and rendering to a texture. -* `Camera.pipeline` is the Pipeline that the Camera will render with if running under the WebGL Renderer and rendering to a texture with a pipeline set. -* If you set a Camera to render to a texture then it will emit 2 events during the render loop. First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before it appears in-game. +* Both Static and Dynamic Tilemap layers now support rendering multiple tilesets per layer in both Canvas and WebGL. To use multiple tilesets pass in an array of Tileset objects, or strings, to the `createStaticLayer` and `createDynamicLayer` methods respectively. +* `Tilemap.createStaticLayer` now supports passing either a Tileset reference, or a string, or an array of them as the 2nd argument. If strings, the string should be the Tileset name (usually defined in Tiled). +* `Tilemap.createDynamicLayer` now supports passing either a Tileset reference, or a string, or an array of them as the 2nd argument. If strings, the string should be the Tileset name (usually defined in Tiled). +* `Tilemap.createBlankDynamicLayer` now supports passing either a Tileset reference, or a string, or an array of them as the 2nd argument. If strings, the string should be the Tileset name (usually defined in Tiled). +* Static Tilemap Layers now support tile rotation and flipping. Previously this was a feature only for Dynamic Tilemap Layers, but now both have it. Close #4037 (thanks @thisredone) +* `Tilemap.getTileset` is a new method that will return a Tileset based on its name. +* `ParseTilesets` has been rewritten so it will convert the new data structures of Tiled 1.2 into the format expected by Phaser, allowing you to use either Tiled 1.2.x or Tiled 1.1 JSON exports. Fix #3998 (thanks @martin-pabst @halgorithm) +* `Tilemap.setBaseTileSize` now sets the size into the LayerData `baseTileWidth` and `baseTileHeight` properties accordingly. Fix #4057 (thanks @imilo) +* Calling `Tilemap.renderDebug` ignored the layer world position when drawing to the Graphics object. It will now translate to the layer position before drawing. Fix #4061 (thanks @Zax37) +* Calling `Tilemap.renderDebug` ignored the layer scale when drawing to the Graphics object. It will now scale the layer before drawing. Fix #4026 (thanks @JasonHK) +* The Static Tilemap Layer would stop drawing all tiles from that point on, if it encountered a tile which had invalid texture coordinates (such as a tile from another tileset). It now skips invalid tiles properly again. Fix #4002 (thanks @jdotrjs) +* If you used a RenderTexture as a tileset then Dynamic Tilemap Layers would render the tiles inversed on the y-axis in WebGL. Fix #4017 (thanks @s-s) +* If you used a scaled Dynamic Tilemap Layer and rotated or flipped tiles, the tiles that were rotated or flipped would be positioned incorrectly in WebGL. Fix #3778 (thanks @nkholski) +* `StaticTilemapLayer.tileset` is now an array of Tileset objects, where-as before it was a single reference. +* `StaticTilemapLayer.vertexBuffer` is now an array of WebGLBuffer objects, where-as before it was a single instance. +* `StaticTilemapLayer.bufferData` is now an array of ArrayBuffer objects, where-as before it was a single instance. +* `StaticTilemapLayer.vertexViewF32` is now an array of Float3Array objects, where-as before it was a single instance. +* `StaticTilemapLayer.vertexViewU32` is now an array of Uint32Array objects, where-as before it was a single instance. +* `StaticTilemapLayer.dirty` is now an array of booleans, where-as before it was a single boolean. +* `StaticTilemapLayer.vertextCount` is now an array of integers, where-as before it was a single integer. +* `StaticTilemapLayer.updateVBOData()` is a new private method that creates the internal VBO data arrays for the WebGL renderer. +* The `StaticTilemapLayer.upload()` method has a new parameter `tilesetIndex` which controls which tileset to prepare the VBO data for. +* The `StaticTilemapLayer.batchTile()` method has a new parameter `tilesetIndex` which controls which tileset to batch the tile for. +* `StaticTilemapLayer.setTilesets()` is a new private method that creates the internal tileset references array. +* `DynamicTilemapLayer.tileset` is now an array of Tileset objects, where-as before it was a single reference. +* `DynamicTilemapLayer.setTilesets()` is a new private method that creates the internal tileset references array. ### New Features -* The `Color` object has a new property `h` which represents the hue of the color. You can tween or adjust this property in real-time and it will automatically update the internal RGB values with it. -* The `Color` object has a new property `s` which represents the saturation of the color. You can tween or adjust this property in real-time and it will automatically update the internal RGB values with it. -* The `Color` object has a new property `v` which represents the lightness value of the color. You can tween or adjust this property in real-time and it will automatically update the internal RGB values with it. -* `Color.setFromHSV` is a new method that will set the color values based on the HSV values given. -* `Color.gray` is a new method that will set the color to be a shade of gray based on the amount given. -* `Color.random` is a new method that will set the color to be a random hue based on the min and max values given. -* `Color.randomGray` is a new method that will set the color to be a random grayscale based on the min and max values given. -* `Color.saturate` is a new method that will saturate the color based on the amount given. This is a chainable version of adjusting the saturation property directly. -* `Color.desaturate` is a new method that will desaturate the color based on the amount given. This is a chainable version of adjusting the saturation property directly. -* `Color.lighten` is a new method that will lighten the color based on the amount given. This is a chainable version of adjusting the value property directly. -* `Color.darken` is a new method that will darken the color based on the amount given. This is a chainable version of adjusting the value property directly. -* `Color.brighten` is a new method that will brighten the color based on the amount given. -* The `CanvasTexture` class has a new property `imageData` which contains the ImageData of the texture. -* The `CanvasTexture` class has a new property `data` which is a Uint8ClampedArray view into the `buffer`. -* The `CanvasTexture` class has a new property `pixels` which is a Uint32Array view into the `buffer`. -* The `CanvasTexture` class has a new property `buffer` which is an ArrayBuffer the same size as the context ImageData. -* The `CanvasTexture` class has a new method `update` which refreshes the ImageData and ArrayBuffer based on the texture contents. -* The `CanvasTexture` class has a new method `draw` which draws the given Image or Canvas element to the CanvasTexture, then updates the internal ImageData buffer and arrays. -* The `CanvasTexture` class has a new method `getPixel` which will get the color of a specific pixel from the Canvas Texture and store it in the returned Color object. It uses the ArrayBuffer to do this, which is extremely fast, allowing for quick iteration across the canvas data. -* The WebGLPipeline and WebGLRenderer have new a method `setFloat1v` which allows you to set a `uniform1fv` uniform value (thanks @Mattykins) -* The WebGLPipeline and WebGLRenderer have new a method `setFloat2v` which allows you to set a `uniform2fv` uniform value (thanks @Mattykins) -* The WebGLPipeline and WebGLRenderer have new a method `setFloat3v` which allows you to set a `uniform3fv` uniform value (thanks @Mattykins) -* The WebGLPipeline and WebGLRenderer have new a method `setFloat4v` which allows you to set a `uniform4fv` uniform value (thanks @Mattykins) -* `Text.setLineSpacing` is a new method that allows you to easily set the line spacing value of a Text object in a chainable call (thanks @RafelSanso) +* `bodyDebugFillColor` is a new Matter Physics debug option that allows you to set a color used when drawing filled bodies to the debug Graphic. +* `debugWireframes` is a new Matter Physics debug option that allows you to control if the wireframes of the bodies are used when drawing to the debug Graphic. The default is `true`. If enabled bodies are not filled. +* `debugShowInternalEdges` is a new Matter Physics debug option that allows you to set if the internal edges of a body are rendered to the debug Graphic. +* `debugShowConvexHulls` is a new Matter Physics debug option that allows you to control if the convex hull of a body is drawn to the debug Graphic. The default is `false`. +* `debugConvexHullColor` is a new Matter Physics debug option that lets you set the color of the convex hull, if being drawn to the debug Graphic. +* `debugShowSleeping` is a new Matter Physics debug option that lets you draw sleeping bodies at 50% opacity. +* `Curves.Ellipse.angle` is a new getter / setter that handles the rotation of the curve in degrees instead of radians. ### Updates -* The Graphics Canvas Renderer will now automatically call `beginPath` on the target context before processing the command stack. This has the effect of clearing off any sub-paths that may have persisted on the stack from previous Graphics objects or frames. This makes it more in-line with WebGL re: expectations when calling `Graphics.clear`. -* `initPipeline` now defaults to the Texture Tint Pipeline if nothing else is specified. This allowed me to remove explicit strings from 11 different Game Objects, saving some bytes in the process. -* The `RGBToHSV` function can now take an optional `out` argument, which is either a `HSVColorObject` or a `Color` object, and the results will be set into that object instead of creating a new one. -* The `HSVToRGB` function can now take an optional `out` argument, which is either a `HSVColorObject` or a `Color` object, and the results will be set into that object instead of creating a new one. -* `Color.setTo` has a new argument `updateHSV` which allows you to control if the internal HSV values are updated during the same call or not. -* The `Text._lineSpacing` property has been renamed to `lineSpacing` and made public, not private. You still set it in the same way, by passing a `lineSpacing` property to the Text configuration object, but internally it's now clearer. -* If a Scene is already active (i.e. running) and you call `start` on it (such as from another Scene) then it will shutdown the Scene first, before starting it again. +* The Loader has been updated to handle the impact of you destroying the game instance while still processing files. It will no longer throw cache and texture related errors. Fix #4049 (thanks @pantoninho) +* `Polygon.setTo` can now take a string of space separated numbers when creating the polygon data, i.e.: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'`. This update also impacts the Polygon Shape object, which can now also take this format as well. +* The `poly-decomp` library, as used by Matter.js, has been updated to 0.3.0. +* `Matter.verts`, available via `this.matter.verts` from within a Scene, is a quick way of accessing the Matter Vertices functions. +* You can now specify the vertices for a Matter `fromVerts` body as a string. +* `TextureTintPipeline.batchTexture` has a new optional argument `skipFlip` which allows you to control the internal render texture flip Y check. +* The Device.OS check for `node` will now do a `typeof` first to avoid issues with rollup packaged builds needing to shim the variable out. Fix #4058 (thanks @hollowdoor) +* Arcade Physics Bodies will now sync the display origin of the parent Game Object to the body properties as part of the `updateBounds` call. This means if you change the origin of an AP enabled Game Object, after creation of the body, it will be reflected in the body position. This may or may not be a breaking change for your game. Previously it was expected that the origin should always be 0.5 and you adjust the body using `setOffset`, but this change makes a bit more sense logically. If you find that your bodies are offset after upgrading to this version then this is likely why. Close #4052 (thanks @SolarOmni) +* The `Texture.getFramesFromTextureSource` method has a new boolean argument `includeBase`, which defaults to `false` and allows you to set if the base frame should be returned into the array or not. +* There is a new Animation Event that is dispatched when an animation restarts. Listen for it via `Sprite.on('animationrestart')`. +* All of the Animation Events now pass the Game Object as the final argument, this includes `animationstart`, `animationrestart`, `animationrepeat`, `animationupdate` and `animationcomplete`. +* `Curves.Ellipse.rotation` is a getter / setter that holds the rotation of the curve. Previously it expected the value in degrees and when getting it returned the value in radians. It now expects the value in radians and returns radians to keep it logical. +* `Set.size` will now only set the new size if the value is smaller than the current size, truncating the Set in the process. Values larger than the current size are ignored. +* Arcade Physics `shutdown` will check to see if the world instance still exists and only try removing it if so. This prevents errors when stopping a world and then destroying it at a later date. +* `Text.setFont`, `Text.setFontFamily`, `Text.setFontStyle` and `Text.setStroke` will no longer re-measure the parent Text object if their values have not changed. ### Bug Fixes -* TileSprite.setTileScale would set the tile position by mistake, instead of the scale. Using the properties directly worked, but the method was incorrect (thanks @alexeymolchan) -* Calling `Text.setStyle` would make the Text vanish if you didn't provide a `resolution` property in the style configuration object. Calling `setStyle` now only changes the properties given in the object, leaving any previously changed properties as-is. Fix #4011 (thanks @okcompewter) -* In Matter.js if a body had its debug `render.visible` property set to `false` it wouldn't then render any other debug body beyond it. Now it will just skip bodies with hidden debug graphics (thanks @jf908) -* If you flagged a Tween as `paused` in its config, never started it, and then called `Tween.stop` it wouldn't ever be removed from the `_pending` array. It's now moved to the Tween Manager's destroy list, ready for removal on the next frame. Fix #4023 (thanks @goldfire) -* Game Objects would not remove themselves from the Scene's `shutdown` event handler when destroyed, leading to a build-up over time (thanks @goldfire) -* The WebGL Renderer will no longer try and just resize a canvas backed texture, instead it will properly delete it then re-create it. Fix #4016 (thanks @alexeymolchan) -* The Camera background for mini-Cameras (those positioned deep inside another Camera) would be offset incorrectly in WebGL, causing the background fills to be displaced (thanks @aaronfc) -* The WebGL Renderer now always enables the `SCISSOR_TEST`, this allows Game Objects that use the scissor (such as custom objects, or Bitmap Text) to render properly again. -* The Cameras `setScene` method, which is called automatically when a new Camera is created, will now call `updateSystem` which correctly increases the custom viewport counter. This fixes an issue with mini-cams inside of larger cameras not clipping their contents properly. If a Camera is moved to another Scene it also now correctly shrinks the total custom viewport counter. -* Due to the two fixes above another bug was fixed: The ability for you to swap between Cameras with and without `setRenderToTexture` enabled with custom shaders. Previously if you used this with a custom shader then only the first Camera using the shader would render, the rest would appear black. Now, all Cameras using the custom shader work correctly. As a result all of the 'experimental' Camera rendering properties from 3.12 have been moved to stable. -* If you destroyed a Game Object that had a custom cursor set during one of its input events the cursor didn't correctly reset. Fix #4033 (thanks @pantoninho) -* `RenderTexture.resize` wouldn't correctly resize the texture under WebGL. Fix #4034 (thanks @jbpuryear) -* Calling `setFrame` on a TileSprite wouldn't change the frame, it would just change the frame size. Fix #4039 (thanks @Jerenaux) -* `Zone.setRectangleDropZone` used the wrong `x` and `y` coordinates for the hit area, causing it to be offset from the zone itself after the changes made for issue #3865 in the 3.12 release. +* GameObjects added to and removed from Containers no longer listen for the `shutdown` event at all (thanks Vitali) +* Sprites now have `preDestroy` method, which is called automatically by `destroy`. The method destroys the Animation component, unregistering the `remove` event in the process and freeing-up resources. Fix #4051 (thanks @Aveyder) +* `UpdateList.shutdown` wasn't correctly iterating over the pending lists (thanks @felipeprov) +* Input detection was known to be broken when the game resolution was !== 1 and the Camera zoom level was !== 1. Fix #4010 (thanks @s-s) +* The `Shape.Line` object was missing a `lineWidth` property unless you called the `setLineWidth` method, causing the line to not render in Canvas only. Fix #4068 (thanks @netgfx) +* All parts of Matter Body now have the `gameObject` property set correctly. Previously only the first part of the Body did. +* When using `MatterGameObject` and `fromVerts` as the shape type it wouldn't pass the values to `Bodies.fromVertices` because of a previous conditional. It now passes them over correctly and the body is only set if the result is valid. +* The `Texture.getFramesFromTextureSource` method was returning an array of Frame names by mistake, instead of Frame references. It now returns the Frames themselves. +* When using `CanvasTexture.refresh` or `Graphics.generateTexture` it would throw WebGL warnings like 'bindTexture: Attempt to bind a deleted texture'. This was due to the Frames losing sync with the glTexture reference used by their TextureSource. Fix #4050 (thanks @kanthi0802) +* Fixed an error in the `batchSprite` methods in the Canvas and WebGL Renderers that would incorrectly set the frame dimensions on Sprites with the crop component. This was particularly noticeable on Sprites with trimmed animation frames (thanks @sergeod9) +* Fixed a bug where the gl scissor wasn't being reset during a renderer resize, causing it to appear as if the canvas didn't resize properly when `autoResize` was set to `true` in the game config. Fix #4066 (thanks @Quinten @hsan999) +* If a Game instance is destroyed without using the `removeCanvas` argument, it would throw exceptions in the `MouseManager` after the destroy process has run, as the event listeners were not unbound. They're not unbound, regardless of if the parent canvas is removed or not. Fix #4015 (thanks @garethwhittaker) -### Examples, Documentation and TypeScript +### Examples and TypeScript -My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs: +A huge thanks to @presidenten for his work on the Phaser 3 Examples. You'll notice they now have a lovely screen shots for every example and the scripts generate them automatically :) -@johanlindfors @Arthur3DLHC @JamesSkemp +Also, thanks to the following for helping with the Phaser 3 Examples and TypeScript definitions, either by reporting errors, or even better, fixing them: + +@madanus @truncs @samme + +### Phaser Doc Jam + +The [Phaser Doc Jam](http://docjam.phaser.io) is an on-going effort to ensure that the Phaser 3 API has 100% documentation coverage. Thanks to the monumental effort of myself and the following people we're now really close to that goal! My thanks to: + +31826615 - @16patsle - @bobonthenet - @rgk - @samme - @shaneMLK - @wemyss - ajmetal - andiCR - Arian Fornaris - bsparks - Carl - cyantree - DannyT - Elliott Wallace - felixnemis - griga - Hardylr - henriacle - Hsaka - icbat - Kanthi - Kyle - Lee - Nathaniel Foldan - Peter Pedersen - rootasjey - Sam Frantz - SBCGames - snowbillr - Stephen Hamilton - STuFF - TadejZupancic - telinc1 + +If you'd like to help finish off the last parts of documentation then take a look at the [Doc Jam site](http://docjam.phaser.io). Please see the complete [Change Log](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md) for previous releases. diff --git a/dist/phaser-arcade-physics.js b/dist/phaser-arcade-physics.js index 5984ead4e..e0369af48 100644 --- a/dist/phaser-arcade-physics.js +++ b/dist/phaser-arcade-physics.js @@ -986,16 +986,16 @@ module.exports = Vector2; // The default value to use if the key doesn't exist /** - * [description] + * Retrieves a value from an object. * * @function Phaser.Utils.Objects.GetValue * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {*} defaultValue - [description] + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. * - * @return {*} [description] + * @return {*} The value of the requested key. */ var GetValue = function (source, key, defaultValue) { @@ -1442,7 +1442,7 @@ module.exports = IsPlainObject; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(38); +var Contains = __webpack_require__(39); var GetPoint = __webpack_require__(190); var GetPoints = __webpack_require__(399); var Line = __webpack_require__(54); @@ -1457,10 +1457,10 @@ var Random = __webpack_require__(187); * @constructor * @since 3.0.0 * - * @param {number} [x=0] - [description] - * @param {number} [y=0] - [description] - * @param {number} [width=0] - [description] - * @param {number} [height=0] - [description] + * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. + * @param {number} [width=0] - The width of the Rectangle. + * @param {number} [height=0] - The height of the Rectangle. */ var Rectangle = new Class({ @@ -1474,7 +1474,7 @@ var Rectangle = new Class({ if (height === undefined) { height = 0; } /** - * [description] + * The X coordinate of the top left corner of the Rectangle. * * @name Phaser.Geom.Rectangle#x * @type {number} @@ -1484,7 +1484,7 @@ var Rectangle = new Class({ this.x = x; /** - * [description] + * The Y coordinate of the top left corner of the Rectangle. * * @name Phaser.Geom.Rectangle#y * @type {number} @@ -1494,7 +1494,7 @@ var Rectangle = new Class({ this.y = y; /** - * [description] + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. * * @name Phaser.Geom.Rectangle#width * @type {number} @@ -1504,7 +1504,7 @@ var Rectangle = new Class({ this.width = width; /** - * [description] + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. * * @name Phaser.Geom.Rectangle#height * @type {number} @@ -1515,15 +1515,15 @@ var Rectangle = new Class({ }, /** - * [description] + * Checks if the given point is inside the Rectangle's bounds. * * @method Phaser.Geom.Rectangle#contains * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. */ contains: function (x, y) { @@ -1531,17 +1531,21 @@ var Rectangle = new Class({ }, /** - * [description] + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * * @method Phaser.Geom.Rectangle#getPoint * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [output,$return] * - * @param {number} position - [description] - * @param {(Phaser.Geom.Point|object)} [output] - [description] + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. * - * @return {(Phaser.Geom.Point|object)} [description] + * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. */ getPoint: function (position, output) { @@ -1549,18 +1553,18 @@ var Rectangle = new Class({ }, /** - * [description] + * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. * * @method Phaser.Geom.Rectangle#getPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - [description] - * @param {number} [stepRate] - [description] - * @param {(array|Phaser.Geom.Point[])} [output] - [description] + * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. */ getPoints: function (quantity, stepRate, output) { @@ -1568,16 +1572,16 @@ var Rectangle = new Class({ }, /** - * [description] + * Returns a random point within the Rectangle's bounds. * * @method Phaser.Geom.Rectangle#getRandomPoint * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [point,$return] * - * @param {Phaser.Geom.Point} [point] - [description] + * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. */ getRandomPoint: function (point) { @@ -1585,15 +1589,15 @@ var Rectangle = new Class({ }, /** - * [description] + * Sets the position, width, and height of the Rectangle. * * @method Phaser.Geom.Rectangle#setTo * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} y - The Y coordinate of the top left corner of the Rectangle. + * @param {number} width - The width of the Rectangle. + * @param {number} height - The height of the Rectangle. * * @return {Phaser.Geom.Rectangle} This Rectangle object. */ @@ -1608,7 +1612,7 @@ var Rectangle = new Class({ }, /** - * [description] + * Resets the position, width, and height of the Rectangle to 0. * * @method Phaser.Geom.Rectangle#setEmpty * @since 3.0.0 @@ -1621,13 +1625,13 @@ var Rectangle = new Class({ }, /** - * [description] + * Sets the position of the Rectangle. * * @method Phaser.Geom.Rectangle#setPosition * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. * * @return {Phaser.Geom.Rectangle} This Rectangle object. */ @@ -1642,13 +1646,13 @@ var Rectangle = new Class({ }, /** - * [description] + * Sets the width and height of the Rectangle. * * @method Phaser.Geom.Rectangle#setSize * @since 3.0.0 * - * @param {number} width - [description] - * @param {number} [height=width] - [description] + * @param {number} width - The width to set the Rectangle to. + * @param {number} [height=width] - The height to set the Rectangle to. * * @return {Phaser.Geom.Rectangle} This Rectangle object. */ @@ -1663,12 +1667,12 @@ var Rectangle = new Class({ }, /** - * [description] + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. * * @method Phaser.Geom.Rectangle#isEmpty * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. */ isEmpty: function () { @@ -1760,7 +1764,8 @@ var Rectangle = new Class({ }, /** - * [description] + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. * * @name Phaser.Geom.Rectangle#left * @type {number} @@ -1790,7 +1795,8 @@ var Rectangle = new Class({ }, /** - * [description] + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. * * @name Phaser.Geom.Rectangle#right * @type {number} @@ -1818,7 +1824,8 @@ var Rectangle = new Class({ }, /** - * [description] + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. * * @name Phaser.Geom.Rectangle#top * @type {number} @@ -1848,7 +1855,8 @@ var Rectangle = new Class({ }, /** - * [description] + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. * * @name Phaser.Geom.Rectangle#bottom * @type {number} @@ -1876,7 +1884,7 @@ var Rectangle = new Class({ }, /** - * [description] + * The x coordinate of the center of the Rectangle. * * @name Phaser.Geom.Rectangle#centerX * @type {number} @@ -1897,7 +1905,7 @@ var Rectangle = new Class({ }, /** - * [description] + * The y coordinate of the center of the Rectangle. * * @name Phaser.Geom.Rectangle#centerY * @type {number} @@ -2680,7 +2688,7 @@ module.exports = { Tint: __webpack_require__(1035), ToJSON: __webpack_require__(392), Transform: __webpack_require__(391), - TransformMatrix: __webpack_require__(53), + TransformMatrix: __webpack_require__(38), Visible: __webpack_require__(390) }; @@ -3007,10 +3015,10 @@ var GetFastValue = __webpack_require__(2); * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. * @param {object} GetTilesWithinFilteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * @@ -4988,11 +4996,11 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.13.0', + VERSION: '3.14.0', BlendModes: __webpack_require__(66), - ScaleModes: __webpack_require__(93), + ScaleModes: __webpack_require__(94), /** * AUTO Detect Renderer. @@ -5413,7 +5421,7 @@ module.exports = Shape; var BlendModes = __webpack_require__(66); var GetAdvancedValue = __webpack_require__(12); -var ScaleModes = __webpack_require__(93); +var ScaleModes = __webpack_require__(94); /** * @typedef {object} GameObjectConfig @@ -5764,10 +5772,10 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var CalculateFacesWithin = function (tileX, tileY, width, height, layer) @@ -5820,35 +5828,41 @@ module.exports = CalculateFacesWithin; /** * Arcade Physics consts. - * + * * @ignore */ var CONST = { /** - * [description] - * + * Dynamic Body. + * * @name Phaser.Physics.Arcade.DYNAMIC_BODY * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#physicsType + * @see Phaser.Physics.Arcade.Group#physicsType */ DYNAMIC_BODY: 0, /** - * [description] - * + * Static Body. + * * @name Phaser.Physics.Arcade.STATIC_BODY * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#physicsType + * @see Phaser.Physics.Arcade.StaticBody#physicsType */ STATIC_BODY: 1, /** * [description] - * + * * @name Phaser.Physics.Arcade.GROUP * @readOnly * @type {number} @@ -5858,7 +5872,7 @@ var CONST = { /** * [description] - * + * * @name Phaser.Physics.Arcade.TILEMAPLAYER * @readOnly * @type {number} @@ -5867,52 +5881,62 @@ var CONST = { TILEMAPLAYER: 3, /** - * [description] - * + * Facing no direction (initial value). + * * @name Phaser.Physics.Arcade.FACING_NONE * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_NONE: 10, /** - * [description] - * + * Facing up. + * * @name Phaser.Physics.Arcade.FACING_UP * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_UP: 11, /** - * [description] - * + * Facing down. + * * @name Phaser.Physics.Arcade.FACING_DOWN * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_DOWN: 12, /** - * [description] - * + * Facing left. + * * @name Phaser.Physics.Arcade.FACING_LEFT * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_LEFT: 13, /** - * [description] - * + * Facing right. + * * @name Phaser.Physics.Arcade.FACING_RIGHT * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_RIGHT: 14 @@ -6818,736 +6842,6 @@ module.exports = Color; /***/ }), /* 38 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * [description] - * - * @function Phaser.Geom.Rectangle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {number} x - [description] - * @param {number} y - [description] - * - * @return {boolean} [description] - */ -var Contains = function (rect, x, y) -{ - if (rect.width <= 0 || rect.height <= 0) - { - return false; - } - - return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; - -module.exports = Contains; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Check to see if the Circle contains the given x / y coordinates. - * - * @function Phaser.Geom.Circle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Circle} circle - The Circle to check. - * @param {number} x - The x coordinate to check within the circle. - * @param {number} y - The y coordinate to check within the circle. - * - * @return {boolean} True if the coordinates are within the circle, otherwise false. - */ -var Contains = function (circle, x, y) -{ - // Check if x/y are within the bounds first - if (circle.radius > 0 && x >= circle.left && x <= circle.right && y >= circle.top && y <= circle.bottom) - { - var dx = (circle.x - x) * (circle.x - x); - var dy = (circle.y - y) * (circle.y - y); - - return (dx + dy) <= (circle.radius * circle.radius); - } - else - { - return false; - } -}; - -module.exports = Contains; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the top of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetTop - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetTop = function (gameObject, value) -{ - gameObject.y = value + (gameObject.height * gameObject.originY); - - return gameObject; -}; - -module.exports = SetTop; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the top coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetTop - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The top coordinate of the bounds of the Game Object. - */ -var GetTop = function (gameObject) -{ - return gameObject.y - (gameObject.height * gameObject.originY); -}; - -module.exports = GetTop; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the left of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetRight - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetRight = function (gameObject, value) -{ - gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX); - - return gameObject; -}; - -module.exports = SetRight; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the right coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetRight - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The right coordinate of the bounds of the Game Object. - */ -var GetRight = function (gameObject) -{ - return (gameObject.x + gameObject.width) - (gameObject.width * gameObject.originX); -}; - -module.exports = GetRight; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the left of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetLeft - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetLeft = function (gameObject, value) -{ - gameObject.x = value + (gameObject.width * gameObject.originX); - - return gameObject; -}; - -module.exports = SetLeft; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the left coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetLeft - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The left coordinate of the bounds of the Game Object. - */ -var GetLeft = function (gameObject) -{ - return gameObject.x - (gameObject.width * gameObject.originX); -}; - -module.exports = GetLeft; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetBottom - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetBottom = function (gameObject, value) -{ - gameObject.y = (value - gameObject.height) + (gameObject.height * gameObject.originY); - - return gameObject; -}; - -module.exports = SetBottom; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the bottom coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetBottom - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The bottom coordinate of the bounds of the Game Object. - */ -var GetBottom = function (gameObject) -{ - return (gameObject.y + gameObject.height) - (gameObject.height * gameObject.originY); -}; - -module.exports = GetBottom; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.WorldToTileY - * @private - * @since 3.0.0 - * - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} The Y location in tile units. - */ -var WorldToTileY = function (worldY, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } - - var tileHeight = layer.baseTileHeight; - var tilemapLayer = layer.tilemapLayer; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's vertical scroll - worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); - - tileHeight *= tilemapLayer.scaleY; - } - - return snapToFloor - ? Math.floor(worldY / tileHeight) - : worldY / tileHeight; -}; - -module.exports = WorldToTileY; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.WorldToTileX - * @private - * @since 3.0.0 - * - * @param {number} worldX - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} The X location in tile units. - */ -var WorldToTileX = function (worldX, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } - - var tileWidth = layer.baseTileWidth; - var tilemapLayer = layer.tilemapLayer; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's horizontal scroll - worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); - - tileWidth *= tilemapLayer.scaleX; - } - - return snapToFloor - ? Math.floor(worldX / tileWidth) - : worldX / tileWidth; -}; - -module.exports = WorldToTileX; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var File = __webpack_require__(21); -var FileTypesManager = __webpack_require__(7); -var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(4); -var IsPlainObject = __webpack_require__(8); - -/** - * @typedef {object} Phaser.Loader.FileTypes.JSONFileConfig - * - * @property {string} key - The key of the file. Must be unique within both the Loader and the JSON Cache. - * @property {string|any} [url] - The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly added to the Cache. - * @property {string} [extension='json'] - The default file extension to use if no url is provided. - * @property {string} [dataKey] - If specified instead of the whole JSON file being parsed and added to the Cache, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. - * @property {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - */ - -/** - * @classdesc - * A single JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. - * - * @class JSONFile - * @extends Phaser.Loader.File - * @memberOf Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - */ -var JSONFile = new Class({ - - Extends: File, - - initialize: - - // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object - // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing - - function JSONFile (loader, key, url, xhrSettings, dataKey) - { - var extension = 'json'; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - dataKey = GetFastValue(config, 'dataKey', dataKey); - } - - var fileConfig = { - type: 'json', - cache: loader.cacheManager.json, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings, - config: dataKey - }; - - File.call(this, loader, fileConfig); - - if (IsPlainObject(url)) - { - // Object provided instead of a URL, so no need to actually load it (populate data with value) - if (dataKey) - { - this.data = GetValue(url, dataKey); - } - else - { - this.data = url; - } - - this.state = CONST.FILE_POPULATED; - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.JSONFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - if (this.state !== CONST.FILE_POPULATED) - { - this.state = CONST.FILE_PROCESSING; - - var json = JSON.parse(this.xhrLoader.responseText); - - var key = this.config; - - if (typeof key === 'string') - { - this.data = GetValue(json, key, json); - } - else - { - this.data = json; - } - } - - this.onProcessComplete(); - } - -}); - -/** - * Adds a JSON file, or array of JSON files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the JSON Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.json({ - * key: 'wavedata', - * url: 'files/AlienWaveData.json' - * }); - * ``` - * - * See the documentation for `Phaser.Loader.FileTypes.JSONFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * // and later in your game ... - * var data = this.cache.json.get('wavedata'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and - * this is what you would use to retrieve the text from the JSON Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" - * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, - * rather than the whole file. For example, if your JSON data had a structure like this: - * - * ```json - * { - * "level1": { - * "baddies": { - * "aliens": {}, - * "boss": {} - * } - * }, - * "level2": {}, - * "level3": {} - * } - * ``` - * - * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. - * - * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#json - * @fires Phaser.Loader.LoaderPlugin#addFileEvent - * @since 3.0.0 - * - * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig|Phaser.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - * @param {XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {Phaser.Loader.LoaderPlugin} The Loader instance. - */ -FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new JSONFile(this, key[i])); - } - } - else - { - this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); - } - - return this; -}); - -module.exports = JSONFile; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points). - * - * @function Phaser.Math.Distance.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var DistanceBetween = function (x1, y1, x2, y2) -{ - var dx = x1 - x2; - var dy = y1 - y2; - - return Math.sqrt(dx * dx + dy * dy); -}; - -module.exports = DistanceBetween; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Wrap the given `value` between `min` and `max. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The wrapped value. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; - -module.exports = Wrap; - - -/***/ }), -/* 53 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8457,6 +7751,734 @@ var TransformMatrix = new Class({ module.exports = TransformMatrix; +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * [description] + * + * @function Phaser.Geom.Rectangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {number} x - [description] + * @param {number} y - [description] + * + * @return {boolean} [description] + */ +var Contains = function (rect, x, y) +{ + if (rect.width <= 0 || rect.height <= 0) + { + return false; + } + + return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); +}; + +module.exports = Contains; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Check to see if the Circle contains the given x / y coordinates. + * + * @function Phaser.Geom.Circle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The Circle to check. + * @param {number} x - The x coordinate to check within the circle. + * @param {number} y - The y coordinate to check within the circle. + * + * @return {boolean} True if the coordinates are within the circle, otherwise false. + */ +var Contains = function (circle, x, y) +{ + // Check if x/y are within the bounds first + if (circle.radius > 0 && x >= circle.left && x <= circle.right && y >= circle.top && y <= circle.bottom) + { + var dx = (circle.x - x) * (circle.x - x); + var dy = (circle.y - y) * (circle.y - y); + + return (dx + dy) <= (circle.radius * circle.radius); + } + else + { + return false; + } +}; + +module.exports = Contains; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the top of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetTop + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetTop = function (gameObject, value) +{ + gameObject.y = value + (gameObject.height * gameObject.originY); + + return gameObject; +}; + +module.exports = SetTop; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the top coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetTop + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The top coordinate of the bounds of the Game Object. + */ +var GetTop = function (gameObject) +{ + return gameObject.y - (gameObject.height * gameObject.originY); +}; + +module.exports = GetTop; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetRight + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetRight = function (gameObject, value) +{ + gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX); + + return gameObject; +}; + +module.exports = SetRight; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the right coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetRight + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The right coordinate of the bounds of the Game Object. + */ +var GetRight = function (gameObject) +{ + return (gameObject.x + gameObject.width) - (gameObject.width * gameObject.originX); +}; + +module.exports = GetRight; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetLeft + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetLeft = function (gameObject, value) +{ + gameObject.x = value + (gameObject.width * gameObject.originX); + + return gameObject; +}; + +module.exports = SetLeft; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the left coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetLeft + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The left coordinate of the bounds of the Game Object. + */ +var GetLeft = function (gameObject) +{ + return gameObject.x - (gameObject.width * gameObject.originX); +}; + +module.exports = GetLeft; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetBottom + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetBottom = function (gameObject, value) +{ + gameObject.y = (value - gameObject.height) + (gameObject.height * gameObject.originY); + + return gameObject; +}; + +module.exports = SetBottom; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the bottom coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetBottom + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The bottom coordinate of the bounds of the Game Object. + */ +var GetBottom = function (gameObject) +{ + return (gameObject.y + gameObject.height) - (gameObject.height * gameObject.originY); +}; + +module.exports = GetBottom; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileY + * @private + * @since 3.0.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var WorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return snapToFloor + ? Math.floor(worldY / tileHeight) + : worldY / tileHeight; +}; + +module.exports = WorldToTileY; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileX + * @private + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The X location in tile units. + */ +var WorldToTileX = function (worldX, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileWidth = layer.baseTileWidth; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + return snapToFloor + ? Math.floor(worldX / tileWidth) + : worldX / tileWidth; +}; + +module.exports = WorldToTileX; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(18); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(7); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(4); +var IsPlainObject = __webpack_require__(8); + +/** + * @typedef {object} Phaser.Loader.FileTypes.JSONFileConfig + * + * @property {string} key - The key of the file. Must be unique within both the Loader and the JSON Cache. + * @property {string|any} [url] - The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly added to the Cache. + * @property {string} [extension='json'] - The default file extension to use if no url is provided. + * @property {string} [dataKey] - If specified instead of the whole JSON file being parsed and added to the Cache, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. + * @property {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ + +/** + * @classdesc + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * + * @class JSONFile + * @extends Phaser.Loader.File + * @memberOf Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var JSONFile = new Class({ + + Extends: File, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function JSONFile (loader, key, url, xhrSettings, dataKey) + { + var extension = 'json'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); + } + + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey + }; + + File.call(this, loader, fileConfig); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + var json = JSON.parse(this.xhrLoader.responseText); + + var key = this.config; + + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#json + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig|Phaser.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new JSONFile(this, key[i])); + } + } + else + { + this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = JSONFile; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points). + * + * @function Phaser.Math.Distance.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var DistanceBetween = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetween; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Wrap the given `value` between `min` and `max. + * + * @function Phaser.Math.Wrap + * @since 3.0.0 + * + * @param {number} value - The value to wrap. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The wrapped value. + */ +var Wrap = function (value, min, max) +{ + var range = max - min; + + return (min + ((((value - min) % range) + range) % range)); +}; + +module.exports = Wrap; + + /***/ }), /* 54 */ /***/ (function(module, exports, __webpack_require__) { @@ -9622,8 +9644,8 @@ module.exports = Tile; * @private * @since 3.0.0 * - * @param {Phaser.Tilemaps.Tile} tile - [description] - * @param {boolean} [collides=true] - [description] + * @param {Phaser.Tilemaps.Tile} tile - The Tile to set the collision on. + * @param {boolean} [collides=true] - Should the tile index collide or not? */ var SetTileCollision = function (tile, collides) { @@ -10158,12 +10180,12 @@ var Random = __webpack_require__(184); * @constructor * @since 3.0.0 * - * @param {number} [x1=0] - [description] - * @param {number} [y1=0] - [description] - * @param {number} [x2=0] - [description] - * @param {number} [y2=0] - [description] - * @param {number} [x3=0] - [description] - * @param {number} [y3=0] - [description] + * @param {number} [x1=0] - `x` coordinate of the first point. + * @param {number} [y1=0] - `y` coordinate of the first point. + * @param {number} [x2=0] - `x` coordinate of the second point. + * @param {number} [y2=0] - `y` coordinate of the second point. + * @param {number} [x3=0] - `x` coordinate of the third point. + * @param {number} [y3=0] - `y` coordinate of the third point. */ var Triangle = new Class({ @@ -10179,7 +10201,7 @@ var Triangle = new Class({ if (y3 === undefined) { y3 = 0; } /** - * [description] + * `x` coordinate of the first point. * * @name Phaser.Geom.Triangle#x1 * @type {number} @@ -10189,7 +10211,7 @@ var Triangle = new Class({ this.x1 = x1; /** - * [description] + * `y` coordinate of the first point. * * @name Phaser.Geom.Triangle#y1 * @type {number} @@ -10199,7 +10221,7 @@ var Triangle = new Class({ this.y1 = y1; /** - * [description] + * `x` coordinate of the second point. * * @name Phaser.Geom.Triangle#x2 * @type {number} @@ -10209,7 +10231,7 @@ var Triangle = new Class({ this.x2 = x2; /** - * [description] + * `y` coordinate of the second point. * * @name Phaser.Geom.Triangle#y2 * @type {number} @@ -10219,7 +10241,7 @@ var Triangle = new Class({ this.y2 = y2; /** - * [description] + * `x` coordinate of the third point. * * @name Phaser.Geom.Triangle#x3 * @type {number} @@ -10229,7 +10251,7 @@ var Triangle = new Class({ this.x3 = x3; /** - * [description] + * `y` coordinate of the third point. * * @name Phaser.Geom.Triangle#y3 * @type {number} @@ -10240,15 +10262,15 @@ var Triangle = new Class({ }, /** - * [description] + * Checks whether a given points lies within the triangle. * * @method Phaser.Geom.Triangle#contains * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate of the point to check. + * @param {number} y - The y coordinate of the point to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the coordinate pair is within the triangle, otherwise `false`. */ contains: function (x, y) { @@ -10256,17 +10278,17 @@ var Triangle = new Class({ }, /** - * [description] + * Returns a specific point on the triangle. * * @method Phaser.Geom.Triangle#getPoint * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [output,$return] * - * @param {number} position - [description] - * @param {(Phaser.Geom.Point|object)} [output] - [description] + * @param {number} position - Position as float within `0` and `1`. `0` equals the first point. + * @param {(Phaser.Geom.Point|object)} [output] - Optional Point, or point-like object, that the calculated point will be written to. * - * @return {(Phaser.Geom.Point|object)} [description] + * @return {(Phaser.Geom.Point|object)} Calculated `Point` that represents the requested position. It is the same as `output` when this parameter has been given. */ getPoint: function (position, output) { @@ -10274,18 +10296,18 @@ var Triangle = new Class({ }, /** - * [description] + * Calculates a list of evenly distributed points on the triangle. It is either possible to pass an amount of points to be generated (`quantity`) or the distance between two points (`stepRate`). * * @method Phaser.Geom.Triangle#getPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - [description] - * @param {number} [stepRate] - [description] - * @param {(array|Phaser.Geom.Point[])} [output] - [description] + * @param {integer} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param {number} [stepRate] - Distance between two points. Will only be used when `quantity` is falsey. + * @param {(array|Phaser.Geom.Point[])} [output] - Optional Array for writing the calculated points into. Otherwise a new array will be created. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} Returns a list of calculated `Point` instances or the filled array passed as parameter `output`. */ getPoints: function (quantity, stepRate, output) { @@ -10293,16 +10315,16 @@ var Triangle = new Class({ }, /** - * [description] + * Returns a random point along the triangle. * * @method Phaser.Geom.Triangle#getRandomPoint * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [point,$return] * - * @param {Phaser.Geom.Point} [point] - [description] + * @param {Phaser.Geom.Point} [point] - Optional `Point` that should be modified. Otherwise a new one will be created. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} Random `Point`. When parameter `point` has been provided it will be returned. */ getRandomPoint: function (point) { @@ -10310,17 +10332,17 @@ var Triangle = new Class({ }, /** - * [description] + * Sets all three points of the triangle. Leaving out any coordinate sets it to be `0`. * * @method Phaser.Geom.Triangle#setTo * @since 3.0.0 * - * @param {number} [x1=0] - [description] - * @param {number} [y1=0] - [description] - * @param {number} [x2=0] - [description] - * @param {number} [y2=0] - [description] - * @param {number} [x3=0] - [description] - * @param {number} [y3=0] - [description] + * @param {number} [x1=0] - `x` coordinate of the first point. + * @param {number} [y1=0] - `y` coordinate of the first point. + * @param {number} [x2=0] - `x` coordinate of the second point. + * @param {number} [y2=0] - `y` coordinate of the second point. + * @param {number} [x3=0] - `x` coordinate of the third point. + * @param {number} [y3=0] - `y` coordinate of the third point. * * @return {Phaser.Geom.Triangle} This Triangle object. */ @@ -10409,7 +10431,7 @@ var Triangle = new Class({ }, /** - * [description] + * Left most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. * * @name Phaser.Geom.Triangle#left * @type {number} @@ -10447,7 +10469,7 @@ var Triangle = new Class({ }, /** - * [description] + * Right most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. * * @name Phaser.Geom.Triangle#right * @type {number} @@ -10485,7 +10507,7 @@ var Triangle = new Class({ }, /** - * [description] + * Top most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. * * @name Phaser.Geom.Triangle#top * @type {number} @@ -10523,7 +10545,7 @@ var Triangle = new Class({ }, /** - * [description] + * Bottom most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. * * @name Phaser.Geom.Triangle#bottom * @type {number} @@ -10797,6 +10819,20 @@ var Sprite = new Class({ // Extra Sprite data is added here return data; + }, + + /** + * Handles the pre-destroy step for the Sprite, which removes the Animation component. + * + * @method Phaser.GameObjects.Sprite#preDestroy + * @private + * @since 3.14.0 + */ + preDestroy: function () + { + this.anims.destroy(); + + this.anims = undefined; } }); @@ -12029,9 +12065,9 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getEndPoint * @since 3.0.0 * - * @param {Phaser.Math.Vector2} out - [description] + * @param {Phaser.Math.Vector2} [out] - Optional Vector object to store the result in. * - * @return {Phaser.Math.Vector2} [description] + * @return {Phaser.Math.Vector2} Vector2 containing the coordinates of the curves end point. */ getEndPoint: function (out) { @@ -12235,7 +12271,7 @@ var Curve = new Class({ * @param {number} t - [description] * @param {Phaser.Math.Vector2} [out] - [description] * - * @return {Phaser.Math.Vector2} [description] + * @return {Phaser.Math.Vector2} Vector approximating the tangent line at the point t (delta +/- 0.0001) */ getTangent: function (t, out) { @@ -12417,7 +12453,7 @@ module.exports = Curve; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(39); +var Contains = __webpack_require__(40); var GetPoint = __webpack_require__(406); var GetPoints = __webpack_require__(404); var Random = __webpack_require__(191); @@ -12896,7 +12932,8 @@ module.exports = GetCenterX; /***/ }), -/* 76 */ +/* 76 */, +/* 77 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13107,7 +13144,7 @@ module.exports = MapData; /***/ }), -/* 77 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13327,7 +13364,7 @@ module.exports = LayerData; /***/ }), -/* 78 */ +/* 79 */ /***/ (function(module, exports) { /** @@ -13343,11 +13380,11 @@ module.exports = LayerData; * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {boolean} + * @return {boolean} `true` if the tile coordinates are within the bounds of the layer, otherwise `false`. */ var IsInLayerBounds = function (tileX, tileY, layer) { @@ -13358,9 +13395,9 @@ module.exports = IsInLayerBounds; /***/ }), -/* 79 */, /* 80 */, -/* 81 */ +/* 81 */, +/* 82 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13422,7 +13459,7 @@ module.exports = FillPathWebGL; /***/ }), -/* 82 */ +/* 83 */ /***/ (function(module, exports) { /** @@ -13594,7 +13631,7 @@ module.exports = TWEEN_CONST; /***/ }), -/* 83 */ +/* 84 */ /***/ (function(module, exports) { /** @@ -13604,16 +13641,16 @@ module.exports = TWEEN_CONST; */ /** - * [description] + * Retrieves the value of the given key from an object. * * @function Phaser.Tweens.Builders.GetBoolean * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {*} defaultValue - [description] + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The key to look for in the `source` object. + * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. * - * @return {*} [description] + * @return {*} The retrieved value. */ var GetBoolean = function (source, key, defaultValue) { @@ -13635,7 +13672,7 @@ module.exports = GetBoolean; /***/ }), -/* 84 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -13664,7 +13701,7 @@ module.exports = HasValue; /***/ }), -/* 85 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13726,7 +13763,7 @@ module.exports = GetEaseFunction; /***/ }), -/* 86 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13829,7 +13866,7 @@ module.exports = Image; /***/ }), -/* 87 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13939,7 +13976,7 @@ var Sprite = __webpack_require__(61); * @constructor * @since 3.0.0 * @param {Phaser.Scene} scene - The scene this group belongs to. - * @param {(Phaser.GameObjects.GameObject[]|GroupConfig)} [children] - Game objects to add to this group; or the `config` argument. + * @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. * @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings. * * @see Phaser.Physics.Arcade.Group @@ -15051,7 +15088,7 @@ module.exports = Group; /***/ }), -/* 88 */ +/* 89 */ /***/ (function(module, exports) { /** @@ -15093,7 +15130,7 @@ module.exports = Contains; /***/ }), -/* 89 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15103,7 +15140,7 @@ module.exports = Contains; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(88); +var Contains = __webpack_require__(89); var GetPoint = __webpack_require__(309); var GetPoints = __webpack_require__(308); var Random = __webpack_require__(185); @@ -15461,7 +15498,7 @@ module.exports = Ellipse; /***/ }), -/* 90 */ +/* 91 */ /***/ (function(module, exports) { /** @@ -15507,7 +15544,7 @@ module.exports = SpliceOne; /***/ }), -/* 91 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -15646,7 +15683,7 @@ function init () OS.cordova = true; } - if (process && process.versions && process.versions.node) + if (typeof process !== 'undefined' && process.versions && process.versions.node) { OS.node = true; } @@ -15695,7 +15732,7 @@ module.exports = init(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(906))) /***/ }), -/* 92 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15729,7 +15766,7 @@ module.exports = FromPercent; /***/ }), -/* 93 */ +/* 94 */ /***/ (function(module, exports) { /** @@ -15775,7 +15812,6 @@ module.exports = { /***/ }), -/* 94 */, /* 95 */ /***/ (function(module, exports, __webpack_require__) { @@ -15809,7 +15845,7 @@ var Class = __webpack_require__(0); * @generic T * @genericUse {T[]} - [elements] * - * @param {Array.<*>} [elements] - [description] + * @param {Array.<*>} [elements] - An optional array of elements to insert into this Set. */ var Set = new Class({ @@ -15818,7 +15854,7 @@ var Set = new Class({ function Set (elements) { /** - * [description] + * The entries of this Set. Stored internally as an array. * * @genericUse {T[]} - [$type] * @@ -15839,7 +15875,7 @@ var Set = new Class({ }, /** - * [description] + * Inserts the provided value into this Set. If the value is already contained in this Set this method will have no effect. * * @method Phaser.Structs.Set#set * @since 3.0.0 @@ -15847,7 +15883,7 @@ var Set = new Class({ * @genericUse {T} - [value] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {*} value - [description] + * @param {*} value - The value to insert into this Set. * * @return {Phaser.Structs.Set} This Set object. */ @@ -15862,17 +15898,18 @@ var Set = new Class({ }, /** - * [description] + * Get an element of this Set which has a property of the specified name, if that property is equal to the specified value. + * If no elements of this Set satisfy the condition then this method will return `null`. * * @method Phaser.Structs.Set#get * @since 3.0.0 * * @genericUse {T} - [value,$return] * - * @param {string} property - [description] - * @param {*} value - [description] + * @param {string} property - The property name to check on the elements of this Set. + * @param {*} value - The value to check for. * - * @return {*} [description] + * @return {*} The first element of this Set that meets the required condition, or `null` if this Set contains no elements that meet the condition. */ get: function (property, value) { @@ -15888,14 +15925,14 @@ var Set = new Class({ }, /** - * [description] + * Returns an array containing all the values in this Set. * * @method Phaser.Structs.Set#getArray * @since 3.0.0 * * @genericUse {T[]} - [$return] * - * @return {Array.<*>} [description] + * @return {Array.<*>} An array containing all the values in this Set. */ getArray: function () { @@ -15903,7 +15940,7 @@ var Set = new Class({ }, /** - * [description] + * Removes the given value from this Set if this Set contains that value. * * @method Phaser.Structs.Set#delete * @since 3.0.0 @@ -15911,7 +15948,7 @@ var Set = new Class({ * @genericUse {T} - [value] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {*} value - [description] + * @param {*} value - The value to remove from the Set. * * @return {Phaser.Structs.Set} This Set object. */ @@ -15928,7 +15965,7 @@ var Set = new Class({ }, /** - * [description] + * Dumps the contents of this Set to the console via `console.group`. * * @method Phaser.Structs.Set#dump * @since 3.0.0 @@ -15949,7 +15986,8 @@ var Set = new Class({ }, /** - * For when you know this Set will be modified during the iteration. + * Passes each value in this Set to the given callback. + * Use this function when you know this Set will be modified during the iteration, otherwise use `iterate`. * * @method Phaser.Structs.Set#each * @since 3.0.0 @@ -15957,8 +15995,8 @@ var Set = new Class({ * @genericUse {EachSetCallback.} - [callback] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {EachSetCallback} callback - [description] - * @param {*} callbackScope - [description] + * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains. + * @param {*} callbackScope - The scope of the callback. * * @return {Phaser.Structs.Set} This Set object. */ @@ -15993,6 +16031,7 @@ var Set = new Class({ }, /** + * Passes each value in this Set to the given callback. * For when you absolutely know this Set won't be modified during the iteration. * * @method Phaser.Structs.Set#iterate @@ -16001,8 +16040,8 @@ var Set = new Class({ * @genericUse {EachSetCallback.} - [callback] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {EachSetCallback} callback - [description] - * @param {*} [callbackScope] - [description] + * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains. + * @param {*} callbackScope - The scope of the callback. * * @return {Phaser.Structs.Set} This Set object. */ @@ -16036,14 +16075,14 @@ var Set = new Class({ }, /** - * [description] + * Goes through each entry in this Set and invokes the given function on them, passing in the arguments. * * @method Phaser.Structs.Set#iterateLocal * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {string} callbackKey - [description] + * @param {string} callbackKey - The key of the function to be invoked on each Set entry. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. * * @return {Phaser.Structs.Set} This Set object. @@ -16071,7 +16110,7 @@ var Set = new Class({ }, /** - * [description] + * Clears this Set so that it no longer contains any values. * * @method Phaser.Structs.Set#clear * @since 3.0.0 @@ -16088,16 +16127,16 @@ var Set = new Class({ }, /** - * [description] + * Returns `true` if this Set contains the given value, otherwise returns `false`. * * @method Phaser.Structs.Set#contains * @since 3.0.0 * * @genericUse {T} - [value] * - * @param {*} value - [description] + * @param {*} value - The value to check for in this Set. * - * @return {boolean} [description] + * @return {boolean} `true` if the given value was found in this Set, otherwise `false`. */ contains: function (value) { @@ -16105,16 +16144,16 @@ var Set = new Class({ }, /** - * [description] + * Returns a new Set containing all values that are either in this Set or in the Set provided as an argument. * * @method Phaser.Structs.Set#union * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [set,$return] * - * @param {Phaser.Structs.Set} set - [description] + * @param {Phaser.Structs.Set} set - The Set to perform the union with. * - * @return {Phaser.Structs.Set} [description] + * @return {Phaser.Structs.Set} A new Set containing all the values in this Set and the Set provided as an argument. */ union: function (set) { @@ -16134,16 +16173,16 @@ var Set = new Class({ }, /** - * [description] + * Returns a new Set that contains only the values which are in this Set and that are also in the given Set. * * @method Phaser.Structs.Set#intersect * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [set,$return] * - * @param {Phaser.Structs.Set} set - [description] + * @param {Phaser.Structs.Set} set - The Set to intersect this set with. * - * @return {Phaser.Structs.Set} [description] + * @return {Phaser.Structs.Set} The result of the intersection, as a new Set. */ intersect: function (set) { @@ -16161,16 +16200,16 @@ var Set = new Class({ }, /** - * [description] + * Returns a new Set containing all the values in this Set which are *not* also in the given Set. * * @method Phaser.Structs.Set#difference * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [set,$return] * - * @param {Phaser.Structs.Set} set - [description] + * @param {Phaser.Structs.Set} set - The Set to perform the difference with. * - * @return {Phaser.Structs.Set} [description] + * @return {Phaser.Structs.Set} A new Set containing all the values in this Set that are not also in the Set provided as an argument to this method. */ difference: function (set) { @@ -16188,7 +16227,9 @@ var Set = new Class({ }, /** - * [description] + * The size of this Set. This is the number of entries within it. + * Changing the size will truncate the Set if the given value is smaller than the current size. + * Increasing the size larger than the current size has no effect. * * @name Phaser.Structs.Set#size * @type {integer} @@ -16203,7 +16244,14 @@ var Set = new Class({ set: function (value) { - return this.entries.length = value; + if (value < this.entries.length) + { + return this.entries.length = value; + } + else + { + return this.entries.length; + } } } @@ -16267,8 +16315,8 @@ module.exports = Merge; var Defaults = __webpack_require__(128); var GetAdvancedValue = __webpack_require__(12); -var GetBoolean = __webpack_require__(83); -var GetEaseFunction = __webpack_require__(85); +var GetBoolean = __webpack_require__(84); +var GetEaseFunction = __webpack_require__(86); var GetNewValue = __webpack_require__(98); var GetProps = __webpack_require__(206); var GetTargets = __webpack_require__(130); @@ -16814,7 +16862,7 @@ var Tileset = new Class({ if (rowCount % 1 !== 0 || colCount % 1 !== 0) { - console.warn('Tileset ' + this.name + ' image tile area is not an even multiple of tile size'); + console.warn('Image tile area not tile size multiple in: ' + this.name); } // In Tiled a tileset image that is not an even multiple of the tile dimensions is truncated @@ -16871,8 +16919,8 @@ module.exports = Tileset; * @private * @since 3.0.0 * - * @param {integer} tileY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileY - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {number} @@ -16916,8 +16964,8 @@ module.exports = TileToWorldY; * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {number} @@ -16953,7 +17001,7 @@ module.exports = TileToWorldX; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var IsInLayerBounds = __webpack_require__(78); +var IsInLayerBounds = __webpack_require__(79); /** * Gets a tile at the given tile coordinates from the given layer. @@ -16964,8 +17012,7 @@ var IsInLayerBounds = __webpack_require__(78); * * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates @@ -17033,7 +17080,7 @@ module.exports = { GetTilesWithinWorldXY: __webpack_require__(479), HasTileAt: __webpack_require__(220), HasTileAtWorldXY: __webpack_require__(478), - IsInLayerBounds: __webpack_require__(78), + IsInLayerBounds: __webpack_require__(79), PutTileAt: __webpack_require__(134), PutTileAtWorldXY: __webpack_require__(477), PutTilesAt: __webpack_require__(476), @@ -17055,9 +17102,9 @@ module.exports = { TileToWorldXY: __webpack_require__(463), TileToWorldY: __webpack_require__(100), WeightedRandomize: __webpack_require__(462), - WorldToTileX: __webpack_require__(49), + WorldToTileX: __webpack_require__(50), WorldToTileXY: __webpack_require__(461), - WorldToTileY: __webpack_require__(48) + WorldToTileY: __webpack_require__(49) }; @@ -17370,16 +17417,16 @@ var Point = __webpack_require__(6); // See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ /** - * [description] + * Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting. * * @function Phaser.Geom.Intersects.LineToLine * @since 3.0.0 * - * @param {Phaser.Geom.Line} line1 - [description] - * @param {Phaser.Geom.Line} line2 - [description] - * @param {Phaser.Geom.Point} [out] - [description] + * @param {Phaser.Geom.Line} line1 - The first Line to check. + * @param {Phaser.Geom.Line} line2 - The second Line to check. + * @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection. * - * @return {boolean} [description] + * @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`. */ var LineToLine = function (line1, line2, out) { @@ -18457,13 +18504,13 @@ var StableSort = __webpack_require__(110); * @callback EachListCallback * @generic I - [item] * - * @param {*} item - [description] + * @param {*} item - The item which is currently being processed. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. */ /** * @classdesc - * [description] + * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. * * @class List * @memberOf Phaser.Structs @@ -18472,7 +18519,7 @@ var StableSort = __webpack_require__(110); * * @generic T * - * @param {*} parent - [description] + * @param {*} parent - The parent of this list. */ var List = new Class({ @@ -18502,7 +18549,9 @@ var List = new Class({ this.list = []; /** - * [description] + * The index of the current element. + * + * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. * * @name Phaser.Structs.List#position * @type {integer} @@ -18540,17 +18589,17 @@ var List = new Class({ }, /** - * [description] + * Adds the given item to the end of the list. Each item must be unique. * * @method Phaser.Structs.List#add * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*|Array.<*>} child - [description] + * @param {*|Array.<*>} child - The item, or array of items, to add to the list. * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. * - * @return {*} [description] + * @return {*} The list's underlying array. */ add: function (child, skipCallback) { @@ -18565,18 +18614,18 @@ var List = new Class({ }, /** - * [description] + * Adds an item to list, starting at a specified index. Each item must be unique within the list. * * @method Phaser.Structs.List#addAt * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] - * @param {integer} [index=0] - [description] + * @param {*} child - The item, or array of items, to add to the list. + * @param {integer} [index=0] - The index in the list at which the element(s) will be inserted. * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. * - * @return {*} [description] + * @return {*} The List's underlying array. */ addAt: function (child, index, skipCallback) { @@ -18591,16 +18640,16 @@ var List = new Class({ }, /** - * [description] + * Retrieves the item at a given position inside the List. * * @method Phaser.Structs.List#getAt * @since 3.0.0 * * @genericUse {T} - [$return] * - * @param {integer} index - [description] + * @param {integer} index - The index of the item. * - * @return {*} [description] + * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds. */ getAt: function (index) { @@ -18608,16 +18657,16 @@ var List = new Class({ }, /** - * [description] + * Locates an item within the List and returns its index. * * @method Phaser.Structs.List#getIndex * @since 3.0.0 * * @genericUse {T} - [child] * - * @param {*} child - [description] + * @param {*} child - The item to locate. * - * @return {integer} [description] + * @return {integer} The index of the item within the List, or -1 if it's not in the List. */ getIndex: function (child) { @@ -18637,7 +18686,7 @@ var List = new Class({ * * @param {string} property - The property to lexically sort by. * - * @return {Array.<*>} [description] + * @return {Phaser.Structs.List} This List object. */ sort: function (property) { @@ -18652,7 +18701,7 @@ var List = new Class({ }, /** - * [description] + * Internal handler for the {@link #sort} method which compares two items. * * @method Phaser.Structs.List#sortHandler * @private @@ -18660,10 +18709,10 @@ var List = new Class({ * * @genericUse {T} - [childA,childB] * - * @param {*} childA - [description] - * @param {*} childB - [description] + * @param {*} childA - The first item to compare. + * @param {*} childB - The second item to compare. * - * @return {integer} [description] + * @return {integer} The result of the comparison, which will be negative if the first item is smaller then second, positive if the first item is larger than the second, or 0 if they're equal. */ sortHandler: function (childA, childB) { @@ -18708,7 +18757,7 @@ var List = new Class({ }, /** - * [description] + * Returns the first element in a given part of the List which matches a specific criterion. * * @method Phaser.Structs.List#getFirst * @since 3.0.0 @@ -18716,12 +18765,12 @@ var List = new Class({ * @genericUse {T} - [value] * @genericUse {T | null} - [$return] * - * @param {string} property - [description] - * @param {*} value - [description] - * @param {number} [startIndex=0] - [description] - * @param {number} [endIndex] - [description] + * @param {string} property - The name of the property to test or a falsey value to have no criterion. + * @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence. + * @param {number} [startIndex=0] - The position in the List to start the search at. + * @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked. * - * @return {?*} [description] + * @return {?*} The first item which matches the given criterion, or `null` if no such item exists. */ getFirst: function (property, value, startIndex, endIndex) { @@ -18754,7 +18803,7 @@ var List = new Class({ * @param {integer} [startIndex] - The first child index to start the search from. * @param {integer} [endIndex] - The last child index to search up until. * - * @return {Array.<*>} [description] + * @return {Array.<*>} All items of the List which match the given criterion, if any. */ getAll: function (property, value, startIndex, endIndex) { @@ -18762,17 +18811,17 @@ var List = new Class({ }, /** - * [description] + * Returns the total number of items in the List which have a property matching the given value. * * @method Phaser.Structs.List#count * @since 3.0.0 * * @genericUse {T} - [value] * - * @param {string} property - [description] - * @param {*} value - [description] + * @param {string} property - The property to test on each item. + * @param {*} value - The value to test the property against. * - * @return {integer} [description] + * @return {integer} The total number of matching elements. */ count: function (property, value) { @@ -18780,15 +18829,15 @@ var List = new Class({ }, /** - * [description] + * Swaps the positions of two items in the list. * * @method Phaser.Structs.List#swap * @since 3.0.0 * * @genericUse {T} - [child1,child2] * - * @param {*} child1 - [description] - * @param {*} child2 - [description] + * @param {*} child1 - The first item to swap. + * @param {*} child2 - The second item to swap. */ swap: function (child1, child2) { @@ -18796,17 +18845,17 @@ var List = new Class({ }, /** - * [description] + * Moves an item in the List to a new position. * * @method Phaser.Structs.List#moveTo * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] - * @param {integer} index - [description] + * @param {*} child - The item to move. + * @param {integer} index - Moves an item in the List to a new position. * - * @return {*} [description] + * @return {*} The item that was moved. */ moveTo: function (child, index) { @@ -18814,17 +18863,17 @@ var List = new Class({ }, /** - * [description] + * Removes one or many items from the List. * * @method Phaser.Structs.List#remove * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item, or array of items, to remove. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * - * @return {*} [description] + * @return {*} The item, or array of items, which were successfully removed from the List. */ remove: function (child, skipCallback) { @@ -18839,17 +18888,17 @@ var List = new Class({ }, /** - * [description] + * Removes the item at the given position in the List. * * @method Phaser.Structs.List#removeAt * @since 3.0.0 * * @genericUse {T} - [$return] * - * @param {integer} index - [description] + * @param {integer} index - The position to remove the item from. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * - * @return {*} [description] + * @return {*} The item that was removed. */ removeAt: function (index, skipCallback) { @@ -18864,18 +18913,18 @@ var List = new Class({ }, /** - * [description] + * Removes the items within the given range in the List. * * @method Phaser.Structs.List#removeBetween * @since 3.0.0 * * @genericUse {T[]} - [$return] * - * @param {integer} [startIndex=0] - [description] - * @param {integer} [endIndex] - [description] + * @param {integer} [startIndex=0] - The index to start removing from. + * @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * - * @return {Array.<*>} [description] + * @return {Array.<*>} An array of the items which were removed.[description] */ removeBetween: function (startIndex, endIndex, skipCallback) { @@ -18921,9 +18970,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to bring to the top of the List. * - * @return {*} [description] + * @return {*} The item which was moved. */ bringToTop: function (child) { @@ -18938,9 +18987,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to send to the back of the list. * - * @return {*} [description] + * @return {*} The item which was moved. */ sendToBack: function (child) { @@ -18955,9 +19004,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to move up. * - * @return {*} [description] + * @return {*} The item which was moved. */ moveUp: function (child) { @@ -18974,9 +19023,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to move down. * - * @return {*} [description] + * @return {*} The item which was moved. */ moveDown: function (child) { @@ -19003,7 +19052,7 @@ var List = new Class({ }, /** - * [description] + * Shuffles the items in the list. * * @method Phaser.Structs.List#shuffle * @since 3.0.0 @@ -19038,16 +19087,16 @@ var List = new Class({ }, /** - * [description] + * Checks if an item exists within the List. * * @method Phaser.Structs.List#exists * @since 3.0.0 * * @genericUse {T} - [child] * - * @param {*} child - [description] + * @param {*} child - The item to check for the existence of. * - * @return {boolean} True if the item is found in the list, otherwise false. + * @return {boolean} `true` if the item is found in the list, otherwise `false`. */ exists: function (child) { @@ -19062,8 +19111,8 @@ var List = new Class({ * * @genericUse {T} - [value] * - * @param {string} property - [description] - * @param {*} value - [description] + * @param {string} property - The name of the property to set. + * @param {*} value - The value to set the property to. * @param {integer} [startIndex] - The first child index to start the search from. * @param {integer} [endIndex] - The last child index to search up until. */ @@ -19104,7 +19153,7 @@ var List = new Class({ }, /** - * [description] + * Clears the List and recreates its internal array. * * @method Phaser.Structs.List#shutdown * @since 3.0.0 @@ -19117,7 +19166,7 @@ var List = new Class({ }, /** - * [description] + * Destroys this List. * * @method Phaser.Structs.List#destroy * @since 3.0.0 @@ -19132,7 +19181,7 @@ var List = new Class({ }, /** - * [description] + * The number of items inside the List. * * @name Phaser.Structs.List#length * @type {integer} @@ -19149,7 +19198,7 @@ var List = new Class({ }, /** - * [description] + * The first item in the List or `null` for an empty List. * * @name Phaser.Structs.List#first * @type {integer} @@ -19175,7 +19224,7 @@ var List = new Class({ }, /** - * [description] + * The last item in the List, or `null` for an empty List. * * @name Phaser.Structs.List#last * @type {integer} @@ -19201,7 +19250,9 @@ var List = new Class({ }, /** - * [description] + * The next item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. * * @name Phaser.Structs.List#next * @type {integer} @@ -19227,7 +19278,9 @@ var List = new Class({ }, /** - * [description] + * The previous item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. * * @name Phaser.Structs.List#previous * @type {integer} @@ -19765,6 +19818,9 @@ var Frame = new Class({ // Need to check for intersection between the cut area and the crop area // If there is none, we set UV to be empty, otherwise set it to be the intersection area + width = Clamp(width, 0, cw - x); + height = Clamp(height, 0, ch - y); + var cropRight = x + width; var cropBottom = y + height; @@ -21399,7 +21455,7 @@ module.exports = IsSizePowerOfTwo; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var OS = __webpack_require__(91); +var OS = __webpack_require__(92); /** * Determines the browser type and version running this Phaser Game instance. @@ -21544,7 +21600,7 @@ var Components = __webpack_require__(14); var DegToRad = __webpack_require__(31); var EventEmitter = __webpack_require__(11); var Rectangle = __webpack_require__(9); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var ValueToColor = __webpack_require__(178); var Vector2 = __webpack_require__(3); @@ -22337,8 +22393,8 @@ var BaseCamera = new Class({ var sy = y + ((scrollX * s + scrollY * c) * zoom); // Apply transform to point - output.x = (sx * ima + sy * imc + ime) * res; - output.y = (sx * imb + sy * imd + imf) * res; + output.x = (sx * ima + sy * imc) * res + ime; + output.y = (sx * imb + sy * imd) * res + imf; return output; }, @@ -24019,12 +24075,12 @@ module.exports = Perimeter; var BlendModes = __webpack_require__(66); var Circle = __webpack_require__(71); -var CircleContains = __webpack_require__(39); +var CircleContains = __webpack_require__(40); var Class = __webpack_require__(0); var Components = __webpack_require__(14); var GameObject = __webpack_require__(19); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); /** * @classdesc @@ -24473,7 +24529,7 @@ module.exports = TweenData; var Class = __webpack_require__(0); var GameObjectCreator = __webpack_require__(13); var GameObjectFactory = __webpack_require__(5); -var TWEEN_CONST = __webpack_require__(82); +var TWEEN_CONST = __webpack_require__(83); /** * @classdesc @@ -24793,12 +24849,12 @@ var Tween = new Class({ }, /** - * [description] + * Checks if the Tween is currently active. * * @method Phaser.Tweens.Tween#isPlaying * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if the Tween is active, otherwise `false`. */ isPlaying: function () { @@ -24806,12 +24862,12 @@ var Tween = new Class({ }, /** - * [description] + * Checks if the Tween is currently paused. * * @method Phaser.Tweens.Tween#isPaused * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if the Tween is paused, otherwise `false`. */ isPaused: function () { @@ -25189,7 +25245,7 @@ var Tween = new Class({ }, /** - * [description] + * Resumes the playback of a previously paused Tween. * * @method Phaser.Tweens.Tween#resume * @since 3.0.0 @@ -25874,17 +25930,17 @@ module.exports = Tween; /** * @typedef {object} Phaser.Tweens.TweenConfigDefaults * - * @property {(object|object[])} targets - [description] - * @property {number} [delay=0] - [description] - * @property {number} [duration=1000] - [description] - * @property {string} [ease='Power0'] - [description] - * @property {array} [easeParams] - [description] - * @property {number} [hold=0] - [description] - * @property {number} [repeat=0] - [description] - * @property {number} [repeatDelay=0] - [description] - * @property {boolean} [yoyo=false] - [description] - * @property {boolean} [flipX=false] - [description] - * @property {boolean} [flipY=false] - [description] + * @property {(object|object[])} targets - The object, or an array of objects, to run the tween on. + * @property {number} [delay=0] - The number of milliseconds to delay before the tween will start. + * @property {number} [duration=1000] - The duration of the tween in milliseconds. + * @property {string} [ease='Power0'] - The easing equation to use for the tween. + * @property {array} [easeParams] - Optional easing parameters. + * @property {number} [hold=0] - The number of milliseconds to hold the tween for before yoyo'ing. + * @property {number} [repeat=0] - The number of times to repeat the tween. + * @property {number} [repeatDelay=0] - The number of milliseconds to pause before a tween will repeat. + * @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + * @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. + * @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. */ var TWEEN_DEFAULTS = { @@ -26135,7 +26191,7 @@ module.exports = GetTargets; */ var Formats = __webpack_require__(29); -var MapData = __webpack_require__(76); +var MapData = __webpack_require__(77); var Parse = __webpack_require__(218); var Tilemap = __webpack_require__(210); @@ -26221,8 +26277,8 @@ module.exports = ParseToTilemap; */ var Formats = __webpack_require__(29); -var LayerData = __webpack_require__(77); -var MapData = __webpack_require__(76); +var LayerData = __webpack_require__(78); +var MapData = __webpack_require__(77); var Tile = __webpack_require__(55); /** @@ -26320,8 +26376,8 @@ module.exports = Parse2DArray; * @private * @since 3.0.0 * - * @param {integer} tileIndex - [description] - * @param {boolean} [collides=true] - [description] + * @param {integer} tileIndex - The tile index to set the collision boolean for. + * @param {boolean} [collides=true] - Should the tile index collide or not? * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetLayerCollisionIndex = function (tileIndex, collides, layer) @@ -26352,7 +26408,7 @@ module.exports = SetLayerCollisionIndex; */ var Tile = __webpack_require__(55); -var IsInLayerBounds = __webpack_require__(78); +var IsInLayerBounds = __webpack_require__(79); var CalculateFacesAt = __webpack_require__(135); var SetTileCollision = __webpack_require__(56); @@ -26367,9 +26423,9 @@ var SetTileCollision = __webpack_require__(56); * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. @@ -26611,13 +26667,13 @@ var Vector3 = new Class({ }, /** - * [description] + * Calculate the cross (vector) product of two given Vectors. * * @method Phaser.Math.Vector3#crossVectors * @since 3.0.0 * - * @param {Phaser.Math.Vector3} a - [description] - * @param {Phaser.Math.Vector3} b - [description] + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. * * @return {Phaser.Math.Vector3} This Vector3. */ @@ -26937,7 +26993,7 @@ var Vector3 = new Class({ * * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. * - * @return {number} [description] + * @return {number} The dot product of this Vector and `v`. */ dot: function (v) { @@ -26945,12 +27001,12 @@ var Vector3 = new Class({ }, /** - * [description] + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. * * @method Phaser.Math.Vector3#cross * @since 3.0.0 * - * @param {Phaser.Math.Vector3} v - [description] + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. * * @return {Phaser.Math.Vector3} This Vector3. */ @@ -28235,17 +28291,18 @@ module.exports = RotateAroundXY; // if 'returnFirst' is true it will return after the first point within the triangle is found /** - * [description] + * Filters an array of point-like objects to only those contained within a triangle. + * If `returnFirst` is true, will return an array containing only the first point in the provided array that is within the triangle (or an empty array if there are no such points). * * @function Phaser.Geom.Triangle.ContainsArray * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Point[]} points - [description] - * @param {boolean} [returnFirst] - [description] - * @param {array} [out] - [description] + * @param {Phaser.Geom.Triangle} triangle - The triangle that the points are being checked in. + * @param {Phaser.Geom.Point[]} points - An array of point-like objects (objects that have an `x` and `y` property) + * @param {boolean} [returnFirst=false] - If `true`, return an array containing only the first point found that is within the triangle. + * @param {array} [out] - If provided, the points that are within the triangle will be appended to this array instead of being added to a new array. If `returnFirst` is true, only the first point found within the triangle will be appended. This array will also be returned by this function. * - * @return {Phaser.Geom.Point[]} [description] + * @return {Phaser.Geom.Point[]} An array containing all the points from `points` that are within the triangle, if an array was provided as `out`, points will be appended to that array and it will also be returned here. */ var ContainsArray = function (triangle, points, returnFirst, out) { @@ -29013,16 +29070,16 @@ module.exports = Quad; // Adapted from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html by Jonas Raoni Soares Silva /** - * [description] + * Checks if a point is within the bounds of a Polygon. * * @function Phaser.Geom.Polygon.Contains * @since 3.0.0 * - * @param {Phaser.Geom.Polygon} polygon - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Polygon} polygon - The Polygon to check against. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the point is within the bounds of the Polygon, otherwise `false`. */ var Contains = function (polygon, x, y) { @@ -29105,15 +29162,15 @@ var Polygon = new Class({ }, /** - * [description] + * Check to see if the Polygon contains the given x / y coordinates. * * @method Phaser.Geom.Polygon#contains * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate to check within the polygon. + * @param {number} y - The y coordinate to check within the polygon. * - * @return {boolean} [description] + * @return {boolean} `true` if the coordinates are within the polygon, otherwise `false`. */ contains: function (x, y) { @@ -29125,6 +29182,7 @@ var Polygon = new Class({ * * The points can be set from a variety of formats: * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` @@ -29144,6 +29202,11 @@ var Polygon = new Class({ this.area = 0; this.points = []; + if (typeof points === 'string') + { + points = points.split(' '); + } + if (!Array.isArray(points)) { return this; @@ -29157,10 +29220,10 @@ var Polygon = new Class({ { p = { x: 0, y: 0 }; - if (typeof points[i] === 'number') + if (typeof points[i] === 'number' || typeof points[i] === 'string') { - p.x = points[i]; - p.y = points[i + 1]; + p.x = parseFloat(points[i]); + p.y = parseFloat(points[i + 1]); i++; } else if (Array.isArray(points[i])) @@ -29195,7 +29258,7 @@ var Polygon = new Class({ * @method Phaser.Geom.Polygon#calculateArea * @since 3.0.0 * - * @return {number} [description] + * @return {number} The area of the polygon. */ calculateArea: function () { @@ -32242,7 +32305,16 @@ var ParticleEmitterManager = new Class({ { this.frame = this.texture.get(frame); - this.frameNames = this.texture.getFramesFromTextureSource(this.frame.sourceIndex); + var frames = this.texture.getFramesFromTextureSource(this.frame.sourceIndex); + + var names = []; + + frames.forEach(function (sourceFrame) + { + names.push(sourceFrame.name); + }); + + this.frameNames = names; this.defaultFrame = this.frame; @@ -32609,7 +32681,7 @@ var ComponentsTransform = __webpack_require__(391); var ComponentsVisible = __webpack_require__(390); var ComponentsScrollFactor = __webpack_require__(393); -var Ellipse = __webpack_require__(89); +var Ellipse = __webpack_require__(90); var GameObject = __webpack_require__(19); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(4); @@ -34086,9 +34158,9 @@ var Graphics = new Class({ // var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip) this.renderCanvas(renderer, this, 0, Graphics.TargetCamera, null, ctx, false); - if (renderer.gl && texture) + if (texture) { - texture.source[0].glTexture = renderer.canvasToTexture(ctx.canvas, texture.source[0].glTexture); + texture.refresh(); } } @@ -34756,10 +34828,6 @@ var Container = new Class({ gameObject.parentContainer = this; } - - // Game Objects automatically listen to the Scene shutdown event, but - // we don't need this if they're in a Container - this._sysEvents.off('shutdown', gameObject.destroy, gameObject); }, /** @@ -34778,8 +34846,6 @@ var Container = new Class({ if (this.exclusive) { gameObject.parentContainer = null; - - this._sysEvents.once('shutdown', gameObject.destroy, gameObject); } }, @@ -36057,7 +36123,7 @@ module.exports = { SendToBack: __webpack_require__(849), SetAll: __webpack_require__(848), Shuffle: __webpack_require__(121), - SpliceOne: __webpack_require__(90), + SpliceOne: __webpack_require__(91), StableSort: __webpack_require__(110), Swap: __webpack_require__(847) @@ -36316,16 +36382,19 @@ var Texture = new Class({ * @since 3.0.0 * * @param {integer} sourceIndex - The index of the TextureSource to get the Frames from. + * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array? * * @return {Phaser.Textures.Frame[]} An array of Texture Frames. */ - getFramesFromTextureSource: function (sourceIndex) + getFramesFromTextureSource: function (sourceIndex, includeBase) { + if (includeBase === undefined) { includeBase = false; } + var out = []; for (var frameName in this.frames) { - if (frameName === '__BASE') + if (frameName === '__BASE' && !includeBase) { continue; } @@ -36334,7 +36403,7 @@ var Texture = new Class({ if (frame.sourceIndex === sourceIndex) { - out.push(frame.name); + out.push(frame); } } @@ -37384,7 +37453,7 @@ module.exports = DefaultPlugins; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var OS = __webpack_require__(91); +var OS = __webpack_require__(92); var Browser = __webpack_require__(118); var CanvasPool = __webpack_require__(24); @@ -37754,17 +37823,17 @@ var Rectangle = __webpack_require__(9); // ] /** - * [description] + * Constructs new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds. * * @function Phaser.Geom.Rectangle.FromPoints * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [out,$return] * - * @param {array} points - [description] - * @param {Phaser.Geom.Rectangle} [out] - [description] + * @param {array} points - An array of points (either arrays with two elements corresponding to the X and Y coordinate or an object with public `x` and `y` properties) which should be surrounded by the Rectangle. + * @param {Phaser.Geom.Rectangle} [out] - Optional Rectangle to adjust. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted `out` Rectangle, or a new Rectangle if none was provided. */ var FromPoints = function (points, out) { @@ -37912,18 +37981,18 @@ module.exports = { // Centers this Rectangle so that the center coordinates match the given x and y values. /** - * [description] + * Moves the top-left corner of a Rectangle so that its center is at the given coordinates. * * @function Phaser.Geom.Rectangle.CenterOn * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to be centered. + * @param {number} x - The X coordinate of the Rectangle's center. + * @param {number} y - The Y coordinate of the Rectangle's center. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The centered rectangle. */ var CenterOn = function (rect, x, y) { @@ -38356,11 +38425,14 @@ var Class = __webpack_require__(0); /** * @classdesc * The keys of a Map can be arbitrary values. + * + * ```javascript * var map = new Map([ * [ 1, 'one' ], * [ 2, 'two' ], * [ 3, 'three' ] * ]); + * ``` * * @class Map * @memberOf Phaser.Structs @@ -38371,7 +38443,7 @@ var Class = __webpack_require__(0); * @generic V * @genericUse {V[]} - [elements] * - * @param {Array.<*>} elements - [description] + * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with. */ var Map = new Class({ @@ -38380,7 +38452,7 @@ var Map = new Class({ function Map (elements) { /** - * [description] + * The entries in this Map. * * @genericUse {Object.} - [$type] * @@ -38392,7 +38464,7 @@ var Map = new Class({ this.entries = {}; /** - * [description] + * The number of key / value pairs in this Map. * * @name Phaser.Structs.Map#size * @type {number} @@ -38411,7 +38483,7 @@ var Map = new Class({ }, /** - * [description] + * Adds an element with a specified `key` and `value` to this Map. * * @method Phaser.Structs.Map#set * @since 3.0.0 @@ -38420,8 +38492,8 @@ var Map = new Class({ * @genericUse {V} - [value] * @genericUse {Phaser.Structs.Map.} - [$return] * - * @param {string} key - [description] - * @param {*} value - [description] + * @param {string} key - The key of the element to be added to this Map. + * @param {*} value - The value of the element to be added to this Map. * * @return {Phaser.Structs.Map} This Map object. */ @@ -38437,7 +38509,7 @@ var Map = new Class({ }, /** - * [description] + * Returns the value associated to the `key`, or `undefined` if there is none. * * @method Phaser.Structs.Map#get * @since 3.0.0 @@ -38445,9 +38517,9 @@ var Map = new Class({ * @genericUse {K} - [key] * @genericUse {V} - [$return] * - * @param {string} key - [description] + * @param {string} key - The key of the element to return from the `Map` object. * - * @return {*} [description] + * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object. */ get: function (key) { @@ -38458,14 +38530,14 @@ var Map = new Class({ }, /** - * [description] + * Returns an `Array` of all the values stored in this Map. * * @method Phaser.Structs.Map#getArray * @since 3.0.0 * * @genericUse {V[]} - [$return] * - * @return {Array.<*>} [description] + * @return {Array.<*>} An array of the values stored in this Map. */ getArray: function () { @@ -38481,16 +38553,16 @@ var Map = new Class({ }, /** - * [description] + * Returns a boolean indicating whether an element with the specified key exists or not. * * @method Phaser.Structs.Map#has * @since 3.0.0 * * @genericUse {K} - [key] * - * @param {string} key - [description] + * @param {string} key - The key of the element to test for presence of in this Map. * - * @return {boolean} [description] + * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`. */ has: function (key) { @@ -38498,7 +38570,7 @@ var Map = new Class({ }, /** - * [description] + * Delete the specified element from this Map. * * @method Phaser.Structs.Map#delete * @since 3.0.0 @@ -38506,7 +38578,7 @@ var Map = new Class({ * @genericUse {K} - [key] * @genericUse {Phaser.Structs.Map.} - [$return] * - * @param {string} key - [description] + * @param {string} key - The key of the element to delete from this Map. * * @return {Phaser.Structs.Map} This Map object. */ @@ -38522,7 +38594,7 @@ var Map = new Class({ }, /** - * [description] + * Delete all entries from this Map. * * @method Phaser.Structs.Map#clear * @since 3.0.0 @@ -38545,14 +38617,14 @@ var Map = new Class({ }, /** - * [description] + * Returns all entries keys in this Map. * * @method Phaser.Structs.Map#keys * @since 3.0.0 * * @genericUse {K[]} - [$return] * - * @return {string[]} [description] + * @return {string[]} Array containing entries' keys. */ keys: function () { @@ -38560,14 +38632,14 @@ var Map = new Class({ }, /** - * [description] + * Returns an `Array` of all entries. * * @method Phaser.Structs.Map#values * @since 3.0.0 * * @genericUse {V[]} - [$return] * - * @return {Array.<*>} [description] + * @return {Array.<*>} An `Array` of entries. */ values: function () { @@ -38583,7 +38655,7 @@ var Map = new Class({ }, /** - * [description] + * Dumps the contents of this Map to the console via `console.group`. * * @method Phaser.Structs.Map#dump * @since 3.0.0 @@ -38605,7 +38677,7 @@ var Map = new Class({ }, /** - * [description] + * Passes all entries in this Map to the given callback. * * @method Phaser.Structs.Map#each * @since 3.0.0 @@ -38613,7 +38685,7 @@ var Map = new Class({ * @genericUse {EachMapCallback.} - [callback] * @genericUse {Phaser.Structs.Map.} - [$return] * - * @param {EachMapCallback} callback - [description] + * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map. * * @return {Phaser.Structs.Map} This Map object. */ @@ -38633,16 +38705,16 @@ var Map = new Class({ }, /** - * [description] + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. * * @method Phaser.Structs.Map#contains * @since 3.0.0 * * @genericUse {V} - [value] * - * @param {*} value - [description] + * @param {*} value - The value to search for. * - * @return {boolean} [description] + * @return {boolean} `true` if the value is found, otherwise `false`. */ contains: function (value) { @@ -38660,17 +38732,16 @@ var Map = new Class({ }, /** - * Merges all new keys from the given Map into this one - * If it encounters a key that already exists it will be skipped - * unless override = true. + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. * * @method Phaser.Structs.Map#merge * @since 3.0.0 * * @genericUse {Phaser.Structs.Map.} - [map,$return] * - * @param {Phaser.Structs.Map} map - [description] - * @param {boolean} [override=false] - [description] + * @param {Phaser.Structs.Map} map - The Map to merge in to this Map. + * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. * * @return {Phaser.Structs.Map} This Map object. */ @@ -39063,17 +39134,17 @@ module.exports = Pipeline; var Point = __webpack_require__(6); /** - * [description] + * Returns a random point within a Rectangle. * * @function Phaser.Geom.Rectangle.Random * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point} out - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to return a point from. + * @param {Phaser.Geom.Point} out - The object to update with the point's coordinates. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} The modified `out` object, or a new Point if none was provided. */ var Random = function (rect, out) { @@ -39506,7 +39577,7 @@ var GetFastValue = __webpack_require__(2); var ModelViewProjection = __webpack_require__(893); var ShaderSourceFS = __webpack_require__(892); var ShaderSourceVS = __webpack_require__(891); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var Utils = __webpack_require__(10); var WebGLPipeline = __webpack_require__(198); @@ -39756,7 +39827,7 @@ var TextureTintPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#onBind * @since 3.0.0 * - * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + * @return {this} This WebGLPipeline instance. */ onBind: function () { @@ -39777,7 +39848,7 @@ var TextureTintPipeline = new Class({ * @param {number} height - The new height. * @param {number} resolution - The resolution. * - * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + * @return {this} This WebGLPipeline instance. */ resize: function (width, height, resolution) { @@ -39813,7 +39884,7 @@ var TextureTintPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#flush * @since 3.0.0 * - * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + * @return {this} This WebGLPipeline instance. */ flush: function () { @@ -39871,8 +39942,8 @@ var TextureTintPipeline = new Class({ var v1 = frame.v1; var frameX = frame.x; var frameY = frame.y; - var frameWidth = frame.width; - var frameHeight = frame.height; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; var x = -sprite.displayOriginX + frameX; var y = -sprite.displayOriginY + frameY; @@ -40196,6 +40267,7 @@ var TextureTintPipeline = new Class({ * @param {number} vOffset - Vertical offset on texture coordinate. * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera. * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container. + * @param {boolean} [skipFlip=false] - Skip the renderTexture check. */ batchTexture: function ( gameObject, @@ -40212,7 +40284,8 @@ var TextureTintPipeline = new Class({ tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, - parentTransformMatrix) + parentTransformMatrix, + skipFlip) { this.renderer.setPipeline(this, gameObject); @@ -40267,7 +40340,7 @@ var TextureTintPipeline = new Class({ } // Invert the flipY if this is a RenderTexture - flipY = flipY ^ (texture.isRenderTexture ? 1 : 0); + flipY = flipY ^ (!skipFlip && texture.isRenderTexture ? 1 : 0); if (flipX) { @@ -40892,7 +40965,7 @@ var ForwardDiffuseLightPipeline = new Class({ * * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. * - * @return {Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline} [description] + * @return {this} This WebGLPipeline instance. */ onBind: function (gameObject) { @@ -40923,7 +40996,7 @@ var ForwardDiffuseLightPipeline = new Class({ * @param {Phaser.Scene} scene - [description] * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] * - * @return {Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline} [description] + * @return {this} This WebGLPipeline instance. */ onRender: function (scene, camera) { @@ -42039,7 +42112,7 @@ module.exports = WebGLPipeline; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * Wrap an angle in degrees. @@ -42071,7 +42144,7 @@ module.exports = WrapDegrees; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var MathWrap = __webpack_require__(52); +var MathWrap = __webpack_require__(53); /** * Wrap an angle. @@ -42132,7 +42205,7 @@ module.exports = g; var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(11); var TweenBuilder = __webpack_require__(97); -var TWEEN_CONST = __webpack_require__(82); +var TWEEN_CONST = __webpack_require__(83); /** * @classdesc @@ -42368,12 +42441,13 @@ var Timeline = new Class({ }, /** - * [description] + * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. * * @method Phaser.Tweens.Timeline#setTimeScale * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - The time scale value to set. * * @return {Phaser.Tweens.Timeline} This Timeline object. */ @@ -42385,12 +42459,12 @@ var Timeline = new Class({ }, /** - * [description] + * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. * * @method Phaser.Tweens.Timeline#getTimeScale * @since 3.0.0 * - * @return {number} [description] + * @return {number} The value of the time scale applied to this Tween. */ getTimeScale: function () { @@ -42398,12 +42472,12 @@ var Timeline = new Class({ }, /** - * [description] + * Check whether or not the Timeline is playing. * * @method Phaser.Tweens.Timeline#isPlaying * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if this Timeline is active, otherwise `false`. */ isPlaying: function () { @@ -42648,7 +42722,7 @@ var Timeline = new Class({ }, /** - * [description] + * Sets a callback for the Tween Manager. * * @method Phaser.Tweens.Timeline#setCallback * @since 3.0.0 @@ -42968,7 +43042,7 @@ var Timeline = new Class({ }, /** - * [description] + * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags them for removal by the TweenManager. * * @method Phaser.Tweens.Timeline#destroy * @since 3.0.0 @@ -43001,8 +43075,8 @@ module.exports = Timeline; var Clone = __webpack_require__(63); var Defaults = __webpack_require__(128); var GetAdvancedValue = __webpack_require__(12); -var GetBoolean = __webpack_require__(83); -var GetEaseFunction = __webpack_require__(85); +var GetBoolean = __webpack_require__(84); +var GetEaseFunction = __webpack_require__(86); var GetNewValue = __webpack_require__(98); var GetTargets = __webpack_require__(130); var GetTweens = __webpack_require__(205); @@ -43152,8 +43226,8 @@ module.exports = TimelineBuilder; var Defaults = __webpack_require__(128); var GetAdvancedValue = __webpack_require__(12); -var GetBoolean = __webpack_require__(83); -var GetEaseFunction = __webpack_require__(85); +var GetBoolean = __webpack_require__(84); +var GetEaseFunction = __webpack_require__(86); var GetNewValue = __webpack_require__(98); var GetValue = __webpack_require__(4); var GetValueOp = __webpack_require__(129); @@ -43332,9 +43406,9 @@ var RESERVED = __webpack_require__(437); * @function Phaser.Tweens.Builders.GetProps * @since 3.0.0 * - * @param {object} config - [description] + * @param {object} config - The configuration object of the tween to get the target(s) from. * - * @return {array} [description] + * @return {array} An array of all the targets the tween is operating on. */ var GetProps = function (config) { @@ -43705,16 +43779,18 @@ var CONST = __webpack_require__(26); var GameObject = __webpack_require__(19); var StaticTilemapLayerRender = __webpack_require__(446); var TilemapComponents = __webpack_require__(103); +var TransformMatrix = __webpack_require__(38); var Utils = __webpack_require__(10); /** * @classdesc - * A StaticTilemapLayer is a game object that renders LayerData from a Tilemap. A - * StaticTilemapLayer can only render tiles from a single tileset. + * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. * - * A StaticTilemapLayer is optimized for speed over flexibility. You cannot apply per-tile - * effects like tint or alpha. You cannot change the tiles in a StaticTilemapLayer. Use this - * over a DynamicTilemapLayer when you don't need either of those features. + * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile + * effects like tint or alpha, or change the tiles or tilesets the layer uses. + * + * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. * * @class StaticTilemapLayer * @extends Phaser.GameObjects.GameObject @@ -43735,10 +43811,10 @@ var Utils = __webpack_require__(10); * @extends Phaser.GameObjects.Components.Visible * @extends Phaser.GameObjects.Components.ScrollFactor * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. * @param {integer} layerIndex - The index of the LayerData associated with this layer. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset used to render the tiles in this layer. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. */ @@ -43806,16 +43882,19 @@ var StaticTilemapLayer = new Class({ */ this.layer = tilemap.layers[layerIndex]; - this.layer.tilemapLayer = this; // Link the LayerData with this static tilemap layer + // Link the LayerData with this static tilemap layer + this.layer.tilemapLayer = this; /** - * The Tileset associated with this layer. A tilemap layer can only render from one Tileset. + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. * * @name Phaser.Tilemaps.StaticTilemapLayer#tileset - * @type {Phaser.Tilemaps.Tileset} + * @type {Phaser.Tilemaps.Tileset[]} * @since 3.0.0 */ - this.tileset = tileset; + this.tileset = []; /** * Used internally by the Canvas renderer. @@ -43918,14 +43997,8 @@ var StaticTilemapLayer = new Class({ this.cullCallback = TilemapComponents.CullTiles; /** - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer - * @type {array} - * @private - * @since 3.0.0 - */ - this.vertexBuffer = null; - - /** + * A reference to the renderer. + * * @name Phaser.Tilemaps.StaticTilemapLayer#renderer * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @private @@ -43934,44 +44007,76 @@ var StaticTilemapLayer = new Class({ this.renderer = scene.sys.game.renderer; /** + * An array of vertex buffer objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer + * @type {WebGLBuffer[]} + * @private + * @since 3.0.0 + */ + this.vertexBuffer = []; + + /** + * An array of ArrayBuffer objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * * @name Phaser.Tilemaps.StaticTilemapLayer#bufferData - * @type {ArrayBuffer} + * @type {ArrayBuffer[]} * @private * @since 3.0.0 */ - this.bufferData = null; + this.bufferData = []; /** + * An array of Float32 Array objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewF32 - * @type {Float32Array} + * @type {Float32Array[]} * @private * @since 3.0.0 */ - this.vertexViewF32 = null; + this.vertexViewF32 = []; /** + * An array of Uint32 Array objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewU32 - * @type {Uint32Array} + * @type {Uint32Array[]} * @private * @since 3.0.0 */ - this.vertexViewU32 = null; + this.vertexViewU32 = []; /** + * An array of booleans, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single boolean. + * * @name Phaser.Tilemaps.StaticTilemapLayer#dirty - * @type {boolean} + * @type {boolean[]} * @private * @since 3.0.0 */ - this.dirty = true; + this.dirty = []; /** + * An array of integers, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single integer. + * * @name Phaser.Tilemaps.StaticTilemapLayer#vertexCount - * @type {integer} + * @type {integer[]} * @private * @since 3.0.0 */ - this.vertexCount = 0; + this.vertexCount = []; /** * The rendering (draw) order of the tiles in this layer. @@ -43996,61 +44101,109 @@ var StaticTilemapLayer = new Class({ */ this._renderOrder = 0; + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#_tempMatrix + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.14.0 + */ + this._tempMatrix = new TransformMatrix(); + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#gidMap + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.14.0 + */ + this.gidMap = []; + + this.setTilesets(tileset); this.setAlpha(this.layer.alpha); this.setPosition(x, y); this.setOrigin(); this.setSize(this.layer.tileWidth * this.layer.width, this.layer.tileHeight * this.layer.height); + this.updateVBOData(); + this.initPipeline('TextureTintPipeline'); if (scene.sys.game.config.renderType === CONST.WEBGL) { scene.sys.game.renderer.onContextRestored(function () { - this.dirty = true; - this.vertexBuffer = null; + this.updateVBOData(); }, this); } }, /** - * Sets the rendering (draw) order of the tiles in this layer. - * - * The default is 'right-down', meaning it will order the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * Setting the render order does not change the tiles or how they are stored in the layer, - * it purely impacts the order in which they are rendered. - * - * You can provide either an integer (0 to 3), or the string version of the order. + * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. * - * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder - * @since 3.12.0 + * @method Phaser.Tilemaps.StaticTilemapLayer#setTilesets + * @private + * @since 3.14.0 + * + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + */ + setTilesets: function (tilesets) + { + var gidMap = []; + var setList = []; + var map = this.tilemap; + + if (!Array.isArray(tilesets)) + { + tilesets = [ tilesets ]; + } + + for (var i = 0; i < tilesets.length; i++) + { + var tileset = tilesets[i]; + + if (typeof tileset === 'string') + { + tileset = map.getTileset(tileset); + } + + if (tileset) + { + setList.push(tileset); + + var s = tileset.firstgid; + + for (var t = 0; t < tileset.total; t++) + { + gidMap[s + t] = tileset; + } + } + } + + this.gidMap = gidMap; + this.tileset = setList; + }, + + /** + * Prepares the VBO data arrays for population by the `upload` method. * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * @method Phaser.Tilemaps.StaticTilemapLayer#updateVBOData + * @private + * @since 3.14.0 * * @return {this} This Tilemap Layer object. */ - setRenderOrder: function (renderOrder) + updateVBOData: function () { - var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; - - if (typeof renderOrder === 'string') + for (var i = 0; i < this.tileset.length; i++) { - renderOrder = orders.indexOf(renderOrder); - } - - if (renderOrder >= 0 && renderOrder < 4) - { - this._renderOrder = renderOrder; - this.dirty = true; + this.dirty[i] = true; + this.vertexCount[i] = 0; + this.vertexBuffer[i] = null; + this.bufferData[i] = null; + this.vertexViewF32[i] = null; + this.vertexViewU32[i] = null; } return this; @@ -44063,19 +44216,20 @@ var StaticTilemapLayer = new Class({ * @since 3.0.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to render to. + * @param {integer} tilesetIndex - The tileset index. * * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. */ - upload: function (camera) + upload: function (camera, tilesetIndex) { var renderer = this.renderer; var gl = renderer.gl; var pipeline = renderer.pipelines.TextureTintPipeline; - if (this.dirty) + if (this.dirty[tilesetIndex]) { - var tileset = this.tileset; + var tileset = this.tileset[tilesetIndex]; var mapWidth = this.layer.width; var mapHeight = this.layer.height; var width = tileset.image.source[0].width; @@ -44085,22 +44239,24 @@ var StaticTilemapLayer = new Class({ var row; var col; var renderOrder = this._renderOrder; + var minTileIndex = tileset.firstgid; + var maxTileIndex = tileset.firstgid + tileset.total; - var vertexBuffer = this.vertexBuffer; - var bufferData = this.bufferData; + var vertexBuffer = this.vertexBuffer[tilesetIndex]; + var bufferData = this.bufferData[tilesetIndex]; var vOffset = -1; var bufferSize = (mapWidth * mapHeight) * pipeline.vertexSize * 6; - this.vertexCount = 0; + this.vertexCount[tilesetIndex] = 0; if (bufferData === null) { bufferData = new ArrayBuffer(bufferSize); - this.bufferData = bufferData; + this.bufferData[tilesetIndex] = bufferData; - this.vertexViewF32 = new Float32Array(bufferData); - this.vertexViewU32 = new Uint32Array(bufferData); + this.vertexViewF32[tilesetIndex] = new Float32Array(bufferData); + this.vertexViewU32[tilesetIndex] = new Uint32Array(bufferData); } if (renderOrder === 0) @@ -44113,12 +44269,12 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } @@ -44132,12 +44288,12 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } @@ -44151,12 +44307,12 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } @@ -44170,23 +44326,23 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } - this.dirty = false; + this.dirty[tilesetIndex] = false; if (vertexBuffer === null) { vertexBuffer = renderer.createVertexBuffer(bufferData, gl.STATIC_DRAW); - this.vertexBuffer = vertexBuffer; + this.vertexBuffer[tilesetIndex] = vertexBuffer; } else { @@ -44196,11 +44352,6 @@ var StaticTilemapLayer = new Class({ } } - pipeline.modelIdentity(); - pipeline.modelTranslate(this.x - (camera.scrollX * this.scrollFactorX), this.y - (camera.scrollY * this.scrollFactorY), 0); - pipeline.modelScale(this.scaleX, this.scaleY, 1); - pipeline.viewLoad2D(camera.matrix.matrix); - return this; }, @@ -44217,21 +44368,17 @@ var StaticTilemapLayer = new Class({ * @param {integer} width - The width of the layer. * @param {integer} height - The height of the layer. * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the layer is being rendered with. + * @param {integer} tilesetIndex - The tileset index. * * @return {integer} The new vOffset value. */ - batchTile: function (vOffset, tile, tileset, width, height, camera) + batchTile: function (vOffset, tile, tileset, width, height, camera, tilesetIndex) { - var tx = tile.pixelX; - var ty = tile.pixelY; - var txw = tx + tile.width; - var tyh = ty + tile.height; - var texCoords = tileset.getTileTextureCoordinates(tile.index); if (!texCoords) { - return; + return vOffset; } var u0 = texCoords.x / width; @@ -44239,16 +44386,47 @@ var StaticTilemapLayer = new Class({ var u1 = (texCoords.x + tile.width) / width; var v1 = (texCoords.y + tile.height) / height; + var matrix = this._tempMatrix; + + var tileWidth = tile.width; + var tileHeight = tile.height; + + var halfTileWidth = tileWidth / 2; + var halfTileHeight = tileHeight / 2; + + var x = -halfTileWidth; + var y = -halfTileHeight; + + if (tile.flipX) + { + tileWidth *= -1; + x += tile.width; + } + + if (tile.flipY) + { + tileHeight *= -1; + y += tile.height; + } + + var xw = x + tileWidth; + var yh = y + tileHeight; + + matrix.applyITRS(halfTileWidth + tile.pixelX, halfTileHeight + tile.pixelY, tile.rotation, 1, 1); + var tint = Utils.getTintAppendFloatAlpha(0xffffff, camera.alpha * this.alpha * tile.alpha); - var tx0 = tx; - var ty0 = ty; - var tx1 = tx; - var ty1 = tyh; - var tx2 = txw; - var ty2 = tyh; - var tx3 = txw; - var ty3 = ty; + var tx0 = matrix.getX(x, y); + var ty0 = matrix.getY(x, y); + + var tx1 = matrix.getX(x, yh); + var ty1 = matrix.getY(x, yh); + + var tx2 = matrix.getX(xw, yh); + var ty2 = matrix.getY(xw, yh); + + var tx3 = matrix.getX(xw, y); + var ty3 = matrix.getY(xw, y); if (camera.roundPixels) { @@ -44265,8 +44443,8 @@ var StaticTilemapLayer = new Class({ ty3 |= 0; } - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; + var vertexViewF32 = this.vertexViewF32[tilesetIndex]; + var vertexViewU32 = this.vertexViewU32[tilesetIndex]; vertexViewF32[++vOffset] = tx0; vertexViewF32[++vOffset] = ty0; @@ -44310,11 +44488,58 @@ var StaticTilemapLayer = new Class({ vertexViewF32[++vOffset] = 0; vertexViewU32[++vOffset] = tint; - this.vertexCount += 6; + this.vertexCount[tilesetIndex] += 6; return vOffset; }, + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder + * @since 3.12.0 + * + * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * + * @return {this} This Tilemap Layer object. + */ + setRenderOrder: function (renderOrder) + { + var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; + + if (typeof renderOrder === 'string') + { + renderOrder = orders.indexOf(renderOrder); + } + + if (renderOrder >= 0 && renderOrder < 4) + { + this._renderOrder = renderOrder; + + for (var i = 0; i < this.tileset.length; i++) + { + this.dirty[i] = true; + } + } + + return this; + }, + /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting * faces are used internally for optimizing collisions against tiles. This method is mostly used @@ -45038,10 +45263,22 @@ var StaticTilemapLayer = new Class({ this.tilemap = undefined; this.layer = undefined; - this.tileset = undefined; this.culledTiles.length = 0; this.cullCallback = null; + for (var i = 0; i < this.tileset.length; i++) + { + this.dirty[i] = true; + this.vertexCount[i] = 0; + this.vertexBuffer[i] = null; + this.bufferData[i] = null; + this.vertexViewF32[i] = null; + this.vertexViewU32[i] = null; + } + + this.gidMap = []; + this.tileset = []; + GameObject.prototype.destroy.call(this); } @@ -45068,13 +45305,14 @@ var TilemapComponents = __webpack_require__(103); /** * @classdesc - * A DynamicTilemapLayer is a game object that renders LayerData from a Tilemap. A - * DynamicTilemapLayer can only render tiles from a single tileset. + * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. * - * A DynamicTilemapLayer trades some speed for being able to apply powerful effects. Unlike a - * StaticTilemapLayer, you can apply per-tile effects like tint or alpha, and you can change the - * tiles in a DynamicTilemapLayer. Use this over a StaticTilemapLayer when you need those - * features. + * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a + * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the + * tiles in a DynamicTilemapLayer. + * + * Use this over a Static Tilemap Layer when you need those features. * * @class DynamicTilemapLayer * @extends Phaser.GameObjects.GameObject @@ -45095,10 +45333,10 @@ var TilemapComponents = __webpack_require__(103); * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. * @param {integer} layerIndex - The index of the LayerData associated with this layer. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset used to render the tiles in this layer. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. */ @@ -45166,16 +45404,19 @@ var DynamicTilemapLayer = new Class({ */ this.layer = tilemap.layers[layerIndex]; - this.layer.tilemapLayer = this; // Link the LayerData with this static tilemap layer + // Link the LayerData with this static tilemap layer + this.layer.tilemapLayer = this; /** - * The Tileset associated with this layer. A tilemap layer can only render from one Tileset. + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. * * @name Phaser.Tilemaps.DynamicTilemapLayer#tileset - * @type {Phaser.Tilemaps.Tileset} + * @type {Phaser.Tilemaps.Tileset[]} * @since 3.0.0 */ - this.tileset = tileset; + this.tileset = []; /** * Used internally with the canvas render. This holds the tiles that are visible within the @@ -45286,6 +45527,16 @@ var DynamicTilemapLayer = new Class({ */ this._renderOrder = 0; + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#gidMap + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.14.0 + */ + this.gidMap = []; + + this.setTilesets(tileset); this.setAlpha(this.layer.alpha); this.setPosition(x, y); this.setOrigin(); @@ -45294,6 +45545,52 @@ var DynamicTilemapLayer = new Class({ this.initPipeline('TextureTintPipeline'); }, + /** + * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setTilesets + * @private + * @since 3.14.0 + * + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + */ + setTilesets: function (tilesets) + { + var gidMap = []; + var setList = []; + var map = this.tilemap; + + if (!Array.isArray(tilesets)) + { + tilesets = [ tilesets ]; + } + + for (var i = 0; i < tilesets.length; i++) + { + var tileset = tilesets[i]; + + if (typeof tileset === 'string') + { + tileset = map.getTileset(tileset); + } + + if (tileset) + { + setList.push(tileset); + + var s = tileset.firstgid; + + for (var t = 0; t < tileset.total; t++) + { + gidMap[s + t] = tileset; + } + } + } + + this.gidMap = gidMap; + this.tileset = setList; + }, + /** * Sets the rendering (draw) order of the tiles in this layer. * @@ -45364,10 +45661,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -45427,13 +45724,13 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#copy * @since 3.0.0 * - * @param {integer} srcTileX - [description] - * @param {integer} srcTileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] - * @param {integer} destTileX - [description] - * @param {integer} destTileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -45460,10 +45757,12 @@ var DynamicTilemapLayer = new Class({ this.tilemap = undefined; this.layer = undefined; - this.tileset = undefined; this.culledTiles.length = 0; this.cullCallback = null; + this.gidMap = []; + this.tileset = []; + GameObject.prototype.destroy.call(this); }, @@ -45475,12 +45774,12 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#fill * @since 3.0.0 * - * @param {integer} index - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} index - The tile index to fill the area with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -45503,17 +45802,14 @@ var DynamicTilemapLayer = new Class({ * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -45552,20 +45848,16 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#findTile * @since 3.0.0 * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {?Phaser.Tilemaps.Tile} */ @@ -45581,20 +45873,16 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#forEachTile * @since 3.0.0 * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -45613,8 +45901,7 @@ var DynamicTilemapLayer = new Class({ * * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ @@ -45631,9 +45918,8 @@ var DynamicTilemapLayer = new Class({ * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates * were invalid. @@ -45649,17 +45935,14 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -45677,13 +45960,10 @@ var DynamicTilemapLayer = new Class({ * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -45698,18 +45978,15 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -45725,10 +46002,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. * - * @return {boolean} + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ hasTileAt: function (tileX, tileY) { @@ -45742,11 +46019,11 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * - * @return {boolean} + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ hasTileAtWorldXY: function (worldX, worldY, camera) { @@ -45763,9 +46040,9 @@ var DynamicTilemapLayer = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -45784,10 +46061,10 @@ var DynamicTilemapLayer = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} worldX - [description] - * @param {integer} worldY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -45806,11 +46083,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#putTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles - * or tile indexes to place. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -45831,10 +46107,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. @@ -45853,11 +46129,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -45873,12 +46148,11 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -45922,12 +46196,12 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#replaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - [description] - * @param {integer} newIndex - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -46139,10 +46413,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileLocationCallback * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} [callbackContext] - The context under which the callback is called. * @@ -46164,10 +46438,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -46188,10 +46462,10 @@ var DynamicTilemapLayer = new Class({ * * @param {integer} tileA - First tile index. * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -46209,8 +46483,8 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldX * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -46226,8 +46500,8 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldY * @since 3.0.0 * - * @param {integer} tileY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -46244,10 +46518,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Math.Vector2} */ @@ -46274,10 +46548,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#weightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. @@ -46298,10 +46572,9 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileX * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -46317,10 +46590,9 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileY * @since 3.0.0 * - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -46337,12 +46609,11 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Math.Vector2} */ @@ -46371,7 +46642,7 @@ var DegToRad = __webpack_require__(31); var DynamicTilemapLayer = __webpack_require__(209); var Extend = __webpack_require__(20); var Formats = __webpack_require__(29); -var LayerData = __webpack_require__(77); +var LayerData = __webpack_require__(78); var Rotate = __webpack_require__(243); var StaticTilemapLayer = __webpack_require__(208); var Tile = __webpack_require__(55); @@ -46381,21 +46652,21 @@ var Tileset = __webpack_require__(99); /** * @callback TilemapFilterCallback * - * @param {Phaser.GameObjects.GameObject} value - [description] - * @param {number} index - [description] - * @param {Phaser.GameObjects.GameObject[]} array - [description] + * @param {Phaser.GameObjects.GameObject} value - An object found in the filtered area. + * @param {number} index - The index of the object within the array. + * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. * - * @return {Phaser.GameObjects.GameObject} [description] + * @return {Phaser.GameObjects.GameObject} The object. */ /** * @callback TilemapFindCallback * - * @param {Phaser.GameObjects.GameObject} value - [description] - * @param {number} index - [description] - * @param {Phaser.GameObjects.GameObject[]} array - [description] + * @param {Phaser.GameObjects.GameObject} value - An object found. + * @param {number} index - The index of the object within the array. + * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. * - * @return {boolean} [description] + * @return {boolean} `true` if the callback should be invoked, otherwise `false`. */ /** @@ -46681,7 +46952,7 @@ var Tilemap = new Class({ if (!this.scene.sys.textures.exists(key)) { - console.warn('Invalid image key given for tileset: "' + key + '"'); + console.warn('Invalid Tileset Image: ' + key); return null; } @@ -46691,16 +46962,19 @@ var Tilemap = new Class({ if (index === null && this.format === Formats.TILED_JSON) { - console.warn('No data found in the JSON tilemap from Tiled matching the tileset name: "' + tilesetName + '"'); + console.warn('No data found for Tileset: ' + tilesetName); return null; } - if (this.tilesets[index]) + var tileset = this.tilesets[index]; + + if (tileset) { - this.tilesets[index].setTileSize(tileWidth, tileHeight); - this.tilesets[index].setSpacing(tileMargin, tileSpacing); - this.tilesets[index].setImage(texture); - return this.tilesets[index]; + tileset.setTileSize(tileWidth, tileHeight); + tileset.setSpacing(tileMargin, tileSpacing); + tileset.setImage(texture); + + return tileset; } if (tileWidth === undefined) { tileWidth = this.tileWidth; } @@ -46709,8 +46983,10 @@ var Tilemap = new Class({ if (tileSpacing === undefined) { tileSpacing = 0; } if (gid === undefined) { gid = 0; } - var tileset = new Tileset(tilesetName, gid, tileWidth, tileHeight, tileMargin, tileSpacing); + tileset = new Tileset(tilesetName, gid, tileWidth, tileHeight, tileMargin, tileSpacing); + tileset.setImage(texture); + this.tilesets.push(tileset); return tileset; @@ -46762,11 +47038,23 @@ var Tilemap = new Class({ }, /** - * See component documentation. If no layer specified, the map's current layer is used. This - * cannot be applied to StaticTilemapLayers. + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * + * If no layer specified, the map's current layer is used. This cannot be applied to StaticTilemapLayers. * * @method Phaser.Tilemaps.Tilemap#copy * @since 3.0.0 + * + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -46790,24 +47078,20 @@ var Tilemap = new Class({ }, /** - * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set - * to this new layer. + * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. * * @method Phaser.Tilemaps.Tilemap#createBlankDynamicLayer * @since 3.0.0 * * @param {string} name - The name of this layer. Must be unique within the map. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. - * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default - * to the map's width. - * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default - * to the map's height. - * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not - * specified, it will default to the map's tileWidth. - * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not - * specified, it will default to the map's tileHeight. + * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. + * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. + * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. + * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. + * * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. */ createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) @@ -46823,7 +47107,7 @@ var Tilemap = new Class({ if (index !== null) { - console.warn('Cannot create blank layer: layer with matching name already exists ' + name); + console.warn('Invalid Tilemap Layer ID: ' + name); return null; } @@ -46850,6 +47134,7 @@ var Tilemap = new Class({ } this.layers.push(layerData); + this.currentLayerIndex = this.layers.length - 1; var dynamicLayer = new DynamicTilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); @@ -46875,13 +47160,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createDynamicLayer * @since 3.0.0 * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the - * layer name from Tiled. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. - * @param {number} x - The x position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. - * @param {number} y - The y position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} x - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * @param {number} y - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. */ @@ -46891,7 +47173,7 @@ var Tilemap = new Class({ if (index === null) { - console.warn('Cannot create Tilemap Layer, invalid ID: ' + layerID); + console.warn('Invalid Tilemap Layer ID: ' + layerID); return null; } @@ -46900,21 +47182,13 @@ var Tilemap = new Class({ // Check for an associated static or dynamic tilemap layer if (layerData.tilemapLayer) { - console.warn('Cannot create Tilemap Layer. ID: ' + layerID + ' already in use'); + console.warn('Tilemap Layer ID already exists:' + layerID); return null; } this.currentLayerIndex = index; - // Make sure that all the LayerData & the tiles have the correct tile size. They usually - // are, but wouldn't match if you try to load a 2x or 4x res tileset when the map was made - // with a 1x res tileset. - if (layerData.tileWidth !== tileset.tileWidth || layerData.tileHeight !== tileset.tileHeight) - { - this.setLayerTileSize(tileset.tileWidth, tileset.tileHeight, index); - } - - // Default the x/y position to match Tiled layer offset, if it exists. + // Default the x/y position to match Tiled layer offset, if it exists. if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } @@ -47044,11 +47318,10 @@ var Tilemap = new Class({ * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. - * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). + * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.GameObjects.Sprite[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -47075,13 +47348,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createStaticLayer * @since 3.0.0 * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the - * layer name from Tiled. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. - * @param {number} x - The x position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. - * @param {number} y - The y position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} x - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * @param {number} y - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer was created, or null if it failed. */ @@ -47091,30 +47361,22 @@ var Tilemap = new Class({ if (index === null) { - console.warn('Cannot create tilemap layer, invalid layer ID given: ' + layerID); + console.warn('Invalid Tilemap Layer ID: ' + layerID); return null; } var layerData = this.layers[index]; - // Check for an associated static or dynamic tilemap layer + // Check for an associated static or dynamic tilemap layer if (layerData.tilemapLayer) { - console.warn('Cannot create static tilemap layer since a static or dynamic tilemap layer exists for layer ID:' + layerID); + console.warn('Tilemap Layer ID already exists:' + layerID); return null; } this.currentLayerIndex = index; - // Make sure that all the LayerData & the tiles have the correct tile size. They usually - // are, but wouldn't match if you try to load a 2x or 4x res tileset when the map was made - // with a 1x res tileset. - if (layerData.tileWidth !== tileset.tileWidth || layerData.tileHeight !== tileset.tileHeight) - { - this.setLayerTileSize(tileset.tileWidth, tileset.tileHeight, index); - } - - // Default the x/y position to match Tiled layer offset, if it exists. + // Default the x/y position to match Tiled layer offset, if it exists. if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } @@ -47153,13 +47415,13 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#fill * @since 3.0.0 * - * @param {integer} index - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} index - The tile index to fill the area with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -47222,18 +47484,15 @@ var Tilemap = new Class({ * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to apply the filter on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -47259,9 +47518,8 @@ var Tilemap = new Class({ * * @param {integer} index - The tile index value to search for. * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -47315,21 +47573,17 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#findTile * @since 3.0.0 * - * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -47351,21 +47605,17 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#forEachTile * @since 3.0.0 * - * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -47521,9 +47771,8 @@ var Tilemap = new Class({ * * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -47545,10 +47794,9 @@ var Tilemap = new Class({ * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -47573,18 +47821,15 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getTilesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -47607,14 +47852,11 @@ var Tilemap = new Class({ * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -47634,19 +47876,16 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getTilesWithinWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -47659,6 +47898,23 @@ var Tilemap = new Class({ return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, layer); }, + /** + * Gets the Tileset that has the given `name`, or null if an invalid `name` is given. + * + * @method Phaser.Tilemaps.Tilemap#getTileset + * @since 3.14.0 + * + * @param {string} name - The name of the Tileset to get. + * + * @return {?Phaser.Tilemaps.Tileset} The Tileset, or `null` if no matching named tileset was found. + */ + getTileset: function (name) + { + var index = this.getIndex(this.tilesets, name); + + return (index !== null) ? this.tilesets[index] : null; + }, + /** * Gets the index of the Tileset within this.tilesets that has the given `name`, or null if an * invalid `name` is given. @@ -47684,9 +47940,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#hasTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -47708,10 +47964,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#hasTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -47758,12 +48014,12 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * - * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. + * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid or the coordinates were out of bounds. */ putTileAt: function (tile, tileX, tileY, recalculateFaces, layer) { @@ -47789,11 +48045,11 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} worldX - [description] - * @param {integer} worldY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -47821,12 +48077,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#putTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles - * or tile indexes to place. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -47857,12 +48112,12 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -47890,9 +48145,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#calculateFacesAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -47917,11 +48172,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#calculateFacesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -47972,12 +48227,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#removeTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -48002,13 +48256,12 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -48036,13 +48289,10 @@ var Tilemap = new Class({ * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. * @param {object} styleConfig - An object specifying the colors to use for the debug drawing. - * @param {?Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at - * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. - * @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled - * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. - * @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting - * tile faces. If set to null, interesting tile faces will not be drawn. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {?Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. + * @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. + * @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48068,13 +48318,13 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#replaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - [description] - * @param {integer} newIndex - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48103,11 +48353,9 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48135,11 +48383,9 @@ var Tilemap = new Class({ * * @param {integer} start - The first index of the tile to be set for collision. * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48168,13 +48414,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setCollisionByProperty * @since 3.0.0 * - * @param {object} properties - An object with tile properties and corresponding values that should - * be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48200,11 +48443,9 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48230,11 +48471,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setCollisionFromCollisionGroup * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48260,11 +48499,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setTileIndexCallback * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a - * collision callback set for. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48289,13 +48527,13 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setTileLocationCallback * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} [callbackContext] - The context under which the callback is called. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48356,8 +48594,8 @@ var Tilemap = new Class({ // Update the base tile size on all layers & tiles for (var i = 0; i < this.layers.length; i++) { - this.layers[i].baseWidth = tileWidth; - this.layers[i].baseHeight = tileHeight; + this.layers[i].baseTileWidth = tileWidth; + this.layers[i].baseTileHeight = tileHeight; var mapData = this.layers[i].data; var mapWidth = this.layers[i].width; @@ -48434,11 +48672,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48469,11 +48707,11 @@ var Tilemap = new Class({ * * @param {integer} tileA - First tile index. * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48500,9 +48738,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#tileToWorldX * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -48524,9 +48762,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#tileToWorldY * @since 3.0.0 * - * @param {integer} tileY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -48549,11 +48787,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#tileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. */ @@ -48587,14 +48825,14 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#weightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -48621,11 +48859,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#worldToTileX * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -48647,11 +48884,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#worldToTileY * @since 3.0.0 * - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -48674,13 +48910,12 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#worldToTileXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. */ @@ -48731,7 +48966,7 @@ module.exports = Tilemap; */ var Formats = __webpack_require__(29); -var MapData = __webpack_require__(76); +var MapData = __webpack_require__(77); var ParseTileLayers = __webpack_require__(451); var ParseTilesets = __webpack_require__(450); @@ -49252,7 +49487,7 @@ module.exports = ParseGID; */ var Formats = __webpack_require__(29); -var MapData = __webpack_require__(76); +var MapData = __webpack_require__(77); var ParseTileLayers = __webpack_require__(459); var ParseImageLayers = __webpack_require__(457); var ParseTilesets = __webpack_require__(456); @@ -49279,7 +49514,7 @@ var AssignTileProperties = __webpack_require__(452); * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. * - * @return {?Phaser.Tilemaps.MapData} [description] + * @return {?Phaser.Tilemaps.MapData} The created MapData object, or `null` if the data can't be parsed. */ var ParseJSONTiled = function (name, json, insertNull) { @@ -49352,7 +49587,7 @@ var Parse2DArray = __webpack_require__(132); * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. * - * @return {Phaser.Tilemaps.MapData} [description] + * @return {Phaser.Tilemaps.MapData} The resulting MapData object. */ var ParseCSV = function (name, data, tileWidth, tileHeight, insertNull) { @@ -49409,7 +49644,7 @@ var ParseWeltmeister = __webpack_require__(211); * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. * - * @return {Phaser.Tilemaps.MapData} [description] + * @return {Phaser.Tilemaps.MapData} The created `MapData` object. */ var Parse = function (name, mapFormat, data, tileWidth, tileHeight, insertNull) { @@ -49451,7 +49686,7 @@ module.exports = Parse; */ var Tile = __webpack_require__(55); -var IsInLayerBounds = __webpack_require__(78); +var IsInLayerBounds = __webpack_require__(79); var CalculateFacesAt = __webpack_require__(135); /** @@ -49464,9 +49699,8 @@ var CalculateFacesAt = __webpack_require__(135); * * @param {integer} tileX - The x coordinate. * @param {integer} tileY - The y coordinate. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. @@ -49511,7 +49745,7 @@ module.exports = RemoveTileAt; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var IsInLayerBounds = __webpack_require__(78); +var IsInLayerBounds = __webpack_require__(79); /** * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns @@ -49521,11 +49755,11 @@ var IsInLayerBounds = __webpack_require__(78); * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] + * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {boolean} + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ var HasTileAt = function (tileX, tileY, layer) { @@ -49565,17 +49799,18 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {integer} findIndex - [description] - * @param {integer} newIndex - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ReplaceByIndex = function (findIndex, newIndex, tileX, tileY, width, height, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + for (var i = 0; i < tiles.length; i++) { if (tiles[i] && tiles[i].index === findIndex) @@ -49782,15 +50017,22 @@ module.exports = BasePlugin; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CircleContains = __webpack_require__(39); +var CircleContains = __webpack_require__(40); var Class = __webpack_require__(0); var CONST = __webpack_require__(35); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); var Vector2 = __webpack_require__(3); /** * @classdesc - * [description] + * A Static Arcade Physics Body. + * + * A Static Body never moves, and isn't automatically synchronized with its parent Game Object. + * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Body manually. + * + * A Static Body can collide with other Bodies, but is never moved by collisions. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Body}. * * @class StaticBody * @memberOf Phaser.Physics.Arcade @@ -49943,6 +50185,7 @@ var StaticBody = new Class({ * * @name Phaser.Physics.Arcade.StaticBody#velocity * @type {Phaser.Math.Vector2} + * @readOnly * @since 3.0.0 */ this.velocity = Vector2.ZERO; @@ -49952,25 +50195,28 @@ var StaticBody = new Class({ * * @name Phaser.Physics.Arcade.StaticBody#allowGravity * @type {boolean} + * @readOnly * @default false * @since 3.0.0 */ this.allowGravity = false; /** - * [description] + * Gravitational force applied specifically to this Body. Values are in pixels per second squared. Always zero for a Static Body. * * @name Phaser.Physics.Arcade.StaticBody#gravity * @type {Phaser.Math.Vector2} + * @readOnly * @since 3.0.0 */ this.gravity = Vector2.ZERO; /** - * [description] + * Rebound, or restitution, following a collision, relative to 1. Always zero for a Static Body. * * @name Phaser.Physics.Arcade.StaticBody#bounce * @type {Phaser.Math.Vector2} + * @readOnly * @since 3.0.0 */ this.bounce = Vector2.ZERO; @@ -49978,7 +50224,7 @@ var StaticBody = new Class({ // If true this Body will dispatch events /** - * [description] + * Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary (and `collideWorldBounds` is also true). * * @name Phaser.Physics.Arcade.StaticBody#onWorldBounds * @type {boolean} @@ -49988,7 +50234,7 @@ var StaticBody = new Class({ this.onWorldBounds = false; /** - * [description] + * Whether the simulation emits a `collide` event when this StaticBody collides with another. * * @name Phaser.Physics.Arcade.StaticBody#onCollide * @type {boolean} @@ -49998,7 +50244,7 @@ var StaticBody = new Class({ this.onCollide = false; /** - * [description] + * Whether the simulation emits an `overlap` event when this StaticBody overlaps with another. * * @name Phaser.Physics.Arcade.StaticBody#onOverlap * @type {boolean} @@ -50008,7 +50254,7 @@ var StaticBody = new Class({ this.onOverlap = false; /** - * [description] + * The StaticBody's inertia, relative to a default unit (1). With `bounce`, this affects the exchange of momentum (velocities) during collisions. * * @name Phaser.Physics.Arcade.StaticBody#mass * @type {number} @@ -50018,7 +50264,7 @@ var StaticBody = new Class({ this.mass = 1; /** - * [description] + * Whether this object can be moved by collisions with another body. * * @name Phaser.Physics.Arcade.StaticBody#immovable * @type {boolean} @@ -50028,7 +50274,7 @@ var StaticBody = new Class({ this.immovable = true; /** - * [description] + * A flag disabling the default horizontal separation of colliding bodies. Pass your own `processHandler` to the collider. * * @name Phaser.Physics.Arcade.StaticBody#customSeparateX * @type {boolean} @@ -50038,7 +50284,7 @@ var StaticBody = new Class({ this.customSeparateX = false; /** - * [description] + * A flag disabling the default vertical separation of colliding bodies. Pass your own `processHandler` to the collider. * * @name Phaser.Physics.Arcade.StaticBody#customSeparateY * @type {boolean} @@ -50048,7 +50294,7 @@ var StaticBody = new Class({ this.customSeparateY = false; /** - * [description] + * The amount of horizontal overlap (before separation), if this Body is colliding with another. * * @name Phaser.Physics.Arcade.StaticBody#overlapX * @type {number} @@ -50058,7 +50304,7 @@ var StaticBody = new Class({ this.overlapX = 0; /** - * [description] + * The amount of vertical overlap (before separation), if this Body is colliding with another. * * @name Phaser.Physics.Arcade.StaticBody#overlapY * @type {number} @@ -50068,7 +50314,7 @@ var StaticBody = new Class({ this.overlapY = 0; /** - * [description] + * The amount of overlap (before separation), if this StaticBody is circular and colliding with another circular body. * * @name Phaser.Physics.Arcade.StaticBody#overlapR * @type {number} @@ -50078,7 +50324,7 @@ var StaticBody = new Class({ this.overlapR = 0; /** - * [description] + * Whether this StaticBody is overlapped with another and both have zero velocity. * * @name Phaser.Physics.Arcade.StaticBody#embedded * @type {boolean} @@ -50088,7 +50334,7 @@ var StaticBody = new Class({ this.embedded = false; /** - * [description] + * Whether this StaticBody interacts with the world boundary. * * @name Phaser.Physics.Arcade.StaticBody#collideWorldBounds * @type {boolean} @@ -50098,7 +50344,7 @@ var StaticBody = new Class({ this.collideWorldBounds = false; /** - * [description] + * Whether this StaticBody is checked for collisions and for which directions. You can set `checkCollision.none = false` to disable collision checks. * * @name Phaser.Physics.Arcade.StaticBody#checkCollision * @type {ArcadeBodyCollision} @@ -50107,7 +50353,7 @@ var StaticBody = new Class({ this.checkCollision = { none: false, up: true, down: true, left: true, right: true }; /** - * [description] + * Whether this StaticBody is colliding with another and in which direction. * * @name Phaser.Physics.Arcade.StaticBody#touching * @type {ArcadeBodyCollision} @@ -50116,7 +50362,7 @@ var StaticBody = new Class({ this.touching = { none: true, up: false, down: false, left: false, right: false }; /** - * [description] + * Whether this StaticBody was colliding with another during the last step, and in which direction. * * @name Phaser.Physics.Arcade.StaticBody#wasTouching * @type {ArcadeBodyCollision} @@ -50125,7 +50371,7 @@ var StaticBody = new Class({ this.wasTouching = { none: true, up: false, down: false, left: false, right: false }; /** - * [description] + * Whether this StaticBody is colliding with a tile or the world boundary. * * @name Phaser.Physics.Arcade.StaticBody#blocked * @type {ArcadeBodyCollision} @@ -50134,7 +50380,7 @@ var StaticBody = new Class({ this.blocked = { none: true, up: false, down: false, left: false, right: false }; /** - * [description] + * The StaticBody's physics type (static by default). * * @name Phaser.Physics.Arcade.StaticBody#physicsType * @type {integer} @@ -50179,6 +50425,8 @@ var StaticBody = new Class({ * @param {boolean} [update=true] - Reposition and resize this Body to match the new Game Object? * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + * + * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject */ setGameObject: function (gameObject, update) { @@ -50232,13 +50480,13 @@ var StaticBody = new Class({ }, /** - * [description] + * Sets the offset of the body. * * @method Phaser.Physics.Arcade.StaticBody#setOffset * @since 3.4.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The horizontal offset of the Body from the Game Object's center. + * @param {number} y - The vertical offset of the Body from the Game Object's center. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. */ @@ -50315,14 +50563,14 @@ var StaticBody = new Class({ }, /** - * [description] + * Sets this Static Body to have a circular body and sets its sizes and position. * * @method Phaser.Physics.Arcade.StaticBody#setCircle * @since 3.0.0 * - * @param {number} radius - [description] - * @param {number} [offsetX] - [description] - * @param {number} [offsetY] - [description] + * @param {number} radius - The radius of the StaticBody, in pixels. + * @param {number} [offsetX] - The horizontal offset of the StaticBody from its Game Object, in pixels. + * @param {number} [offsetY] - The vertical offset of the StaticBody from its Game Object, in pixels. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. */ @@ -50360,7 +50608,7 @@ var StaticBody = new Class({ }, /** - * [description] + * Updates the StaticBody's `center` from its `position` and dimensions. * * @method Phaser.Physics.Arcade.StaticBody#updateCenter * @since 3.0.0 @@ -50371,13 +50619,14 @@ var StaticBody = new Class({ }, /** - * [description] + * Updates this Static Body's position based on the current Game Object it is bound to. + * Similar to `updateFromGameObject`, but doesn't modify the Body's dimensions. * * @method Phaser.Physics.Arcade.StaticBody#reset * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate to reset the body to. + * @param {number} y - The y coordinate to reset the body to. */ reset: function (x, y) { @@ -50396,7 +50645,7 @@ var StaticBody = new Class({ }, /** - * [description] + * NOOP function. A Static Body cannot be stopped. * * @method Phaser.Physics.Arcade.StaticBody#stop * @since 3.0.0 @@ -50409,14 +50658,14 @@ var StaticBody = new Class({ }, /** - * [description] + * Returns the x and y coordinates of the top left and bottom right points of the StaticBody. * * @method Phaser.Physics.Arcade.StaticBody#getBounds * @since 3.0.0 * - * @param {ArcadeBodyBounds} obj - [description] + * @param {ArcadeBodyBounds} obj - The object which will hold the coordinates of the bounds. * - * @return {ArcadeBodyBounds} [description] + * @return {ArcadeBodyBounds} The same object that was passed with `x`, `y`, `right` and `bottom` values matching the respective values of the StaticBody. */ getBounds: function (obj) { @@ -50429,15 +50678,15 @@ var StaticBody = new Class({ }, /** - * [description] + * Checks to see if a given x,y coordinate is colliding with this Static Body. * * @method Phaser.Physics.Arcade.StaticBody#hitTest * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate to check against this body. + * @param {number} y - The y coordinate to check against this body. * - * @return {boolean} [description] + * @return {boolean} `true` if the given coordinate lies within this body, otherwise `false`. */ hitTest: function (x, y) { @@ -50455,12 +50704,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The absolute (non-negative) change in this StaticBody's horizontal position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaAbsX * @since 3.0.0 * - * @return {number} [description] + * @return {number} Always zero for a Static Body. */ deltaAbsX: function () { @@ -50468,12 +50717,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The absolute (non-negative) change in this StaticBody's vertical position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaAbsY * @since 3.0.0 * - * @return {number} [description] + * @return {number} Always zero for a Static Body. */ deltaAbsY: function () { @@ -50481,12 +50730,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The change in this StaticBody's horizontal position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaX * @since 3.0.0 * - * @return {number} [description] + * @return {number} Always zero for a Static Body. */ deltaX: function () { @@ -50494,12 +50743,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The change in this StaticBody's vertical position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaY * @since 3.0.0 * - * @return {number} [description] + * @return {number} 0 */ deltaY: function () { @@ -50512,7 +50761,7 @@ var StaticBody = new Class({ * @method Phaser.Physics.Arcade.StaticBody#deltaZ * @since 3.0.0 * - * @return {number} [description] + * @return {number} 0 */ deltaZ: function () { @@ -50520,7 +50769,7 @@ var StaticBody = new Class({ }, /** - * [description] + * Disables this Body and marks it for destruction during the next step. * * @method Phaser.Physics.Arcade.StaticBody#destroy * @since 3.0.0 @@ -50533,12 +50782,12 @@ var StaticBody = new Class({ }, /** - * [description] + * Draws a graphical representation of the StaticBody for visual debugging purposes. * * @method Phaser.Physics.Arcade.StaticBody#drawDebug * @since 3.0.0 * - * @param {Phaser.GameObjects.Graphics} graphic - [description] + * @param {Phaser.GameObjects.Graphics} graphic - The Graphics object to use for the debug drawing of the StaticBody. */ drawDebug: function (graphic) { @@ -50552,12 +50801,12 @@ var StaticBody = new Class({ }, /** - * [description] + * Indicates whether the StaticBody is going to be showing a debug visualization during postUpdate. * * @method Phaser.Physics.Arcade.StaticBody#willDrawDebug * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} Whether or not the StaticBody is going to show the debug visualization during postUpdate. */ willDrawDebug: function () { @@ -50565,12 +50814,12 @@ var StaticBody = new Class({ }, /** - * [description] + * Sets the Mass of the StaticBody. Will set the Mass to 0.1 if the value passed is less than or equal to zero. * * @method Phaser.Physics.Arcade.StaticBody#setMass * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - The value to set the Mass to. Values of zero or less are changed to 0.1. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. */ @@ -50588,7 +50837,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The x coordinate of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#x * @type {number} @@ -50613,7 +50862,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The y coordinate of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#y * @type {number} @@ -50638,7 +50887,7 @@ var StaticBody = new Class({ }, /** - * [description] + * Returns the left-most x coordinate of the area of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#left * @type {number} @@ -50655,7 +50904,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The right-most x coordinate of the area of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#right * @type {number} @@ -50672,7 +50921,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The highest y coordinate of the area of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#top * @type {number} @@ -50689,7 +50938,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The lowest y coordinate of the area of the StaticBody. (y + height) * * @name Phaser.Physics.Arcade.StaticBody#bottom * @type {number} @@ -51975,12 +52224,12 @@ module.exports = Collider; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CircleContains = __webpack_require__(39); +var CircleContains = __webpack_require__(40); var Class = __webpack_require__(0); var CONST = __webpack_require__(35); var RadToDeg = __webpack_require__(171); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); var Vector2 = __webpack_require__(3); /** @@ -52006,6 +52255,8 @@ var Vector2 = __webpack_require__(3); * @classdesc * A Dynamic Arcade Body. * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticBody}. + * * @class Body * @memberOf Phaser.Physics.Arcade * @constructor @@ -52107,8 +52358,8 @@ var Body = new Class({ this.isCircle = false; /** - * The unscaled radius of this Body's boundary (if circular), as set by setCircle, in source pixels. - * The true radius (if circular) is equal to halfWidth. + * If this Body is circular, this is the unscaled radius of the Body's boundary, as set by setCircle(), in source pixels. + * The true radius is equal to `halfWidth`. * * @name Phaser.Physics.Arcade.Body#radius * @type {number} @@ -52147,7 +52398,7 @@ var Body = new Class({ this.prev = new Vector2(gameObject.x, gameObject.y); /** - * Whether this Body's rotation is affected by its angular acceleration and velocity. + * Whether this Body's `rotation` is affected by its angular acceleration and angular velocity. * * @name Phaser.Physics.Arcade.Body#allowRotation * @type {boolean} @@ -52157,7 +52408,7 @@ var Body = new Class({ this.allowRotation = true; /** - * This body's rotation, in degrees, based on its angular acceleration and velocity. + * This body's rotation, in degrees, based on its angular acceleration and angular velocity. * The Body's rotation controls the `angle` of its Game Object. * It doesn't rotate the Body's boundary, which is always an axis-aligned rectangle or a circle. * @@ -52177,7 +52428,8 @@ var Body = new Class({ this.preRotation = gameObject.angle; /** - * The width of the Body's boundary. If circular, this is also the Body's diameter. + * The width of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. * * @name Phaser.Physics.Arcade.Body#width * @type {number} @@ -52187,7 +52439,8 @@ var Body = new Class({ this.width = width; /** - * The height of the Body's boundary. If circular, this is also the Body's diameter. + * The height of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. * * @name Phaser.Physics.Arcade.Body#height * @type {number} @@ -52197,7 +52450,8 @@ var Body = new Class({ this.height = height; /** - * The unscaled width of the Body, in source pixels. The default is the width of the Body's Game Object's texture frame. + * The unscaled width of the Body, in source pixels, as set by setSize(). + * The default is the width of the Body's Game Object's texture frame. * * @name Phaser.Physics.Arcade.Body#sourceWidth * @type {number} @@ -52207,7 +52461,8 @@ var Body = new Class({ this.sourceWidth = width; /** - * The unscaled height of the Body, in source pixels. The default is the height of the Body's Game Object's texture frame. + * The unscaled height of the Body, in source pixels, as set by setSize(). + * The default is the height of the Body's Game Object's texture frame. * * @name Phaser.Physics.Arcade.Body#sourceHeight * @type {number} @@ -52223,7 +52478,7 @@ var Body = new Class({ } /** - * Half the Body's width. + * Half the Body's width, in pixels. * * @name Phaser.Physics.Arcade.Body#halfWidth * @type {number} @@ -52232,7 +52487,7 @@ var Body = new Class({ this.halfWidth = Math.abs(width / 2); /** - * Half the Body's height. + * Half the Body's height, in pixels. * * @name Phaser.Physics.Arcade.Body#halfHeight * @type {number} @@ -52241,7 +52496,8 @@ var Body = new Class({ this.halfHeight = Math.abs(height / 2); /** - * The center of the Body's boundary. The midpoint of its `position` (top-left corner) and its bottom-right corner. + * The center of the Body's boundary. + * The midpoint of its `position` (top-left corner) and its bottom-right corner. * * @name Phaser.Physics.Arcade.Body#center * @type {Phaser.Math.Vector2} @@ -52250,7 +52506,7 @@ var Body = new Class({ this.center = new Vector2(gameObject.x + this.halfWidth, gameObject.y + this.halfHeight); /** - * The Body's change in position, in pixels per second. + * The Body's velocity, in pixels per second. * * @name Phaser.Physics.Arcade.Body#velocity * @type {Phaser.Math.Vector2} @@ -52259,7 +52515,7 @@ var Body = new Class({ this.velocity = new Vector2(); /** - * The Body's calculated change in position, in pixels, at the last step. + * The Body's calculated velocity, in pixels per second, at the last step. * * @name Phaser.Physics.Arcade.Body#newVelocity * @type {Phaser.Math.Vector2} @@ -52287,7 +52543,7 @@ var Body = new Class({ this.acceleration = new Vector2(); /** - * Whether this Body's velocity is affected by its drag vector. + * Whether this Body's velocity is affected by its `drag`. * * @name Phaser.Physics.Arcade.Body#allowDrag * @type {boolean} @@ -52298,20 +52554,30 @@ var Body = new Class({ /** * Absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. * * @name Phaser.Physics.Arcade.Body#drag - * @type {Phaser.Math.Vector2} + * @type {(Phaser.Math.Vector2|number)} * @since 3.0.0 */ this.drag = new Vector2(); /** - * Whether this Body's position is affected by its gravity vector. + * Whether this Body's position is affected by gravity (local or world). * * @name Phaser.Physics.Arcade.Body#allowGravity * @type {boolean} * @default true * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#gravity + * @see Phaser.Physics.Arcade.World#gravity */ this.allowGravity = true; @@ -52322,6 +52588,7 @@ var Body = new Class({ * @name Phaser.Physics.Arcade.Body#gravity * @type {Phaser.Math.Vector2} * @since 3.0.0 + * @see Phaser.Physics.Arcade.World#gravity */ this.gravity = new Vector2(); @@ -52336,7 +52603,7 @@ var Body = new Class({ /** * Rebound following a collision with the world boundary, relative to 1. - * If empty, `bounce` is used instead. + * If null, `bounce` is used instead. * * @name Phaser.Physics.Arcade.Body#worldBounce * @type {?Phaser.Math.Vector2} @@ -52381,9 +52648,8 @@ var Body = new Class({ this.onOverlap = false; /** - * The Body's absolute maximum velocity. - * - * This limits the Body's rate of movement but not its `velocity` values (which can still exceed `maxVelocity`). + * The Body's absolute maximum velocity, in pixels per second. + * The horizontal and vertical components are applied separately. * * @name Phaser.Physics.Arcade.Body#maxVelocity * @type {Phaser.Math.Vector2} @@ -52392,8 +52658,10 @@ var Body = new Class({ this.maxVelocity = new Vector2(10000, 10000); /** - * If this Body is `immovable` and in motion, this the proportion of this Body's movement received by the riding body on each axis, relative to 1. - * The default value (1, 0) moves the riding body horizontally in equal proportion and vertically not at all. + * If this Body is `immovable` and in motion, `friction` is the proportion of this Body's motion received by the riding Body on each axis, relative to 1. + * The default value (1, 0) moves the riding Body horizontally in equal proportion to this Body and vertically not at all. + * The horizontal component (x) is applied only when two colliding Bodies are separated vertically. + * The vertical component (y) is applied only when two colliding Bodies are separated horizontally. * * @name Phaser.Physics.Arcade.Body#friction * @type {Phaser.Math.Vector2} @@ -52420,7 +52688,7 @@ var Body = new Class({ this.useDamping = false; /** - * The rate of change of this Body's rotation, in degrees per second. + * The rate of change of this Body's `rotation`, in degrees per second. * * @name Phaser.Physics.Arcade.Body#angularVelocity * @type {number} @@ -52430,7 +52698,7 @@ var Body = new Class({ this.angularVelocity = 0; /** - * The rate of change of this Body's angular velocity, in degrees per second squared. + * The Body's angular acceleration (change in angular velocity), in degrees per second squared. * * @name Phaser.Physics.Arcade.Body#angularAcceleration * @type {number} @@ -52442,6 +52710,8 @@ var Body = new Class({ /** * Loss of angular velocity due to angular movement, in degrees per second. * + * Angular drag is applied only when angular acceleration is zero. + * * @name Phaser.Physics.Arcade.Body#angularDrag * @type {number} * @default 0 @@ -52471,7 +52741,7 @@ var Body = new Class({ this.mass = 1; /** - * The angle of this Body's velocity vector, in degrees. + * The calculated angle of this Body's velocity vector, in degrees, during the last step. * * @name Phaser.Physics.Arcade.Body#angle * @type {number} @@ -52481,7 +52751,7 @@ var Body = new Class({ this.angle = 0; /** - * The magnitude of the Body's velocity, as calculated during the last update. + * The calculated magnitude of the Body's velocity, in pixels per second, during the last step. * * @name Phaser.Physics.Arcade.Body#speed * @type {number} @@ -52491,7 +52761,8 @@ var Body = new Class({ this.speed = 0; /** - * The calculated direction of the Body's velocity. + * The direction of the Body's velocity, as calculated during the last step. + * If the Body is moving on both axes (diagonally), this describes motion on the vertical axis only. * * @name Phaser.Physics.Arcade.Body#facing * @type {integer} @@ -52500,7 +52771,7 @@ var Body = new Class({ this.facing = CONST.FACING_NONE; /** - * Whether this object can be moved by collisions with another body. + * Whether this Body can be moved by collisions with another Body. * * @name Phaser.Physics.Arcade.Body#immovable * @type {boolean} @@ -52520,7 +52791,8 @@ var Body = new Class({ this.moves = true; /** - * A flag disabling the default horizontal separation of colliding bodies. Pass your own `processHandler` to the collider. + * A flag disabling the default horizontal separation of colliding bodies. + * Pass your own `collideCallback` to the collider. * * @name Phaser.Physics.Arcade.Body#customSeparateX * @type {boolean} @@ -52530,7 +52802,8 @@ var Body = new Class({ this.customSeparateX = false; /** - * A flag disabling the default vertical separation of colliding bodies. Pass your own `processHandler` to the collider. + * A flag disabling the default vertical separation of colliding bodies. + * Pass your own `collideCallback` to the collider. * * @name Phaser.Physics.Arcade.Body#customSeparateY * @type {boolean} @@ -52701,7 +52974,7 @@ var Body = new Class({ this._sy = gameObject.scaleY; /** - * The calculated change in the Body's horizontal position during the current step. + * The calculated change in the Body's horizontal position during the last step. * * @name Phaser.Physics.Arcade.Body#_dx * @type {number} @@ -52712,7 +52985,7 @@ var Body = new Class({ this._dx = 0; /** - * The calculated change in the Body's vertical position during the current step. + * The calculated change in the Body's vertical position during the last step. * * @name Phaser.Physics.Arcade.Body#_dy * @type {number} @@ -52756,6 +53029,8 @@ var Body = new Class({ transform.rotation = RadToDeg(matrix.rotation); transform.scaleX = matrix.scaleX; transform.scaleY = matrix.scaleY; + transform.displayOriginX = sprite.displayOriginX; + transform.displayOriginY = sprite.displayOriginY; } else { @@ -52764,6 +53039,8 @@ var Body = new Class({ transform.rotation = sprite.angle; transform.scaleX = sprite.scaleX; transform.scaleY = sprite.scaleY; + transform.displayOriginX = sprite.displayOriginX; + transform.displayOriginY = sprite.displayOriginY; } var recalc = false; @@ -52800,7 +53077,7 @@ var Body = new Class({ }, /** - * Updates the Body's `center` from its `position` and dimensions. + * Updates the Body's `center` from its `position`, `width`, and `height`. * * @method Phaser.Physics.Arcade.Body#updateCenter * @since 3.0.0 @@ -53066,7 +53343,7 @@ var Body = new Class({ { height = gameObject.frame.realHeight; } - + this.sourceWidth = width; this.sourceHeight = height; @@ -53352,6 +53629,7 @@ var Body = new Class({ drawDebug: function (graphic) { var pos = this.position; + var x = pos.x + this.halfWidth; var y = pos.y + this.halfHeight; @@ -54027,7 +54305,7 @@ var Clamp = __webpack_require__(23); var Class = __webpack_require__(0); var Collider = __webpack_require__(232); var CONST = __webpack_require__(35); -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); var EventEmitter = __webpack_require__(11); var FuzzyEqual = __webpack_require__(249); var FuzzyGreaterThan = __webpack_require__(248); @@ -54045,9 +54323,9 @@ var SeparateY = __webpack_require__(507); var Set = __webpack_require__(95); var StaticBody = __webpack_require__(226); var TileIntersectsBody = __webpack_require__(227); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * @event Phaser.Physics.Arcade.World#pause @@ -54145,7 +54423,7 @@ var Wrap = __webpack_require__(52); /** * An Arcade Physics Collider Type. - * + * * @typedef {( * Phaser.GameObjects.GameObject| * Phaser.GameObjects.Group| @@ -54276,7 +54554,7 @@ var World = new Class({ /** * The number of physics steps to be taken per second. - * + * * This property is read-only. Use the `setFPS` method to modify it at run-time. * * @name Phaser.Physics.Arcade.World#fps @@ -54335,7 +54613,7 @@ var World = new Class({ * - 0.5 = double speed * * @name Phaser.Physics.Arcade.World#timeScale - * @property {number} + * @property {number} * @default 1 * @since 3.10.0 */ @@ -54435,7 +54713,7 @@ var World = new Class({ /** * The maximum number of items per node on the RTree. - * + * * This is ignored if `useTree` is `false`. If you have a large number of bodies in * your world then you may find search performance improves by increasing this value, * to allow more items per node and less node division. @@ -54449,7 +54727,7 @@ var World = new Class({ /** * Should this Arcade Physics World use an RTree for Dynamic Physics bodies or not? - * + * * An RTree is a fast way of spatially sorting of all the moving bodies in the world. * However, at certain limits, the cost of clearing and inserting the bodies into the * tree every frame becomes more expensive than the search speed gains it provides. @@ -54525,7 +54803,7 @@ var World = new Class({ /** * Adds an Arcade Physics Body to a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `enableBody` method is that you can pass arrays or Groups * to this method. * @@ -54651,7 +54929,7 @@ var World = new Class({ * @since 3.10.0 * * @param {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body - The Body to be added to the simulation. - * + * * @return {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} The Body that was added to the simulation. */ add: function (body) @@ -54674,10 +54952,10 @@ var World = new Class({ /** * Disables the Arcade Physics Body of a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `disableBody` method is that you can pass arrays or Groups * to this method. - * + * * The body itself is not deleted, it just has its `enable` property set to false, which * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`. * @@ -55766,11 +56044,11 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#overlap * @since 3.0.0 * - * @param {ArcadeColliderType} object1 - [description] - * @param {ArcadeColliderType} [object2] - [description] - * @param {ArcadePhysicsCallback} [overlapCallback] - [description] - * @param {ArcadePhysicsCallback} [processCallback] - [description] - * @param {*} [callbackContext] - [description] + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if at least one Game Object overlaps another. */ @@ -55788,7 +56066,7 @@ var World = new Class({ * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. * * If you don't require separation then use {@link #overlap} instead. - * + * * If two Groups or arrays are passed, each member of one will be tested against each member of the other. * * If one Group **only** is passed (as `object1`), each member of the Group will be collided against the other members. @@ -55804,13 +56082,13 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#collide * @since 3.0.0 * - * @param {ArcadeColliderType} object1 - [description] - * @param {ArcadeColliderType} [object2] - [description] - * @param {ArcadePhysicsCallback} [collideCallback] - [description] - * @param {ArcadePhysicsCallback} [processCallback] - [description] - * @param {*} [callbackContext] - [description] + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {*} [callbackContext] - The context in which to run the callbacks. * - * @return {boolean} True if any overlapping Game Objects were separated. + * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -55832,9 +56110,9 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * - * @return {boolean} True if any overlapping objects were separated. + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ collideObjects: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly) { @@ -55902,9 +56180,9 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * - * @return {boolean} [description] + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ collideHandler: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly) { @@ -55980,7 +56258,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -56015,7 +56293,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -56108,7 +56386,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -56150,7 +56428,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -56252,7 +56530,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -56385,12 +56663,16 @@ module.exports = World; var ArcadeSprite = __webpack_require__(104); var Class = __webpack_require__(0); var CONST = __webpack_require__(35); -var Group = __webpack_require__(87); +var Group = __webpack_require__(88); var IsPlainObject = __webpack_require__(8); /** * @classdesc - * [description] + * An Arcade Physics Static Group object. + * + * All Game Objects created by this Group will automatically be given static Arcade Physics bodies. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Group}. * * @class StaticGroup * @extends Phaser.GameObjects.Group @@ -56398,10 +56680,10 @@ var IsPlainObject = __webpack_require__(8); * @constructor * @since 3.0.0 * - * @param {Phaser.Physics.Arcade.World} world - [description] - * @param {Phaser.Scene} scene - [description] - * @param {array} children - [description] - * @param {GroupConfig} config - [description] + * @param {Phaser.Physics.Arcade.World} world - The physics simulation. + * @param {Phaser.Scene} scene - The scene this group belongs to. + * @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. */ var StaticPhysicsGroup = new Class({ @@ -56447,7 +56729,7 @@ var StaticPhysicsGroup = new Class({ } /** - * [description] + * The physics simulation. * * @name Phaser.Physics.Arcade.StaticGroup#world * @type {Phaser.Physics.Arcade.World} @@ -56456,10 +56738,11 @@ var StaticPhysicsGroup = new Class({ this.world = world; /** - * [description] + * The scene this group belongs to. * * @name Phaser.Physics.Arcade.StaticGroup#physicsType * @type {integer} + * @default STATIC_BODY * @since 3.0.0 */ this.physicsType = CONST.STATIC_BODY; @@ -56468,12 +56751,14 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Adds a static physics body to the new group member (if it lacks one) and adds it to the simulation. * * @method Phaser.Physics.Arcade.StaticGroup#createCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The new group member. + * + * @see Phaser.Physics.Arcade.World#enableBody */ createCallbackHandler: function (child) { @@ -56484,12 +56769,14 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Disables the group member's physics body, removing it from the simulation. * * @method Phaser.Physics.Arcade.StaticGroup#removeCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The group member being removed. + * + * @see Phaser.Physics.Arcade.World#disableBody */ removeCallbackHandler: function (child) { @@ -56500,12 +56787,14 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Refreshes the group. * * @method Phaser.Physics.Arcade.StaticGroup#createMultipleCallbackHandler * @since 3.0.0 * - * @param {object} entries - [description] + * @param {Phaser.GameObjects.GameObject[]} entries - The newly created group members. + * + * @see Phaser.Physics.Arcade.StaticGroup#refresh */ createMultipleCallbackHandler: function () { @@ -56513,12 +56802,15 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Resets each Body to the position of its parent Game Object. + * Body sizes aren't changed (use {@link Phaser.Physics.Arcade.Components.Enable#refreshBody} for that). * * @method Phaser.Physics.Arcade.StaticGroup#refresh * @since 3.0.0 * - * @return {Phaser.Physics.Arcade.StaticGroup} [description] + * @return {Phaser.Physics.Arcade.StaticGroup} This group. + * + * @see Phaser.Physics.Arcade.StaticBody#reset */ refresh: function () { @@ -56551,7 +56843,7 @@ var ArcadeSprite = __webpack_require__(104); var Class = __webpack_require__(0); var CONST = __webpack_require__(35); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(87); +var Group = __webpack_require__(88); var IsPlainObject = __webpack_require__(8); /** @@ -56584,34 +56876,36 @@ var IsPlainObject = __webpack_require__(8); /** * @typedef {object} PhysicsGroupDefaults * - * @property {boolean} setCollideWorldBounds - [description] - * @property {number} setAccelerationX - [description] - * @property {number} setAccelerationY - [description] - * @property {boolean} setAllowDrag - [description] - * @property {boolean} setAllowGravity - [description] - * @property {boolean} setAllowRotation - [description] - * @property {number} setBounceX - [description] - * @property {number} setBounceY - [description] - * @property {number} setDragX - [description] - * @property {number} setDragY - [description] - * @property {number} setGravityX - [description] - * @property {number} setGravityY - [description] - * @property {number} setFrictionX - [description] - * @property {number} setFrictionY - [description] - * @property {number} setVelocityX - [description] - * @property {number} setVelocityY - [description] - * @property {number} setAngularVelocity - [description] - * @property {number} setAngularAcceleration - [description] - * @property {number} setAngularDrag - [description] - * @property {number} setMass - [description] - * @property {boolean} setImmovable - [description] + * @property {boolean} setCollideWorldBounds - As {@link Phaser.Physics.Arcade.Body#setCollideWorldBounds}. + * @property {number} setAccelerationX - As {@link Phaser.Physics.Arcade.Body#setAccelerationX}. + * @property {number} setAccelerationY - As {@link Phaser.Physics.Arcade.Body#setAccelerationY}. + * @property {boolean} setAllowDrag - As {@link Phaser.Physics.Arcade.Body#setAllowDrag}. + * @property {boolean} setAllowGravity - As {@link Phaser.Physics.Arcade.Body#setAllowGravity}. + * @property {boolean} setAllowRotation - As {@link Phaser.Physics.Arcade.Body#setAllowRotation}. + * @property {number} setBounceX - As {@link Phaser.Physics.Arcade.Body#setBounceX}. + * @property {number} setBounceY - As {@link Phaser.Physics.Arcade.Body#setBounceY}. + * @property {number} setDragX - As {@link Phaser.Physics.Arcade.Body#setDragX}. + * @property {number} setDragY - As {@link Phaser.Physics.Arcade.Body#setDragY}. + * @property {number} setGravityX - As {@link Phaser.Physics.Arcade.Body#setGravityX}. + * @property {number} setGravityY - As {@link Phaser.Physics.Arcade.Body#setGravityY}. + * @property {number} setFrictionX - As {@link Phaser.Physics.Arcade.Body#setFrictionX}. + * @property {number} setFrictionY - As {@link Phaser.Physics.Arcade.Body#setFrictionY}. + * @property {number} setVelocityX - As {@link Phaser.Physics.Arcade.Body#setVelocityX}. + * @property {number} setVelocityY - As {@link Phaser.Physics.Arcade.Body#setVelocityY}. + * @property {number} setAngularVelocity - As {@link Phaser.Physics.Arcade.Body#setAngularVelocity}. + * @property {number} setAngularAcceleration - As {@link Phaser.Physics.Arcade.Body#setAngularAcceleration}. + * @property {number} setAngularDrag - As {@link Phaser.Physics.Arcade.Body#setAngularDrag}. + * @property {number} setMass - As {@link Phaser.Physics.Arcade.Body#setMass}. + * @property {boolean} setImmovable - As {@link Phaser.Physics.Arcade.Body#setImmovable}. */ /** * @classdesc * An Arcade Physics Group object. * - * All Game Objects created by this Group will automatically be dynamic Arcade Physics objects. + * All Game Objects created by this Group will automatically be given dynamic Arcade Physics bodies. + * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}. * * @class Group * @extends Phaser.GameObjects.Group @@ -56619,10 +56913,10 @@ var IsPlainObject = __webpack_require__(8); * @constructor * @since 3.0.0 * - * @param {Phaser.Physics.Arcade.World} world - [description] - * @param {Phaser.Scene} scene - [description] - * @param {array} children - [description] - * @param {PhysicsGroupConfig} [config] - [description] + * @param {Phaser.Physics.Arcade.World} world - The physics simulation. + * @param {Phaser.Scene} scene - The scene this group belongs to. + * @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group. */ var PhysicsGroup = new Class({ @@ -56662,7 +56956,7 @@ var PhysicsGroup = new Class({ } /** - * [description] + * The physics simulation. * * @name Phaser.Physics.Arcade.Group#world * @type {Phaser.Physics.Arcade.World} @@ -56672,24 +56966,26 @@ var PhysicsGroup = new Class({ /** * The class to create new group members from. + * This should be ArcadeImage, ArcadeSprite, or a class extending one of those. * * @name Phaser.Physics.Arcade.Group#classType - * @type {Phaser.Physics.Arcade.Sprite} + * @type {(Phaser.Physics.Arcade.Image|Phaser.Physics.Arcade.Sprite)} * @default ArcadeSprite */ config.classType = GetFastValue(config, 'classType', ArcadeSprite); /** - * [description] + * The physics type of the Group's members. * * @name Phaser.Physics.Arcade.Group#physicsType * @type {integer} + * @default DYNAMIC_BODY * @since 3.0.0 */ this.physicsType = CONST.DYNAMIC_BODY; /** - * [description] + * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument. * * @name Phaser.Physics.Arcade.Group#defaults * @type {PhysicsGroupDefaults} @@ -56723,12 +57019,12 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Enables a Game Object's Body and assigns `defaults`. Called when a Group member is added or created. * * @method Phaser.Physics.Arcade.Group#createCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The Game Object being added. */ createCallbackHandler: function (child) { @@ -56746,12 +57042,12 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Disables a Game Object's Body. Called when a Group member is removed. * * @method Phaser.Physics.Arcade.Group#removeCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The Game Object being removed. */ removeCallbackHandler: function (child) { @@ -56762,14 +57058,14 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Sets the velocity of each Group member. * * @method Phaser.Physics.Arcade.Group#setVelocity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} step - [description] + * @param {number} x - The horizontal velocity. + * @param {number} y - The vertical velocity. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x, y), the second (x + step, y + step), and so on. * * @return {Phaser.Physics.Arcade.Group} This Physics Group object. */ @@ -56788,13 +57084,13 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Sets the horizontal velocity of each Group member. * * @method Phaser.Physics.Arcade.Group#setVelocityX * @since 3.0.0 * - * @param {number} value - [description] - * @param {number} step - [description] + * @param {number} value - The velocity value. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x), the second (x + step), and so on. * * @return {Phaser.Physics.Arcade.Group} This Physics Group object. */ @@ -56813,13 +57109,13 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Sets the vertical velocity of each Group member. * * @method Phaser.Physics.Arcade.Group#setVelocityY * @since 3.0.0 * - * @param {number} value - [description] - * @param {number} step - [description] + * @param {number} value - The velocity value. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (y), the second (y + step), and so on. * * @return {Phaser.Physics.Arcade.Group} This Physics Group object. */ @@ -56886,7 +57182,7 @@ module.exports = { var Class = __webpack_require__(0); var Components = __webpack_require__(237); -var Image = __webpack_require__(86); +var Image = __webpack_require__(87); /** * @classdesc @@ -57084,8 +57380,8 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#existing * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} gameObject - [description] - * @param {boolean} [isStatic=false] - Set to true to create a Static body, otherwise it will create a Dynamic body. + * @param {Phaser.GameObjects.GameObject} gameObject - A Game Object. + * @param {boolean} [isStatic=false] - Create a Static body (true) or Dynamic body (false). * * @return {Phaser.GameObjects.GameObject} The Game Object. */ @@ -57203,8 +57499,8 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#staticGroup * @since 3.0.0 * - * @param {object|object[]} [children] - [description] - * @param {GroupConfig} [config] - [description] + * @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. * * @return {Phaser.Physics.Arcade.StaticGroup} The Static Group object that was created. */ @@ -57220,8 +57516,8 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#group * @since 3.0.0 * - * @param {object|object[]} [children] - [description] - * @param {PhysicsGroupConfig} [config] - [description] + * @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group. * * @return {Phaser.Physics.Arcade.Group} The Group object that was created. */ @@ -62934,7 +63230,7 @@ Rectangle.Ceil = __webpack_require__(654); Rectangle.CeilAll = __webpack_require__(653); Rectangle.CenterOn = __webpack_require__(174); Rectangle.Clone = __webpack_require__(652); -Rectangle.Contains = __webpack_require__(38); +Rectangle.Contains = __webpack_require__(39); Rectangle.ContainsPoint = __webpack_require__(651); Rectangle.ContainsRect = __webpack_require__(265); Rectangle.CopyFrom = __webpack_require__(650); @@ -63036,7 +63332,7 @@ module.exports = GetMagnitude; */ var MATH_CONST = __webpack_require__(16); -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); var Angle = __webpack_require__(68); /** @@ -63105,15 +63401,16 @@ module.exports = Decompose; */ /** - * [description] + * Create an array of points for each corner of a Rectangle + * If an array is specified, each point object will be added to the end of the array, otherwise a new array will be created. * * @function Phaser.Geom.Rectangle.Decompose * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {array} [out] - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle object to be decomposed. + * @param {array} [out] - If provided, each point will be added to this array. * - * @return {array} [description] + * @return {array} Will return the array you specified or a new array containing the points of the Rectangle. */ var Decompose = function (rect, out) { @@ -63172,7 +63469,7 @@ module.exports = PointToLine; // Based on code by Matt DesLauriers // https://github.com/mattdesl/line-circle-collision/blob/master/LICENSE.md -var Contains = __webpack_require__(39); +var Contains = __webpack_require__(40); var Point = __webpack_require__(6); var tmp = new Point(); @@ -63932,19 +64229,19 @@ var Length = __webpack_require__(65); var Point = __webpack_require__(6); /** - * [description] + * Returns an array of evenly spaced points on the perimeter of a Triangle. * * @function Phaser.Geom.Triangle.GetPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [out,$return] * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {integer} quantity - [description] - * @param {number} stepRate - [description] - * @param {(array|Phaser.Geom.Point[])} [out] - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the points from. + * @param {integer} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param {number} stepRate - If `quantity` is 0, the distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [out] - An array to which the points should be appended. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} The modified `out` array, or a new array if none was provided. */ var GetPoints = function (triangle, quantity, stepRate, out) { @@ -64926,6 +65223,7 @@ var Smooth = __webpack_require__(283); * The Polygon Shape is created by providing a list of points, which are then used to create an * internal Polygon geometry object. The points can be set from a variety of formats: * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point or Vector2 objects: `[new Phaser.Math.Vec2(x1, y1), ...]` * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` @@ -65104,6 +65402,16 @@ var Line = new Class({ var width = this.geom.right - this.geom.left; var height = this.geom.bottom - this.geom.top; + /** + * The width (or thickness) of the line. + * See the setLineWidth method for extra details on changing this on WebGL. + * + * @name Phaser.GameObjects.Line#lineWidth + * @type {number} + * @since 3.13.0 + */ + this.lineWidth = 1; + /** * Private internal value. Holds the start width of the line. * @@ -65944,7 +66252,7 @@ module.exports = Grid; var Class = __webpack_require__(0); var Earcut = __webpack_require__(64); var EllipseRender = __webpack_require__(795); -var GeomEllipse = __webpack_require__(89); +var GeomEllipse = __webpack_require__(90); var Shape = __webpack_require__(27); /** @@ -66781,10 +67089,10 @@ module.exports = UUID; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(31); -var GetBoolean = __webpack_require__(83); +var GetBoolean = __webpack_require__(84); var GetValue = __webpack_require__(4); var Sprite = __webpack_require__(61); -var TWEEN_CONST = __webpack_require__(82); +var TWEEN_CONST = __webpack_require__(83); var Vector2 = __webpack_require__(3); /** @@ -67754,13 +68062,13 @@ var EmitterOp = __webpack_require__(821); var GetFastValue = __webpack_require__(2); var GetRandom = __webpack_require__(161); var HasAny = __webpack_require__(299); -var HasValue = __webpack_require__(84); +var HasValue = __webpack_require__(85); var Particle = __webpack_require__(304); var RandomZone = __webpack_require__(298); var Rectangle = __webpack_require__(9); var StableSort = __webpack_require__(110); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * @callback ParticleEmitterCallback @@ -69929,7 +70237,7 @@ module.exports = ParticleEmitter; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(31); -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); /** * @classdesc @@ -71006,7 +71314,7 @@ module.exports = Circumference; var Circumference = __webpack_require__(307); var CircumferencePoint = __webpack_require__(155); -var FromPercent = __webpack_require__(92); +var FromPercent = __webpack_require__(93); var MATH_CONST = __webpack_require__(16); /** @@ -71059,7 +71367,7 @@ module.exports = GetPoints; */ var CircumferencePoint = __webpack_require__(155); -var FromPercent = __webpack_require__(92); +var FromPercent = __webpack_require__(93); var MATH_CONST = __webpack_require__(16); var Point = __webpack_require__(6); @@ -71104,18 +71412,18 @@ module.exports = GetPoint; var Rectangle = __webpack_require__(9); /** - * [description] + * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. * * @function Phaser.Geom.Rectangle.Union * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rectA - [description] - * @param {Phaser.Geom.Rectangle} rectB - [description] - * @param {Phaser.Geom.Rectangle} [out] - [description] + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. + * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. */ var Union = function (rectA, rectB, out) { @@ -71737,7 +72045,7 @@ module.exports = { var CanvasPool = __webpack_require__(24); var Class = __webpack_require__(0); var IsSizePowerOfTwo = __webpack_require__(117); -var ScaleModes = __webpack_require__(93); +var ScaleModes = __webpack_require__(94); /** * @classdesc @@ -71965,6 +72273,17 @@ var TextureSource = new Class({ if (this.renderer.gl && this.isCanvas) { this.glTexture = this.renderer.canvasToTexture(this.image, this.glTexture); + + // Update all the Frames using this TextureSource + + var index = this.texture.getTextureSourceIndex(this); + + var frames = this.texture.getFramesFromTextureSource(index, true); + + for (var i = 0; i < frames.length; i++) + { + frames[i].glTexture = this.glTexture; + } } }, @@ -78180,7 +78499,7 @@ module.exports = SceneManager; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var SpliceOne = __webpack_require__(90); +var SpliceOne = __webpack_require__(91); /** * Removes the given item, or array of items, from the array. @@ -79456,7 +79775,7 @@ module.exports = SmoothStepInterpolation; */ var Class = __webpack_require__(0); -var Distance = __webpack_require__(51); +var Distance = __webpack_require__(52); var SmoothStepInterpolation = __webpack_require__(335); var Vector2 = __webpack_require__(3); @@ -80420,6 +80739,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native event from the browser. */ + + /* pointerLockChange: function (event) { var element = this.target; @@ -80428,6 +80749,7 @@ var MouseManager = new Class({ this.manager.queue.push(event); }, + */ /** * If the browser supports pointer lock, this will request that the pointer lock is released. If @@ -80454,6 +80776,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native DOM Mouse Move Event. */ + + /* onMouseMove: function (event) { if (event.defaultPrevented || !this.enabled || !this.manager) @@ -80469,6 +80793,7 @@ var MouseManager = new Class({ event.preventDefault(); } }, + */ /** * The Mouse Down Event Handler. @@ -80478,6 +80803,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native DOM Mouse Down Event. */ + + /* onMouseDown: function (event) { if (event.defaultPrevented || !this.enabled) @@ -80493,6 +80820,7 @@ var MouseManager = new Class({ event.preventDefault(); } }, + */ /** * The Mouse Up Event Handler. @@ -80502,6 +80830,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native DOM Mouse Up Event. */ + + /* onMouseUp: function (event) { if (event.defaultPrevented || !this.enabled) @@ -80517,6 +80847,7 @@ var MouseManager = new Class({ event.preventDefault(); } }, + */ /** * Starts the Mouse Event listeners running. @@ -80527,31 +80858,84 @@ var MouseManager = new Class({ */ startListeners: function () { - var target = this.target; + var _this = this; + var onMouseMove = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.manager.queueMouseMove(event); + + if (_this.capture) + { + event.preventDefault(); + } + }; + + var onMouseDown = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.manager.queueMouseDown(event); + + if (_this.capture) + { + event.preventDefault(); + } + }; + + var onMouseUp = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.manager.queueMouseUp(event); + + if (_this.capture) + { + event.preventDefault(); + } + }; + + this.onMouseMove = onMouseMove; + this.onMouseDown = onMouseDown; + this.onMouseUp = onMouseUp; + + var target = this.target; var passive = { passive: true }; var nonPassive = { passive: false }; - if (this.capture) - { - target.addEventListener('mousemove', this.onMouseMove.bind(this), nonPassive); - target.addEventListener('mousedown', this.onMouseDown.bind(this), nonPassive); - target.addEventListener('mouseup', this.onMouseUp.bind(this), nonPassive); - } - else - { - target.addEventListener('mousemove', this.onMouseMove.bind(this), passive); - target.addEventListener('mousedown', this.onMouseDown.bind(this), passive); - target.addEventListener('mouseup', this.onMouseUp.bind(this), passive); - } + target.addEventListener('mousemove', onMouseMove, (this.capture) ? nonPassive : passive); + target.addEventListener('mousedown', onMouseDown, (this.capture) ? nonPassive : passive); + target.addEventListener('mouseup', onMouseUp, (this.capture) ? nonPassive : passive); if (Features.pointerLock) { - this.pointerLockChange = this.pointerLockChange.bind(this); + var onPointerLockChange = function (event) + { + var element = _this.target; - document.addEventListener('pointerlockchange', this.pointerLockChange, true); - document.addEventListener('mozpointerlockchange', this.pointerLockChange, true); - document.addEventListener('webkitpointerlockchange', this.pointerLockChange, true); + _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false; + + _this.manager.queue.push(event); + }; + + this.pointerLockChange = onPointerLockChange; + + document.addEventListener('pointerlockchange', onPointerLockChange, true); + document.addEventListener('mozpointerlockchange', onPointerLockChange, true); + document.addEventListener('webkitpointerlockchange', onPointerLockChange, true); } }, @@ -80694,7 +81078,7 @@ var Mouse = __webpack_require__(337); var Pointer = __webpack_require__(336); var Rectangle = __webpack_require__(9); var Touch = __webpack_require__(334); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var TransformXY = __webpack_require__(333); /** @@ -82224,7 +82608,7 @@ module.exports = init(); module.exports = { - os: __webpack_require__(91), + os: __webpack_require__(92), browser: __webpack_require__(118), features: __webpack_require__(167), input: __webpack_require__(901), @@ -82529,7 +82913,7 @@ module.exports = ParseXML; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var OS = __webpack_require__(91); +var OS = __webpack_require__(92); /** * @callback ContentLoadedCallback @@ -83204,10 +83588,10 @@ var QuadraticBezier = new Class({ * * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * - * @param {Phaser.GameObjects.Graphics} graphics - [description] - * @param {integer} [pointsTotal=32] - [description] + * @param {Phaser.GameObjects.Graphics} graphics - `Graphics` object to draw onto. + * @param {integer} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. * - * @return {Phaser.GameObjects.Graphics} [description] + * @return {Phaser.GameObjects.Graphics} `Graphics` object that was drawn to. */ draw: function (graphics, pointsTotal) { @@ -83230,7 +83614,7 @@ var QuadraticBezier = new Class({ }, /** - * [description] + * Converts the curve into a JSON compatible object. * * @method Phaser.Curves.QuadraticBezier#toJSON * @since 3.2.0 @@ -83252,14 +83636,14 @@ var QuadraticBezier = new Class({ }); /** - * [description] + * Creates a curve from a JSON object, e. g. created by `toJSON`. * * @function Phaser.Curves.QuadraticBezier.fromJSON * @since 3.2.0 * * @param {JSONCurve} data - The JSON object containing this curve data. * - * @return {Phaser.Curves.QuadraticBezier} [description] + * @return {Phaser.Curves.QuadraticBezier} The created curve instance. */ QuadraticBezier.fromJSON = function (data) { @@ -83555,32 +83939,34 @@ var Vector2 = __webpack_require__(3); * @typedef {object} JSONEllipseCurve * * @property {string} type - The of the curve. - * @property {number} x - [description] - * @property {number} y - [description] + * @property {number} x - The x coordinate of the ellipse. + * @property {number} y - The y coordinate of the ellipse. * @property {number} xRadius - The horizontal radius of ellipse. * @property {number} yRadius - The vertical radius of ellipse. - * @property {integer} startAngle - The start angle of ellipse. - * @property {integer} endAngle - The end angle of ellipse. - * @property {boolean} clockwise - The clockwise of ellipse. - * @property {integer} rotation - The rotation of ellipse. + * @property {integer} startAngle - The start angle of the ellipse, in degrees. + * @property {integer} endAngle - The end angle of the ellipse, in degrees. + * @property {boolean} clockwise - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @property {integer} rotation - The rotation of ellipse, in degrees. */ /** * @typedef {object} EllipseCurveConfig * - * @property {number} [x=0] - [description] - * @property {number} [y=0] - [description] - * @property {number} [xRadius=0] - [description] - * @property {number} [yRadius=0] - [description] - * @property {integer} [startAngle=0] - [description] - * @property {integer} [endAngle=360] - [description] - * @property {boolean} [clockwise=false] - [description] - * @property {integer} [rotation=0] - [description] + * @property {number} [x=0] - The x coordinate of the ellipse. + * @property {number} [y=0] - The y coordinate of the ellipse. + * @property {number} [xRadius=0] - The horizontal radius of the ellipse. + * @property {number} [yRadius=0] - The vertical radius of the ellipse. + * @property {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @property {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @property {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @property {integer} [rotation=0] - The rotation of the ellipse, in degrees. */ /** * @classdesc - * [description] + * An Elliptical Curve derived from the Base Curve class. + * + * See https://en.wikipedia.org/wiki/Elliptic_curve for more details. * * @class Ellipse * @extends Phaser.Curves.Curve @@ -83588,14 +83974,14 @@ var Vector2 = __webpack_require__(3); * @constructor * @since 3.0.0 * - * @param {(number|EllipseCurveConfig)} [x=0] - [description] - * @param {number} [y=0] - [description] - * @param {number} [xRadius=0] - [description] - * @param {number} [yRadius=0] - [description] - * @param {integer} [startAngle=0] - [description] - * @param {integer} [endAngle=360] - [description] - * @param {boolean} [clockwise=false] - [description] - * @param {integer} [rotation=0] - [description] + * @param {(number|EllipseCurveConfig)} [x=0] - The x coordinate of the ellipse, or an Ellipse Curve configuration object. + * @param {number} [y=0] - The y coordinate of the ellipse. + * @param {number} [xRadius=0] - The horizontal radius of ellipse. + * @param {number} [yRadius=0] - The vertical radius of ellipse. + * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. */ var EllipseCurve = new Class({ @@ -83632,7 +84018,7 @@ var EllipseCurve = new Class({ // Center point /** - * [description] + * The center point of the ellipse. Used for calculating rotation. * * @name Phaser.Curves.Ellipse#p0 * @type {Phaser.Math.Vector2} @@ -83641,7 +84027,7 @@ var EllipseCurve = new Class({ this.p0 = new Vector2(x, y); /** - * [description] + * The horizontal radius of the ellipse. * * @name Phaser.Curves.Ellipse#_xRadius * @type {number} @@ -83651,7 +84037,7 @@ var EllipseCurve = new Class({ this._xRadius = xRadius; /** - * [description] + * The vertical radius of the ellipse. * * @name Phaser.Curves.Ellipse#_yRadius * @type {number} @@ -83663,7 +84049,7 @@ var EllipseCurve = new Class({ // Radians /** - * [description] + * The starting angle of the ellipse in radians. * * @name Phaser.Curves.Ellipse#_startAngle * @type {number} @@ -83673,7 +84059,7 @@ var EllipseCurve = new Class({ this._startAngle = DegToRad(startAngle); /** - * [description] + * The end angle of the ellipse in radians. * * @name Phaser.Curves.Ellipse#_endAngle * @type {number} @@ -83950,7 +84336,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The x coordinate of the center of the ellipse. * * @name Phaser.Curves.Ellipse#x * @type {number} @@ -83971,7 +84357,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The y coordinate of the center of the ellipse. * * @name Phaser.Curves.Ellipse#y * @type {number} @@ -83992,7 +84378,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The horizontal radius of the ellipse. * * @name Phaser.Curves.Ellipse#xRadius * @type {number} @@ -84013,7 +84399,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The vertical radius of the ellipse. * * @name Phaser.Curves.Ellipse#yRadius * @type {number} @@ -84034,7 +84420,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The start angle of the ellipse in degrees. * * @name Phaser.Curves.Ellipse#startAngle * @type {number} @@ -84055,7 +84441,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The end angle of the ellipse in degrees. * * @name Phaser.Curves.Ellipse#endAngle * @type {number} @@ -84076,7 +84462,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * `true` if the ellipse rotation is clockwise or `false` if anti-clockwise. * * @name Phaser.Curves.Ellipse#clockwise * @type {boolean} @@ -84097,7 +84483,28 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The rotation of the ellipse, relative to the center, in degrees. + * + * @name Phaser.Curves.Ellipse#angle + * @type {number} + * @since 3.14.0 + */ + angle: { + + get: function () + { + return RadToDeg(this._rotation); + }, + + set: function (value) + { + this._rotation = DegToRad(value); + } + + }, + + /** + * The rotation of the ellipse, relative to the center, in radians. * * @name Phaser.Curves.Ellipse#rotation * @type {number} @@ -84112,13 +84519,13 @@ var EllipseCurve = new Class({ set: function (value) { - this._rotation = DegToRad(value); + this._rotation = value; } }, /** - * [description] + * JSON serialization of the curve. * * @method Phaser.Curves.Ellipse#toJSON * @since 3.0.0 @@ -84143,14 +84550,14 @@ var EllipseCurve = new Class({ }); /** - * [description] + * Creates a curve from the provided Ellipse Curve Configuration object. * * @function Phaser.Curves.Ellipse.fromJSON * @since 3.0.0 * * @param {JSONEllipseCurve} data - The JSON object containing this curve data. * - * @return {Phaser.Curves.Ellipse} [description] + * @return {Phaser.Curves.Ellipse} The ellipse curve constructed from the configuration object. */ EllipseCurve.fromJSON = function (data) { @@ -84242,7 +84649,7 @@ var Vector2 = __webpack_require__(3); /** * @classdesc - * [description] + * A higher-order Bézier curve constructed of four points. * * @class CubicBezier * @extends Phaser.Curves.Curve @@ -84274,7 +84681,7 @@ var CubicBezierCurve = new Class({ } /** - * [description] + * The start point of this curve. * * @name Phaser.Curves.CubicBezier#p0 * @type {Phaser.Math.Vector2} @@ -84283,7 +84690,7 @@ var CubicBezierCurve = new Class({ this.p0 = p0; /** - * [description] + * The first control point of this curve. * * @name Phaser.Curves.CubicBezier#p1 * @type {Phaser.Math.Vector2} @@ -84292,7 +84699,7 @@ var CubicBezierCurve = new Class({ this.p1 = p1; /** - * [description] + * The second control point of this curve. * * @name Phaser.Curves.CubicBezier#p2 * @type {Phaser.Math.Vector2} @@ -84301,7 +84708,7 @@ var CubicBezierCurve = new Class({ this.p2 = p2; /** - * [description] + * The end point of this curve. * * @name Phaser.Curves.CubicBezier#p3 * @type {Phaser.Math.Vector2} @@ -84330,7 +84737,7 @@ var CubicBezierCurve = new Class({ }, /** - * [description] + * Returns the resolution of this curve. * * @method Phaser.Curves.CubicBezier#getResolution * @since 3.0.0 @@ -84370,17 +84777,17 @@ var CubicBezierCurve = new Class({ }, /** - * [description] + * Draws this curve to the specified graphics object. * * @method Phaser.Curves.CubicBezier#draw * @since 3.0.0 * * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * - * @param {Phaser.GameObjects.Graphics} graphics - [description] - * @param {integer} [pointsTotal=32] - [description] + * @param {Phaser.GameObjects.Graphics} graphics - The graphics object this curve should be drawn to. + * @param {integer} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. * - * @return {Phaser.GameObjects.Graphics} [description] + * @return {Phaser.GameObjects.Graphics} The graphics object this curve was drawn to. Useful for method chaining. */ draw: function (graphics, pointsTotal) { @@ -84403,7 +84810,7 @@ var CubicBezierCurve = new Class({ }, /** - * [description] + * Returns a JSON object that describes this curve. * * @method Phaser.Curves.CubicBezier#toJSON * @since 3.0.0 @@ -84426,14 +84833,14 @@ var CubicBezierCurve = new Class({ }); /** - * [description] + * Generates a curve from a JSON object. * * @function Phaser.Curves.CubicBezier.fromJSON * @since 3.0.0 * * @param {JSONCurve} data - The JSON object containing this curve data. * - * @return {Phaser.Curves.CubicBezier} [description] + * @return {Phaser.Curves.CubicBezier} The curve generated from the JSON object. */ CubicBezierCurve.fromJSON = function (data) { @@ -84515,8 +84922,8 @@ var GetValue = __webpack_require__(4); * @property {array} [data=[]] - [description] * @property {HTMLCanvasElement} [canvas=null] - [description] * @property {Palette} [palette=Arne16] - [description] - * @property {number} [pixelWidth=1] - [description] - * @property {number} [pixelHeight=1] - [description] + * @property {number} [pixelWidth=1] - The width of each 'pixel' in the generated texture. + * @property {number} [pixelHeight=1] - The height of each 'pixel' in the generated texture. * @property {boolean} [resizeCanvas=true] - [description] * @property {boolean} [clearCanvas=true] - [description] * @property {GenerateTextureRendererCallback} [preRender] - [description] @@ -86644,7 +87051,7 @@ var Pad = __webpack_require__(179); * @constructor * @since 3.0.0 * - * @param {Phaser.Game} game - [description] + * @param {Phaser.Game} game - A reference to the Phaser.Game instance. */ var AnimationManager = new Class({ @@ -86657,7 +87064,7 @@ var AnimationManager = new Class({ EventEmitter.call(this); /** - * [description] + * A reference to the Phaser.Game instance. * * @name Phaser.Animations.AnimationManager#game * @type {Phaser.Game} @@ -86667,7 +87074,7 @@ var AnimationManager = new Class({ this.game = game; /** - * [description] + * A reference to the Texture Manager. * * @name Phaser.Animations.AnimationManager#textureManager * @type {Phaser.Textures.TextureManager} @@ -86797,7 +87204,7 @@ var AnimationManager = new Class({ * @since 3.0.0 * * @param {(string|JSONAnimationManager|JSONAnimation)} data - [description] - * @param {boolean} [clearCurrentAnimations=false] - [description] + * @param {boolean} [clearCurrentAnimations=false] - If set to `true`, the current animations will be removed (`anims.clear()`). If set to `false` (default), the animations in `data` will be added. * * @return {Phaser.Animations.Animation[]} An array containing all of the Animation objects that were created as a result of this call. */ @@ -86852,15 +87259,17 @@ var AnimationManager = new Class({ */ /** - * [description] + * Generate an array of {@link AnimationFrameConfig} objects from a texture key and configuration object. + * + * Generates objects with string frame names, as configured by the given {@link AnimationFrameConfig}. * * @method Phaser.Animations.AnimationManager#generateFrameNames * @since 3.0.0 * - * @param {string} key - [description] - * @param {GenerateFrameNamesConfig} [config] - [description] + * @param {string} key - The key for the texture containing the animation frames. + * @param {GenerateFrameNamesConfig} [config] - The configuration object for the animation frame names. * - * @return {AnimationFrameConfig[]} [description] + * @return {AnimationFrameConfig[]} The array of {@link AnimationFrameConfig} objects. */ generateFrameNames: function (key, config) { @@ -86937,7 +87346,9 @@ var AnimationManager = new Class({ */ /** - * Generates an array of {@link AnimationFrameConfig} objects from a texture key and configuration object. + * Generate an array of {@link AnimationFrameConfig} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link GenerateFrameNumbersConfig}. * * @method Phaser.Animations.AnimationManager#generateFrameNumbers * @since 3.0.0 @@ -87001,14 +87412,14 @@ var AnimationManager = new Class({ }, /** - * [description] + * Get an Animation. * * @method Phaser.Animations.AnimationManager#get * @since 3.0.0 * - * @param {string} key - [description] + * @param {string} key - The key of the Animation to retrieve. * - * @return {Phaser.Animations.Animation} [description] + * @return {Phaser.Animations.Animation} The Animation. */ get: function (key) { @@ -87016,14 +87427,14 @@ var AnimationManager = new Class({ }, /** - * Load an Animation into a Game Objects Animation Component. + * Load an Animation into a Game Object's Animation Component. * * @method Phaser.Animations.AnimationManager#load * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] - * @param {string} key - [description] - * @param {(string|integer)} [startFrame] - [description] + * @param {Phaser.GameObjects.GameObject} child - The Game Object to load the animation into. + * @param {string} key - The key of the animation to load. + * @param {(string|integer)} [startFrame] - The name of a start frame to set on the loaded animation. * * @return {Phaser.GameObjects.GameObject} [description] */ @@ -87040,7 +87451,7 @@ var AnimationManager = new Class({ }, /** - * [description] + * Pause all animations. * * @method Phaser.Animations.AnimationManager#pauseAll * @fires PauseAllAnimationEvent @@ -87061,13 +87472,13 @@ var AnimationManager = new Class({ }, /** - * [description] + * Play an animation on the given Game Objects that have an Animation Component. * * @method Phaser.Animations.AnimationManager#play * @since 3.0.0 * - * @param {string} key - [description] - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {string} key - The key of the animation to play on the Game Object. + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Objects to play the animation on. * * @return {Phaser.Animations.AnimationManager} This Animation Manager. */ @@ -87094,13 +87505,13 @@ var AnimationManager = new Class({ }, /** - * [description] + * Remove an animation. * * @method Phaser.Animations.AnimationManager#remove * @fires RemoveAnimationEvent * @since 3.0.0 * - * @param {string} key - [description] + * @param {string} key - The key of the animation to remove. * * @return {Phaser.Animations.Animation} [description] */ @@ -87119,7 +87530,7 @@ var AnimationManager = new Class({ }, /** - * [description] + * Resume all paused animations. * * @method Phaser.Animations.AnimationManager#resumeAll * @fires ResumeAllAnimationEvent @@ -87140,17 +87551,17 @@ var AnimationManager = new Class({ }, /** - * Takes an array of Game Objects that have the Animation Component and then + * Takes an array of Game Objects that have an Animation Component and then * starts the given animation playing on them, each one offset by the * `stagger` amount given to this method. * * @method Phaser.Animations.AnimationManager#staggerPlay * @since 3.0.0 - * + * * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {string} key - The key of the animation to play on the Game Objects. - * @param {Phaser.GameObjects.GameObject[]} children - An array of Game Objects to play the animation on. They must have the Animation Component. + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} children - An array of Game Objects to play the animation on. They must have an Animation Component. * @param {number} [stagger=0] - The amount of time, in milliseconds, to offset each play time by. * * @return {Phaser.Animations.AnimationManager} This Animation Manager. @@ -88298,7 +88709,7 @@ var Animation = new Class({ component.pendingRepeat = false; - component.parent.emit('animationrepeat', this, component.currentFrame, component.repeatCounter); + component.parent.emit('animationrepeat', this, component.currentFrame, component.repeatCounter, component.parent); } } }, @@ -88834,7 +89245,7 @@ module.exports = Visible; */ var MATH_CONST = __webpack_require__(16); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var WrapAngle = __webpack_require__(200); var WrapAngleDegrees = __webpack_require__(199); @@ -89499,15 +89910,19 @@ var Class = __webpack_require__(0); /** * @classdesc - * [description] + * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect a visible pixel from the geometry mask. The mask is essentially a clipping path which can only make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * + * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and alpha of the pixel from the Geometry Mask do not matter. + * + * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. Moving or transforming the underlying Graphics object will change the mask (and affect the visibility of any masked objects), whereas moving or transforming a masked object will not affect the mask. You can think of the Geometry Mask (or rather, of the its Graphics object) as an invisible curtain placed in front of all masked objects which has its own visual properties and, naturally, respects the camera's visual properties, but isn't affected by and doesn't follow the masked objects by itself. * * @class GeometryMask * @memberOf Phaser.Display.Masks * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description] + * @param {Phaser.Scene} scene - This parameter is not used. + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. */ var GeometryMask = new Class({ @@ -89516,7 +89931,7 @@ var GeometryMask = new Class({ function GeometryMask (scene, graphicsGeometry) { /** - * [description] + * The Graphics object which describes the Geometry Mask. * * @name Phaser.Display.Masks.GeometryMask#geometryMask * @type {Phaser.GameObjects.Graphics} @@ -89526,12 +89941,12 @@ var GeometryMask = new Class({ }, /** - * [description] + * Sets a new Graphics object for the Geometry Mask. * * @method Phaser.Display.Masks.GeometryMask#setShape * @since 3.0.0 * - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description] + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. */ setShape: function (graphicsGeometry) { @@ -89539,14 +89954,14 @@ var GeometryMask = new Class({ }, /** - * [description] + * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. * * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] - * @param {Phaser.GameObjects.GameObject} mask - [description] - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. */ preRenderWebGL: function (renderer, mask, camera) { @@ -89574,12 +89989,12 @@ var GeometryMask = new Class({ }, /** - * [description] + * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. * * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. */ postRenderWebGL: function (renderer) { @@ -89587,18 +90002,19 @@ var GeometryMask = new Class({ // Force flush before disabling stencil test renderer.flush(); + gl.disable(gl.STENCIL_TEST); }, /** - * [description] + * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. * * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description] - * @param {Phaser.GameObjects.GameObject} mask - [description] - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. */ preRenderCanvas: function (renderer, mask, camera) { @@ -89612,12 +90028,12 @@ var GeometryMask = new Class({ }, /** - * [description] + * Restore the canvas context's previous clipping path, thus turning off the mask for it. * * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description] + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. */ postRenderCanvas: function (renderer) { @@ -90129,19 +90545,19 @@ var Perimeter = __webpack_require__(123); // each spaced out based on the quantity or step required /** - * [description] + * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. * * @function Phaser.Geom.Rectangle.GetPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rectangle - [description] + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. * @param {number} step - [description] * @param {integer} quantity - [description] - * @param {(array|Phaser.Geom.Point[])} [out] - [description] + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. */ var GetPoints = function (rectangle, quantity, stepRate, out) { @@ -90714,7 +91130,7 @@ module.exports = Circumference; var Circumference = __webpack_require__(403); var CircumferencePoint = __webpack_require__(192); -var FromPercent = __webpack_require__(92); +var FromPercent = __webpack_require__(93); var MATH_CONST = __webpack_require__(16); /** @@ -91264,7 +91680,7 @@ module.exports = RandomDataGenerator; */ var CircumferencePoint = __webpack_require__(192); -var FromPercent = __webpack_require__(92); +var FromPercent = __webpack_require__(93); var MATH_CONST = __webpack_require__(16); var Point = __webpack_require__(6); @@ -91306,10 +91722,10 @@ module.exports = GetPoint; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetRight = __webpack_require__(43); -var GetTop = __webpack_require__(41); -var SetRight = __webpack_require__(42); -var SetTop = __webpack_require__(40); +var GetRight = __webpack_require__(44); +var GetTop = __webpack_require__(42); +var SetRight = __webpack_require__(43); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned in the top right of the other. @@ -91350,10 +91766,10 @@ module.exports = TopRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetLeft = __webpack_require__(45); -var GetTop = __webpack_require__(41); -var SetLeft = __webpack_require__(44); -var SetTop = __webpack_require__(40); +var GetLeft = __webpack_require__(46); +var GetTop = __webpack_require__(42); +var SetLeft = __webpack_require__(45); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned in the top left of the other. @@ -91395,9 +91811,9 @@ module.exports = TopLeft; */ var GetCenterX = __webpack_require__(75); -var GetTop = __webpack_require__(41); +var GetTop = __webpack_require__(42); var SetCenterX = __webpack_require__(74); -var SetTop = __webpack_require__(40); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned in the top center of the other. @@ -91439,9 +91855,9 @@ module.exports = TopCenter; */ var GetCenterY = __webpack_require__(72); -var GetRight = __webpack_require__(43); +var GetRight = __webpack_require__(44); var SetCenterY = __webpack_require__(73); -var SetRight = __webpack_require__(42); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned in the right center of the other. @@ -91483,9 +91899,9 @@ module.exports = RightCenter; */ var GetCenterY = __webpack_require__(72); -var GetLeft = __webpack_require__(45); +var GetLeft = __webpack_require__(46); var SetCenterY = __webpack_require__(73); -var SetLeft = __webpack_require__(44); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned in the left center of the other. @@ -91605,10 +92021,10 @@ module.exports = Center; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetRight = __webpack_require__(43); -var SetBottom = __webpack_require__(46); -var SetRight = __webpack_require__(42); +var GetBottom = __webpack_require__(48); +var GetRight = __webpack_require__(44); +var SetBottom = __webpack_require__(47); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned in the bottom right of the other. @@ -91649,10 +92065,10 @@ module.exports = BottomRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetLeft = __webpack_require__(45); -var SetBottom = __webpack_require__(46); -var SetLeft = __webpack_require__(44); +var GetBottom = __webpack_require__(48); +var GetLeft = __webpack_require__(46); +var SetBottom = __webpack_require__(47); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned in the bottom left of the other. @@ -91693,9 +92109,9 @@ module.exports = BottomLeft; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); +var GetBottom = __webpack_require__(48); var GetCenterX = __webpack_require__(75); -var SetBottom = __webpack_require__(46); +var SetBottom = __webpack_require__(47); var SetCenterX = __webpack_require__(74); /** @@ -91958,7 +92374,7 @@ var BitmapMaskPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#onBind * @since 3.0.0 * - * @return {Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline} [description] + * @return {this} This WebGLPipeline instance. */ onBind: function () { @@ -91988,7 +92404,7 @@ var BitmapMaskPipeline = new Class({ * @param {number} height - [description] * @param {number} resolution - [description] * - * @return {Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline} [description] + * @return {this} This WebGLPipeline instance. */ resize: function (width, height, resolution) { @@ -92089,16 +92505,16 @@ module.exports = BitmapMaskPipeline; */ /** - * [description] + * Takes a snapshot of the current frame displayed by a WebGL canvas. * * @function Phaser.Renderer.Snapshot.WebGL * @since 3.0.0 * - * @param {HTMLCanvasElement} sourceCanvas - [description] - * @param {string} [type='image/png'] - [description] - * @param {number} [encoderOptions=0.92] - [description] + * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of. + * @param {string} [type='image/png'] - The format of the returned image. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1, for image formats which use lossy compression (such as `image/jpeg`). * - * @return {HTMLImageElement} [description] + * @return {HTMLImageElement} A new image which contains a snapshot of the canvas's contents. */ var WebGLSnapshot = function (sourceCanvas, type, encoderOptions) { @@ -92162,8 +92578,8 @@ var BaseCamera = __webpack_require__(120); var Class = __webpack_require__(0); var CONST = __webpack_require__(26); var IsSizePowerOfTwo = __webpack_require__(117); -var SpliceOne = __webpack_require__(90); -var TransformMatrix = __webpack_require__(53); +var SpliceOne = __webpack_require__(91); +var TransformMatrix = __webpack_require__(38); var Utils = __webpack_require__(10); var WebGLSnapshot = __webpack_require__(422); @@ -92175,15 +92591,15 @@ var TextureTintPipeline = __webpack_require__(196); /** * @callback WebGLContextCallback * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer which owns the context. */ /** * @typedef {object} SnapshotState * - * @property {SnapshotCallback} callback - [description] - * @property {string} type - [description] - * @property {number} encoder - [description] + * @property {SnapshotCallback} callback - The function to call after the snapshot is taken. + * @property {string} type - The type of the image to create. + * @property {number} encoder - The image quality, between 0 and 1, for image formats which use lossy compression (such as `image/jpeg`). */ /** @@ -92201,7 +92617,7 @@ var TextureTintPipeline = __webpack_require__(196); * @constructor * @since 3.0.0 * - * @param {Phaser.Game} game - [description] + * @param {Phaser.Game} game - The Game instance which owns this WebGL Renderer. */ var WebGLRenderer = new Class({ @@ -92226,7 +92642,7 @@ var WebGLRenderer = new Class({ }; /** - * [description] + * The local configuration settings of this WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#config * @type {RendererConfig} @@ -92246,7 +92662,7 @@ var WebGLRenderer = new Class({ }; /** - * [description] + * The Game instance which owns this WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#game * @type {Phaser.Game} @@ -92255,7 +92671,7 @@ var WebGLRenderer = new Class({ this.game = game; /** - * [description] + * A constant which allows the renderer to be easily identified as a WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#type * @type {integer} @@ -92264,7 +92680,7 @@ var WebGLRenderer = new Class({ this.type = CONST.WEBGL; /** - * [description] + * The width of a rendered frame. * * @name Phaser.Renderer.WebGL.WebGLRenderer#width * @type {number} @@ -92273,7 +92689,7 @@ var WebGLRenderer = new Class({ this.width = game.config.width; /** - * [description] + * The height of a rendered frame. * * @name Phaser.Renderer.WebGL.WebGLRenderer#height * @type {number} @@ -92282,7 +92698,7 @@ var WebGLRenderer = new Class({ this.height = game.config.height; /** - * [description] + * The canvas which this WebGL Renderer draws to. * * @name Phaser.Renderer.WebGL.WebGLRenderer#canvas * @type {HTMLCanvasElement} @@ -92291,7 +92707,7 @@ var WebGLRenderer = new Class({ this.canvas = game.canvas; /** - * [description] + * An array of functions to invoke if the WebGL context is lost. * * @name Phaser.Renderer.WebGL.WebGLRenderer#lostContextCallbacks * @type {WebGLContextCallback[]} @@ -92300,7 +92716,7 @@ var WebGLRenderer = new Class({ this.lostContextCallbacks = []; /** - * [description] + * An array of functions to invoke if the WebGL context is restored. * * @name Phaser.Renderer.WebGL.WebGLRenderer#restoredContextCallbacks * @type {WebGLContextCallback[]} @@ -92309,7 +92725,9 @@ var WebGLRenderer = new Class({ this.restoredContextCallbacks = []; /** - * [description] + * An array of blend modes supported by the WebGL Renderer. + * + * This array includes the default blend modes as well as any custom blend modes added through {@link #addBlendMode}. * * @name Phaser.Renderer.WebGL.WebGLRenderer#blendModes * @type {array} @@ -92329,7 +92747,7 @@ var WebGLRenderer = new Class({ this.nativeTextures = []; /** - * [description] + * Set to `true` if the WebGL context of the renderer is lost. * * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLost * @type {boolean} @@ -92349,7 +92767,9 @@ var WebGLRenderer = new Class({ this.pipelines = null; /** - * [description] + * Details about the currently scheduled snapshot. + * + * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. * * @name Phaser.Renderer.WebGL.WebGLRenderer#snapshotState * @type {SnapshotState} @@ -92497,7 +92917,7 @@ var WebGLRenderer = new Class({ // These are initialized post context creation /** - * [description] + * The underlying WebGL context of the renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#gl * @type {WebGLRenderingContext} @@ -92622,9 +93042,9 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#init * @since 3.0.0 * - * @param {object} config - [description] + * @param {object} config - The configuration object for the renderer. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ init: function (config) { @@ -92744,15 +93164,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Resizes the internal canvas and drawing buffer. * * @method Phaser.Renderer.WebGL.WebGLRenderer#resize * @since 3.0.0 * - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} width - The width of the renderer. + * @param {number} height - The height of the renderer. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ resize: function (width, height) { @@ -92784,19 +93204,21 @@ var WebGLRenderer = new Class({ this.defaultCamera.setSize(width, height); + gl.scissor(0, (this.drawingBufferHeight - this.height), this.width, this.height); + return this; }, /** - * [description] + * Adds a callback to be invoked when the WebGL context has been restored by the browser. * * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextRestored * @since 3.0.0 * - * @param {WebGLContextCallback} callback - [description] - * @param {object} target - [description] + * @param {WebGLContextCallback} callback - The callback to be invoked on context restoration. + * @param {object} target - The context of the callback. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ onContextRestored: function (callback, target) { @@ -92806,15 +93228,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Adds a callback to be invoked when the WebGL context has been lost by the browser. * * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextLost * @since 3.0.0 * - * @param {WebGLContextCallback} callback - [description] - * @param {object} target - [description] + * @param {WebGLContextCallback} callback - The callback to be invoked on context loss. + * @param {object} target - The context of the callback. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ onContextLost: function (callback, target) { @@ -92831,7 +93253,7 @@ var WebGLRenderer = new Class({ * * @param {string} extensionName - Name of the WebGL extension * - * @return {boolean} [description] + * @return {boolean} `true` if the extension is supported, otherwise `false`. */ hasExtension: function (extensionName) { @@ -92844,7 +93266,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#getExtension * @since 3.0.0 * - * @param {string} extensionName - [description] + * @param {string} extensionName - The name of the extension to load. * * @return {object} WebGL extension if the extension is supported */ @@ -92874,17 +93296,15 @@ var WebGLRenderer = new Class({ } }, - /* Renderer State Manipulation Functions */ - /** * Checks if a pipeline is present in the current WebGLRenderer * * @method Phaser.Renderer.WebGL.WebGLRenderer#hasPipeline * @since 3.0.0 * - * @param {string} pipelineName - Name of the pipeline + * @param {string} pipelineName - The name of the pipeline. * - * @return {boolean} [description] + * @return {boolean} `true` if the given pipeline is loaded, otherwise `false`. */ hasPipeline: function (pipelineName) { @@ -92897,9 +93317,9 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#getPipeline * @since 3.0.0 * - * @param {string} pipelineName - [description] + * @param {string} pipelineName - The name of the pipeline. * - * @return {Phaser.Renderer.WebGL.WebGLPipeline} [description] + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance, or `null` if not found. */ getPipeline: function (pipelineName) { @@ -92907,14 +93327,14 @@ var WebGLRenderer = new Class({ }, /** - * Removes a pipeline by name + * Removes a pipeline by name. * * @method Phaser.Renderer.WebGL.WebGLRenderer#removePipeline * @since 3.0.0 * - * @param {string} pipelineName - [description] + * @param {string} pipelineName - The name of the pipeline to be removed. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ removePipeline: function (pipelineName) { @@ -92929,10 +93349,10 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#addPipeline * @since 3.0.0 * - * @param {string} pipelineName - [description] - * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - Pipeline instance must extend WebGLPipeline + * @param {string} pipelineName - A unique string-based key for the pipeline. + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - A pipeline instance which must extend WebGLPipeline. * - * @return {Phaser.Renderer.WebGL.WebGLPipeline} The instance that was passed. + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipline instance that was passed. */ addPipeline: function (pipelineName, pipelineInstance) { @@ -92942,7 +93362,7 @@ var WebGLRenderer = new Class({ } else { - console.warn('Pipeline', pipelineName, ' already exists.'); + console.warn('Pipeline exists: ' + pipelineName); } pipelineInstance.name = pipelineName; @@ -92958,22 +93378,22 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#pushScissor * @since 3.0.0 * - * @param {integer} x - [description] - * @param {integer} y - [description] - * @param {integer} w - [description] - * @param {integer} h - [description] + * @param {integer} x - The x position of the scissor. + * @param {integer} y - The y position of the scissor. + * @param {integer} width - The width of the scissor. + * @param {integer} height - The height of the scissor. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {integer[]} An array containing the scissor values. */ - pushScissor: function (x, y, w, h) + pushScissor: function (x, y, width, height) { var scissorStack = this.scissorStack; - var scissor = [ x, y, w, h ]; + var scissor = [ x, y, width, height ]; scissorStack.push(scissor); - this.setScissor(x, y, w, h); + this.setScissor(x, y, width, height); this.currentScissor = scissor; @@ -92981,12 +93401,17 @@ var WebGLRenderer = new Class({ }, /** - * Sets the current scissor state + * Sets the current scissor state. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setScissor * @since 3.0.0 + * + * @param {integer} x - The x position of the scissor. + * @param {integer} y - The y position of the scissor. + * @param {integer} width - The width of the scissor. + * @param {integer} height - The height of the scissor. */ - setScissor: function (x, y, w, h) + setScissor: function (x, y, width, height) { var gl = this.gl; @@ -92997,15 +93422,16 @@ var WebGLRenderer = new Class({ var cw = current[2]; var ch = current[3]; - if (cx !== x || cy !== y || cw !== w || ch !== h) + if (cx !== x || cy !== y || cw !== width || ch !== height) { this.flush(); // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/scissor - if (w > 0 && h > 0) + if (width > 0 && height > 0) { - gl.scissor(x, (this.drawingBufferHeight - y - h), w, h); + gl.scissor(x, (this.drawingBufferHeight - y - height), width, height); + } } }, @@ -93104,15 +93530,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Creates a new custom blend mode for the renderer. * * @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode * @since 3.0.0 * - * @param {function} func - [description] - * @param {function} equation - [description] + * @param {function} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. + * @param {function} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. * - * @return {integer} [description] + * @return {integer} The index of the new blend mode, used for referencing it in the future. */ addBlendMode: function (func, equation) { @@ -93122,16 +93548,16 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Updates the function bound to a given custom blend mode. * * @method Phaser.Renderer.WebGL.WebGLRenderer#updateBlendMode * @since 3.0.0 * - * @param {integer} index - [description] - * @param {function} func - [description] - * @param {function} equation - [description] + * @param {integer} index - The index of the custom blend mode. + * @param {function} func - The function to use for the blend mode. + * @param {function} equation - The equation to use for the blend mode. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ updateBlendMode: function (index, func, equation) { @@ -93149,14 +93575,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Removes a custom blend mode from the renderer. + * Any Game Objects still using this blend mode will error, so be sure to clear them first. * * @method Phaser.Renderer.WebGL.WebGLRenderer#removeBlendMode * @since 3.0.0 * - * @param {integer} index - [description] + * @param {integer} index - The index of the custom blend mode to be removed. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ removeBlendMode: function (index) { @@ -93177,8 +93604,6 @@ var WebGLRenderer = new Class({ * @since 3.12.0 * * @param {boolean} [force=false] - Force a blank texture set, regardless of what's already bound? - * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. */ setBlankTexture: function (force) { @@ -93197,10 +93622,10 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setTexture2D * @since 3.0.0 * - * @param {WebGLTexture} texture - The WebGL texture that needs to be bound - * @param {integer} textureUnit - The texture unit to which the texture will be bound + * @param {WebGLTexture} texture - The WebGL texture that needs to be bound. + * @param {integer} textureUnit - The texture unit to which the texture will be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setTexture2D: function (texture, textureUnit) { @@ -93226,15 +93651,14 @@ var WebGLRenderer = new Class({ }, /** - * Binds a framebuffer. If there was another framebuffer already bound - * it will force a pipeline flush. + * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setFramebuffer * @since 3.0.0 * * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setFramebuffer: function (framebuffer) { @@ -93266,15 +93690,14 @@ var WebGLRenderer = new Class({ }, /** - * Binds a program. If there was another program already bound - * it will force a pipeline flush + * Binds a program. If there was another program already bound it will force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setProgram * @since 3.0.0 * - * @param {WebGLProgram} program - The program that needs to be bound + * @param {WebGLProgram} program - The program that needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setProgram: function (program) { @@ -93293,15 +93716,14 @@ var WebGLRenderer = new Class({ }, /** - * Bounds a vertex buffer. If there is a vertex buffer already bound - * it'll force a pipeline flush. + * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setVertexBuffer * @since 3.0.0 * - * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound + * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setVertexBuffer: function (vertexBuffer) { @@ -93320,15 +93742,14 @@ var WebGLRenderer = new Class({ }, /** - * Bounds a index buffer. If there is a index buffer already bound - * it'll force a pipeline flush. + * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setIndexBuffer * @since 3.0.0 * - * @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound + * @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setIndexBuffer: function (indexBuffer) { @@ -93346,21 +93767,18 @@ var WebGLRenderer = new Class({ return this; }, - /* Renderer Resource Creation Functions */ - /** - * Creates a texture from an image source. If the source is not valid - * it creates an empty texture + * Creates a texture from an image source. If the source is not valid it creates an empty texture. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createTextureFromSource * @since 3.0.0 * - * @param {object} source - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] - * @param {integer} scaleMode - [description] + * @param {object} source - The source of the texture. + * @param {integer} width - The width of the texture. + * @param {integer} height - The height of the texture. + * @param {integer} scaleMode - The scale mode to be used by the texture. * - * @return {WebGLTexture} [description] + * @return {?WebGLTexture} The WebGL Texture that was created, or `null` if it couldn't be created. */ createTextureFromSource: function (source, width, height, scaleMode) { @@ -93395,24 +93813,23 @@ var WebGLRenderer = new Class({ }, /** - * A wrapper for creating a WebGLTexture. If not pixel data is passed - * it will create an empty texture. + * A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createTexture2D * @since 3.0.0 * - * @param {integer} mipLevel - Mip level of the texture - * @param {integer} minFilter - Filtering of the texture - * @param {integer} magFilter - Filtering of the texture - * @param {integer} wrapT - Wrapping mode of the texture - * @param {integer} wrapS - Wrapping mode of the texture - * @param {integer} format - Which format does the texture use - * @param {object} pixels - pixel data - * @param {integer} width - Width of the texture in pixels - * @param {integer} height - Height of the texture in pixels + * @param {integer} mipLevel - Mip level of the texture. + * @param {integer} minFilter - Filtering of the texture. + * @param {integer} magFilter - Filtering of the texture. + * @param {integer} wrapT - Wrapping mode of the texture. + * @param {integer} wrapS - Wrapping mode of the texture. + * @param {integer} format - Which format does the texture use. + * @param {object} pixels - pixel data. + * @param {integer} width - Width of the texture in pixels. + * @param {integer} height - Height of the texture in pixels. * @param {boolean} pma - Does the texture have premultiplied alpha? * - * @return {WebGLTexture} Raw WebGLTexture + * @return {WebGLTexture} The WebGLTexture that was created. */ createTexture2D: function (mipLevel, minFilter, magFilter, wrapT, wrapS, format, pixels, width, height, pma) { @@ -93582,8 +93999,8 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#createIndexBuffer * @since 3.0.0 * - * @param {ArrayBuffer} initialDataOrSize - It's either ArrayBuffer or an integer indicating the size of the vbo - * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW + * @param {ArrayBuffer} initialDataOrSize - Either ArrayBuffer or an integer indicating the size of the vbo. + * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. * * @return {WebGLBuffer} Raw index buffer */ @@ -93602,14 +94019,14 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Removes the given texture from the nativeTextures array and then deletes it from the GPU. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteTexture * @since 3.0.0 * - * @param {WebGLTexture} texture - [description] + * @param {WebGLTexture} texture - The WebGL Texture to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteTexture: function (texture) { @@ -93626,14 +94043,14 @@ var WebGLRenderer = new Class({ }, /** - * Wrapper for deleting a raw WebGLFramebuffer + * Deletes a WebGLFramebuffer from the GL instance. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteFramebuffer * @since 3.0.0 * - * @param {WebGLFramebuffer} framebuffer - [description] + * @param {WebGLFramebuffer} framebuffer - The Framebuffer to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteFramebuffer: function (framebuffer) { @@ -93643,14 +94060,14 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Deletes a WebGLProgram from the GL instance. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteProgram * @since 3.0.0 * - * @param {WebGLProgram} program - [description] + * @param {WebGLProgram} program - The shader program to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteProgram: function (program) { @@ -93660,14 +94077,14 @@ var WebGLRenderer = new Class({ }, /** - * Wrapper for deleting a vertex or index buffer + * Deletes a WebGLBuffer from the GL instance. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteBuffer * @since 3.0.0 * - * @param {WebGLBuffer} vertexBuffer - [description] + * @param {WebGLBuffer} vertexBuffer - The WebGLBuffer to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteBuffer: function (buffer) { @@ -93676,16 +94093,14 @@ var WebGLRenderer = new Class({ return this; }, - /* Rendering Functions */ - /** - * Handles any clipping needed by the camera and renders the background - * color if a color is visible. + * Controls the pre-render operations for the given camera. + * Handles any clipping needed by the camera and renders the background color if a color is visible. * * @method Phaser.Renderer.WebGL.WebGLRenderer#preRenderCamera * @since 3.0.0 * - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to pre-render. */ preRenderCamera: function (camera) { @@ -93725,30 +94140,29 @@ var WebGLRenderer = new Class({ camera.emit('prerender', camera); } - else if (color.alphaGL > 0) - { - this.pushScissor(cx, cy, cw, ch); - - TextureTintPipeline.drawFillRect( - cx, cy, cw , ch, - Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), - color.alphaGL - ); - } else { this.pushScissor(cx, cy, cw, ch); + + if (color.alphaGL > 0) + { + TextureTintPipeline.drawFillRect( + cx, cy, cw , ch, + Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), + color.alphaGL + ); + } } }, /** - * Renders the foreground camera effects like flash and fading. - * It resets the current scissor state. + * Controls the post-render operations for the given camera. + * Renders the foreground camera effects like flash and fading. It resets the current scissor state. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera * @since 3.0.0 * - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to post-render. */ postRenderCamera: function (camera) { @@ -93844,15 +94258,16 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * The core render step for a Scene. + * Iterates through the given Game Object's array and renders them with the given Camera. * * @method Phaser.Renderer.WebGL.WebGLRenderer#render * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] - * @param {Phaser.GameObjects.GameObject} children - [description] - * @param {number} interpolationPercentage - [description] - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Scene} scene - The Scene to render. + * @param {Phaser.GameObjects.GameObject} children - The Game Object's within the Scene to be rendered. + * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently un-used. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. */ render: function (scene, children, interpolationPercentage, camera) { @@ -93907,7 +94322,7 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * The post-render step happens after all Cameras in all Scenes have been rendered. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRender * @since 3.0.0 @@ -93935,16 +94350,16 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Schedules a snapshot to be taken after the current frame is rendered. * * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshot * @since 3.0.0 * - * @param {SnapshotCallback} callback - [description] - * @param {string} type - [description] - * @param {number} encoderOptions - [description] + * @param {SnapshotCallback} callback - Function to invoke after the snapshot is created. + * @param {string} type - The format of the image to create, usually `image/png`. + * @param {number} encoderOptions - The image quality, between 0 and 1, to use for image formats with lossy compression (such as `image/jpeg`). * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. */ snapshot: function (callback, type, encoderOptions) { @@ -93970,11 +94385,6 @@ var WebGLRenderer = new Class({ { var gl = this.gl; - if (dstTexture) - { - this.deleteTexture(dstTexture); - } - var wrapping = gl.CLAMP_TO_EDGE; if (IsSizePowerOfTwo(srcCanvas.width, srcCanvas.height)) @@ -93982,17 +94392,24 @@ var WebGLRenderer = new Class({ wrapping = gl.REPEAT; } - return this.createTexture2D(0, gl.NEAREST, gl.NEAREST, wrapping, wrapping, gl.RGBA, srcCanvas, srcCanvas.width, srcCanvas.height, true); + var newTexture = this.createTexture2D(0, gl.NEAREST, gl.NEAREST, wrapping, wrapping, gl.RGBA, srcCanvas, srcCanvas.width, srcCanvas.height, true); + + if (newTexture && dstTexture) + { + this.deleteTexture(dstTexture); + } + + return newTexture; }, /** - * [description] + * Sets the minification and magnification filter for a texture. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureFilter * @since 3.0.0 * - * @param {integer} texture - [description] - * @param {integer} filter - [description] + * @param {integer} texture - The texture to set the filter for. + * @param {integer} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. * * @return {this} This WebGL Renderer instance. */ @@ -94511,9 +94928,9 @@ var CanvasSnapshot = __webpack_require__(425); var Class = __webpack_require__(0); var CONST = __webpack_require__(26); var GetBlendModes = __webpack_require__(424); -var ScaleModes = __webpack_require__(93); +var ScaleModes = __webpack_require__(94); var Smoothing = __webpack_require__(175); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); /** * @classdesc @@ -95051,8 +95468,8 @@ var CanvasRenderer = new Class({ var frameX = cd.x; var frameY = cd.y; - var frameWidth = frame.width; - var frameHeight = frame.height; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; var res = frame.source.resolution; var x = -sprite.displayOriginX + frame.x; @@ -95177,36 +95594,59 @@ var Class = __webpack_require__(0); /** * This event is dispatched when an animation starts playing. + * + * Listen for it on the Game Object: `sprite.on('animationstart', listener)` * * @event Phaser.GameObjects.Components.Animation#onStartEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. + */ + +/** + * This event is dispatched when an animation restarts. + * + * Listen for it on the Game Object: `sprite.on('animationrestart', listener)` + * + * @event Phaser.GameObjects.Components.Animation#onRestartEvent + * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. + * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** * This event is dispatched when an animation repeats. + * + * Listen for it on the Game Object: `sprite.on('animationrepeat', listener)` * * @event Phaser.GameObjects.Components.Animation#onRepeatEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. * @param {integer} repeatCount - The number of times this animation has repeated. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** * This event is dispatched when an animation updates. This happens when the animation frame changes, * based on the animation frame rate and other factors like timeScale and delay. + * + * Listen for it on the Game Object: `sprite.on('animationupdate', listener)` * * @event Phaser.GameObjects.Components.Animation#onUpdateEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** * This event is dispatched when an animation completes playing, either naturally or via Animation.stop. + * + * Listen for it on the Game Object: `sprite.on('animationcomplete', listener)` * * @event Phaser.GameObjects.Components.Animation#onCompleteEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** @@ -95744,7 +96184,7 @@ var Animation = new Class({ gameObject.visible = true; } - gameObject.emit('animationstart', this.currentAnim, this.currentFrame); + gameObject.emit('animationstart', this.currentAnim, this.currentFrame, gameObject); return gameObject; }, @@ -95909,6 +96349,7 @@ var Animation = new Class({ * Restarts the current animation from its beginning, optionally including its delay value. * * @method Phaser.GameObjects.Components.Animation#restart + * @fires Phaser.GameObjects.Components.Animation#onRestartEvent * @since 3.0.0 * * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting. @@ -95929,6 +96370,10 @@ var Animation = new Class({ // Set frame this.updateFrame(this.currentAnim.frames[0]); + var gameObject = this.parent; + + gameObject.emit('animationrestart', this.currentAnim, this.currentFrame, gameObject); + return this.parent; }, @@ -95949,7 +96394,7 @@ var Animation = new Class({ var gameObject = this.parent; - gameObject.emit('animationcomplete', this.currentAnim, this.currentFrame); + gameObject.emit('animationcomplete', this.currentAnim, this.currentFrame, gameObject); return gameObject; }, @@ -96109,6 +96554,11 @@ var Animation = new Class({ gameObject.texture = animationFrame.frame.texture; gameObject.frame = animationFrame.frame; + if (gameObject.isCropped) + { + gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY); + } + gameObject.setSizeToFrame(); if (animationFrame.frame.customPivot) @@ -96146,7 +96596,7 @@ var Animation = new Class({ var anim = this.currentAnim; - gameObject.emit('animationupdate', anim, animationFrame); + gameObject.emit('animationupdate', anim, animationFrame, gameObject); if (this._pendingStop === 3 && this._pendingStopValue === animationFrame) { @@ -96396,18 +96846,18 @@ var GetValue = __webpack_require__(4); var Clamp = __webpack_require__(23); /** - * [description] + * Retrieves and clamps a numerical value from an object. * * @function Phaser.Utils.Objects.GetMinMaxValue * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} defaultValue - [description] + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`). + * @param {number} min - The minimum value which can be returned. + * @param {number} max - The maximum value which can be returned. + * @param {number} defaultValue - The value to return if the property doesn't exist. It's also constrained to the given bounds. * - * @return {number} [description] + * @return {number} The clamped value from the `source` object. */ var GetMinMaxValue = function (source, key, min, max, defaultValue) { @@ -96445,7 +96895,7 @@ module.exports = { GetValue: __webpack_require__(4), HasAll: __webpack_require__(432), HasAny: __webpack_require__(299), - HasValue: __webpack_require__(84), + HasValue: __webpack_require__(85), IsPlainObject: __webpack_require__(8), Merge: __webpack_require__(96), MergeRight: __webpack_require__(431) @@ -96490,7 +96940,7 @@ var Class = __webpack_require__(0); var NumberTweenBuilder = __webpack_require__(204); var PluginCache = __webpack_require__(15); var TimelineBuilder = __webpack_require__(203); -var TWEEN_CONST = __webpack_require__(82); +var TWEEN_CONST = __webpack_require__(83); var TweenBuilder = __webpack_require__(97); /** @@ -97257,8 +97707,8 @@ module.exports = [ module.exports = { - GetBoolean: __webpack_require__(83), - GetEaseFunction: __webpack_require__(85), + GetBoolean: __webpack_require__(84), + GetEaseFunction: __webpack_require__(86), GetNewValue: __webpack_require__(98), GetProps: __webpack_require__(206), GetTargets: __webpack_require__(130), @@ -97281,7 +97731,7 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CONST = __webpack_require__(82); +var CONST = __webpack_require__(83); var Extend = __webpack_require__(20); /** @@ -97914,31 +98364,61 @@ var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPer camMatrix.multiply(layerMatrix, calcMatrix); } - var tileset = src.tileset; var ctx = renderer.currentContext; - var image = tileset.image.getSourceImage(); + var gidMap = src.gidMap; ctx.save(); calcMatrix.copyToContext(ctx); + var alpha = camera.alpha * src.alpha; + ctx.globalAlpha = camera.alpha * src.alpha; for (var i = 0; i < tileCount; i++) { var tile = renderTiles[i]; + var tileset = gidMap[tile.index]; + + if (!tileset) + { + continue; + } + + var image = tileset.image.getSourceImage(); var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); if (tileTexCoords) { + var halfWidth = tile.width / 2; + var halfHeight = tile.height / 2; + + ctx.save(); + + ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); + + if (tile.rotation !== 0) + { + ctx.rotate(tile.rotation); + } + + if (tile.flipX || tile.flipY) + { + ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); + } + + ctx.globalAlpha = alpha * tile.alpha; + ctx.drawImage( image, tileTexCoords.x, tileTexCoords.y, tile.width, tile.height, - tile.pixelX, tile.pixelY, + -halfWidth, -halfHeight, tile.width, tile.height ); + + ctx.restore(); } } @@ -97977,33 +98457,44 @@ module.exports = StaticTilemapLayerCanvasRenderer; */ var StaticTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera) { - src.upload(camera); + var tilesets = src.tileset; - if (src.vertexCount > 0) + var pipeline = src.pipeline; + var pipelineVertexBuffer = pipeline.vertexBuffer; + + renderer.setPipeline(pipeline); + + pipeline.modelIdentity(); + pipeline.modelTranslate(src.x - (camera.scrollX * src.scrollFactorX), src.y - (camera.scrollY * src.scrollFactorY), 0); + pipeline.modelScale(src.scaleX, src.scaleY, 1); + pipeline.viewLoad2D(camera.matrix.matrix); + + for (var i = 0; i < tilesets.length; i++) { - var gl = renderer.gl; - var pipeline = this.pipeline; - var pipelineVertexBuffer = pipeline.vertexBuffer; - var texture = src.tileset.glTexture; - - if (renderer.currentPipeline && renderer.currentPipeline.vertexCount > 0) + src.upload(camera, i); + + if (src.vertexCount[i] > 0) { - renderer.flush(); + if (renderer.currentPipeline && renderer.currentPipeline.vertexCount > 0) + { + renderer.flush(); + } + + pipeline.vertexBuffer = src.vertexBuffer[i]; + + renderer.setPipeline(pipeline); + + renderer.setTexture2D(tilesets[i].glTexture, 0); + + renderer.gl.drawArrays(pipeline.topology, 0, src.vertexCount[i]); } - - pipeline.vertexBuffer = src.vertexBuffer; - - renderer.setPipeline(pipeline); - - renderer.setTexture2D(texture, 0); - - gl.drawArrays(pipeline.topology, 0, src.vertexCount); - - pipeline.vertexBuffer = pipelineVertexBuffer; - - pipeline.viewIdentity(); - pipeline.modelIdentity(); } + + // Restore the pipeline + pipeline.vertexBuffer = pipelineVertexBuffer; + + pipeline.viewIdentity(); + pipeline.modelIdentity(); }; module.exports = StaticTilemapLayerWebGLRenderer; @@ -98106,9 +98597,8 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe camMatrix.multiply(layerMatrix, calcMatrix); } - var tileset = src.tileset; var ctx = renderer.currentContext; - var image = tileset.image.getSourceImage(); + var gidMap = src.gidMap; ctx.save(); @@ -98120,6 +98610,14 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe { var tile = renderTiles[i]; + var tileset = gidMap[tile.index]; + + if (!tileset) + { + continue; + } + + var image = tileset.image.getSourceImage(); var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); if (tileTexCoords) @@ -98200,13 +98698,11 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer return; } - var pipeline = this.pipeline; + var gidMap = src.gidMap; + var pipeline = src.pipeline; var getTint = Utils.getTintAppendFloatAlpha; - var tileset = src.tileset; - var texture = tileset.glTexture; - var scrollFactorX = src.scrollFactorX; var scrollFactorY = src.scrollFactorY; @@ -98216,45 +98712,64 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer var sx = src.scaleX; var sy = src.scaleY; - for (var i = 0; i < tileCount; i++) + var tilesets = src.tileset; + + // Loop through each tileset in this layer, drawing just the tiles that are in that set each time + // Doing it this way around allows us to batch tiles using the same tileset + for (var c = 0; c < tilesets.length; c++) { - var tile = renderTiles[i]; + var currentSet = tilesets[c]; + var texture = currentSet.glTexture; - var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); - - if (tileTexCoords === null) + for (var i = 0; i < tileCount; i++) { - continue; + var tile = renderTiles[i]; + + var tileset = gidMap[tile.index]; + + if (tileset !== currentSet) + { + // Skip tiles that aren't in this set + continue; + } + + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + + if (tileTexCoords === null) + { + continue; + } + + var frameWidth = tile.width; + var frameHeight = tile.height; + + var frameX = tileTexCoords.x; + var frameY = tileTexCoords.y; + + var tw = tile.width * 0.5; + var th = tile.height * 0.5; + + var tint = getTint(tile.tint, alpha * tile.alpha); + + pipeline.batchTexture( + src, + texture, + texture.width, texture.height, + (tw + x + tile.pixelX) * sx, (th + y + tile.pixelY) * sy, + tile.width, tile.height, + sx, sy, + tile.rotation, + tile.flipX, tile.flipY, + scrollFactorX, scrollFactorY, + tw, th, + frameX, frameY, frameWidth, frameHeight, + tint, tint, tint, tint, false, + 0, 0, + camera, + null, + true + ); } - - var frameWidth = tile.width; - var frameHeight = tile.height; - - var frameX = tileTexCoords.x; - var frameY = tileTexCoords.y; - - var tw = tile.width * 0.5; - var th = tile.height * 0.5; - - var tint = getTint(tile.tint, alpha * tile.alpha); - - pipeline.batchTexture( - src, - texture, - texture.width, texture.height, - tw + x + tile.pixelX * sx, th + y + tile.pixelY * sy, - tile.width * sx, tile.height * sy, - 1, 1, - tile.rotation, - tile.flipX, tile.flipY, - scrollFactorX, scrollFactorY, - tw, th, - frameX, frameY, frameWidth, frameHeight, - tint, tint, tint, tint, false, - 0, 0, - camera, - null - ); } }; @@ -98353,7 +98868,7 @@ module.exports = ParseTilesets; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var LayerData = __webpack_require__(77); +var LayerData = __webpack_require__(78); var Tile = __webpack_require__(55); /** @@ -98642,7 +99157,7 @@ module.exports = ParseObjectLayers; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var HasValue = __webpack_require__(84); +var HasValue = __webpack_require__(85); /** * [description] @@ -98719,27 +99234,78 @@ var ParseTilesets = function (json) { var newSet = new Tileset(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing); - // Properties stored per-tile in object with string indexes starting at "0" - if (set.tileproperties) + if (json.version > 1) { - newSet.tileProperties = set.tileproperties; - } + // Tiled 1.2+ - // Object & terrain shapes stored per-tile in object with string indexes starting at "0" - if (set.tiles) - { - newSet.tileData = set.tiles; - - // Parse the objects into Phaser format to match handling of other Tiled objects - for (stringID in newSet.tileData) + if (Array.isArray(set.tiles)) { - var objectGroup = newSet.tileData[stringID].objectgroup; - if (objectGroup && objectGroup.objects) + var tiles = {}; + var props = {}; + + for (var t = 0; t < set.tiles.length; t++) { - var parsedObjects = objectGroup.objects.map( - function (obj) { return ParseObject(obj); } - ); - newSet.tileData[stringID].objectgroup.objects = parsedObjects; + var tile = set.tiles[t]; + + // Convert tileproperties + if (tile.properties) + { + var newPropData = {}; + + tile.properties.forEach(function (propData) + { + newPropData[propData['name']] = propData['value']; + }); + + props[tile.id] = newPropData; + } + + // Convert objectgroup + if (tile.objectgroup) + { + tiles[tile.id] = { objectgroup: tile.objectgroup }; + + if (tile.objectgroup.objects) + { + var parsedObjects2 = tile.objectgroup.objects.map( + function (obj) { return ParseObject(obj); } + ); + + tiles[tile.id].objectgroup.objects = parsedObjects2; + } + } + } + + newSet.tileData = tiles; + newSet.tileProperties = props; + } + } + else + { + // Tiled 1 + + // Properties stored per-tile in object with string indexes starting at "0" + if (set.tileproperties) + { + newSet.tileProperties = set.tileproperties; + } + + // Object & terrain shapes stored per-tile in object with string indexes starting at "0" + if (set.tiles) + { + newSet.tileData = set.tiles; + + // Parse the objects into Phaser format to match handling of other Tiled objects + for (stringID in newSet.tileData) + { + var objectGroup = newSet.tileData[stringID].objectgroup; + if (objectGroup && objectGroup.objects) + { + var parsedObjects1 = objectGroup.objects.map( + function (obj) { return ParseObject(obj); } + ); + newSet.tileData[stringID].objectgroup.objects = parsedObjects1; + } } } } @@ -98843,14 +99409,14 @@ module.exports = ParseImageLayers; */ /** - * [description] + * Decode base-64 encoded data, for example as exported by Tiled. * * @function Phaser.Tilemaps.Parsers.Tiled.Base64Decode * @since 3.0.0 * - * @param {object} data - [description] + * @param {object} data - Base-64 encoded data to decode. * - * @return {array} [description] + * @return {array} Array containing the decoded bytes. */ var Base64Decode = function (data) { @@ -98887,7 +99453,7 @@ module.exports = Base64Decode; var Base64Decode = __webpack_require__(458); var GetFastValue = __webpack_require__(2); -var LayerData = __webpack_require__(77); +var LayerData = __webpack_require__(78); var ParseGID = __webpack_require__(215); var Tile = __webpack_require__(55); @@ -99037,8 +99603,8 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); var Vector2 = __webpack_require__(3); /** @@ -99050,12 +99616,11 @@ var Vector2 = __webpack_require__(3); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Math.Vector2} The XY location in tile units. @@ -99104,10 +99669,10 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. @@ -99176,10 +99741,10 @@ var Vector2 = __webpack_require__(3); * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Math.Vector2} The XY location in world coordinates. @@ -99220,10 +99785,10 @@ var GetTilesWithin = __webpack_require__(17); * * @param {integer} tileA - First tile index. * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SwapByIndex = function (indexA, indexB, tileX, tileY, width, height, layer) @@ -99271,10 +99836,10 @@ var ShuffleArray = __webpack_require__(121); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Shuffle = function (tileX, tileY, width, height, layer) @@ -99314,10 +99879,10 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -99356,8 +99921,7 @@ module.exports = SetTileLocationCallback; * @private * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a - * collision callback set for. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -99407,10 +99971,8 @@ var CalculateFacesWithin = __webpack_require__(34); * @private * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer) @@ -99437,7 +99999,10 @@ var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionFromCollisionGroup; @@ -99455,7 +100020,7 @@ module.exports = SetCollisionFromCollisionGroup; var SetTileCollision = __webpack_require__(56); var CalculateFacesWithin = __webpack_require__(34); -var HasValue = __webpack_require__(84); +var HasValue = __webpack_require__(85); /** * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property @@ -99470,12 +100035,9 @@ var HasValue = __webpack_require__(84); * @private * @since 3.0.0 * - * @param {object} properties - An object with tile properties and corresponding values that should - * be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByProperty = function (properties, collides, recalculateFaces, layer) @@ -99512,7 +100074,10 @@ var SetCollisionByProperty = function (properties, collides, recalculateFaces, l } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionByProperty; @@ -99542,10 +100107,8 @@ var SetLayerCollisionIndex = __webpack_require__(133); * @since 3.0.0 * * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, layer) @@ -99568,7 +100131,10 @@ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, lay } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionByExclusion; @@ -99600,10 +100166,8 @@ var SetLayerCollisionIndex = __webpack_require__(133); * * @param {integer} start - The first index of the tile to be set for collision. * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, layer) @@ -99635,7 +100199,10 @@ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, lay } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionBetween; @@ -99665,10 +100232,8 @@ var SetLayerCollisionIndex = __webpack_require__(133); * @since 3.0.0 * * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollision = function (indexes, collides, recalculateFaces, layer) @@ -99697,7 +100262,10 @@ var SetCollision = function (indexes, collides, recalculateFaces, layer) } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollision; @@ -99716,6 +100284,10 @@ module.exports = SetCollision; var GetTilesWithin = __webpack_require__(17); var Color = __webpack_require__(348); +var defaultTileColor = new Color(105, 210, 231, 150); +var defaultCollidingTileColor = new Color(243, 134, 48, 200); +var defaultFaceColor = new Color(40, 39, 37, 150); + /** * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles @@ -99741,18 +100313,15 @@ var RenderDebug = function (graphics, styleConfig, layer) if (styleConfig === undefined) { styleConfig = {}; } // Default colors without needlessly creating Color objects - var tileColor = styleConfig.tileColor !== undefined - ? styleConfig.tileColor - : new Color(105, 210, 231, 150); - var collidingTileColor = styleConfig.collidingTileColor !== undefined - ? styleConfig.collidingTileColor - : new Color(243, 134, 48, 200); - var faceColor = styleConfig.faceColor !== undefined - ? styleConfig.faceColor - : new Color(40, 39, 37, 150); + var tileColor = (styleConfig.tileColor !== undefined) ? styleConfig.tileColor : defaultTileColor; + var collidingTileColor = (styleConfig.collidingTileColor !== undefined) ? styleConfig.collidingTileColor : defaultCollidingTileColor; + var faceColor = (styleConfig.faceColor !== undefined) ? styleConfig.faceColor : defaultFaceColor; var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); + graphics.translate(layer.tilemapLayer.x, layer.tilemapLayer.y); + graphics.scale(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); + for (var i = 0; i < tiles.length; i++) { var tile = tiles[i]; @@ -99763,6 +100332,7 @@ var RenderDebug = function (graphics, styleConfig, layer) var y = tile.pixelY; var color = tile.collides ? collidingTileColor : tileColor; + if (color !== null) { graphics.fillStyle(color.color, color.alpha / 255); @@ -99778,6 +100348,7 @@ var RenderDebug = function (graphics, styleConfig, layer) if (faceColor !== null) { graphics.lineStyle(1, faceColor.color, faceColor.alpha / 255); + if (tile.faceTop) { graphics.lineBetween(x, y, x + tw, y); } if (tile.faceRight) { graphics.lineBetween(x + tw, y, x + tw, y + th); } if (tile.faceBottom) { graphics.lineBetween(x, y + th, x + tw, y + th); } @@ -99800,8 +100371,8 @@ module.exports = RenderDebug; */ var RemoveTileAt = __webpack_require__(219); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's @@ -99811,12 +100382,11 @@ var WorldToTileY = __webpack_require__(48); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. @@ -99855,10 +100425,10 @@ var GetRandom = __webpack_require__(161); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ @@ -99913,11 +100483,10 @@ var PutTileAt = __webpack_require__(134); * @private * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles - * or tile indexes to place. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var PutTilesAt = function (tilesArray, tileX, tileY, recalculateFaces, layer) @@ -99965,8 +100534,8 @@ module.exports = PutTilesAt; */ var PutTileAt = __webpack_require__(134); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -99979,10 +100548,10 @@ var WorldToTileY = __webpack_require__(48); * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} worldX - [description] - * @param {integer} worldY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. @@ -100008,8 +100577,8 @@ module.exports = PutTileAtWorldXY; */ var HasTileAt = __webpack_require__(220); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns @@ -100019,12 +100588,12 @@ var WorldToTileY = __webpack_require__(48); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The X coordinate of the world position. + * @param {number} worldY - The Y coordinate of the world position. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {boolean} + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ var HasTileAtWorldXY = function (worldX, worldY, camera, layer) { @@ -100048,8 +100617,8 @@ module.exports = HasTileAtWorldXY; */ var GetTilesWithin = __webpack_require__(17); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. @@ -100058,18 +100627,15 @@ var WorldToTileY = __webpack_require__(48); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -100106,8 +100672,8 @@ var Intersects = __webpack_require__(274); var NOOP = __webpack_require__(1); var TileToWorldX = __webpack_require__(101); var TileToWorldY = __webpack_require__(100); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); var TriangleToRectangle = function (triangle, rect) { @@ -100127,13 +100693,10 @@ var TriangleToRectangle = function (triangle, rect) * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -100201,8 +100764,8 @@ module.exports = GetTilesWithinShape; */ var GetTileAt = __webpack_require__(102); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Gets a tile at the given world coordinates from the given layer. @@ -100213,9 +100776,8 @@ var WorldToTileY = __webpack_require__(48); * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates @@ -100247,9 +100809,9 @@ var GetTilesWithin = __webpack_require__(17); /** * @callback EachTileCallback * - * @param {Phaser.Tilemaps.Tile} value - [description] - * @param {number} index - [description] - * @param {Phaser.Tilemaps.Tile[]} array - [description] + * @param {Phaser.Tilemaps.Tile} value - The Tile. + * @param {integer} index - The index of the tile. + * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. */ /** @@ -100260,25 +100822,22 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ForEachTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + tiles.forEach(callback, context); }; @@ -100300,11 +100859,11 @@ var GetTilesWithin = __webpack_require__(17); /** * @callback FindTileCallback * - * @param {Phaser.Tilemaps.Tile} value - [description] - * @param {number} index - [description] - * @param {Phaser.Tilemaps.Tile[]} array - [description] + * @param {Phaser.Tilemaps.Tile} value - The Tile. + * @param {integer} index - The index of the tile. + * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. * - * @return {boolean} [description] + * @return {boolean} Return `true` if the callback should run, otherwise `false`. */ /** @@ -100316,20 +100875,16 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?Phaser.Tilemaps.Tile} A Tile that matches the search, or null if no Tile found @@ -100456,17 +101011,14 @@ var GetTilesWithin = __webpack_require__(17); * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} The filtered array of Tiles. @@ -100474,6 +101026,7 @@ var GetTilesWithin = __webpack_require__(17); var FilterTiles = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + return tiles.filter(callback, context); }; @@ -100504,21 +101057,20 @@ var SetTileCollision = __webpack_require__(56); * @private * @since 3.0.0 * - * @param {integer} index - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {integer} index - The tile index to fill the area with. + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} layer - The tile layer to use. If not given the current layer is used. */ var Fill = function (index, tileX, tileY, width, height, recalculateFaces, layer) { - if (recalculateFaces === undefined) { recalculateFaces = true; } - var doesIndexCollide = (layer.collideIndexes.indexOf(index) !== -1); var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + for (var i = 0; i < tiles.length; i++) { tiles[i].index = index; @@ -100558,7 +101110,7 @@ var SnapCeil = __webpack_require__(244); * * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. - * @param {array} [outputArray] - [description] + * @param {array} [outputArray] - An optional array to store the Tile objects within. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -100719,11 +101271,8 @@ var ReplaceByIndex = __webpack_require__(221); * @since 3.0.0 * * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted - * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a - * one-to-one mapping with the indexes array. - * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. + * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -100803,13 +101352,13 @@ var CalculateFacesWithin = __webpack_require__(34); * @private * @since 3.0.0 * - * @param {integer} srcTileX - [description] - * @param {integer} srcTileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] - * @param {integer} destTileX - [description] - * @param {integer} destTileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Copy = function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer) @@ -100874,8 +101423,8 @@ module.exports = { TilemapFactory: __webpack_require__(442), Tileset: __webpack_require__(99), - LayerData: __webpack_require__(77), - MapData: __webpack_require__(76), + LayerData: __webpack_require__(78), + MapData: __webpack_require__(77), ObjectLayer: __webpack_require__(212), DynamicTilemapLayer: __webpack_require__(209), @@ -102868,7 +103417,8 @@ module.exports = Velocity; */ /** - * [description] + * Provides methods for setting the size of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. * * @name Phaser.Physics.Arcade.Components.Size * @since 3.0.0 @@ -102876,13 +103426,14 @@ module.exports = Velocity; var Size = { /** - * [description] + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. * * @method Phaser.Physics.Arcade.Components.Size#setOffset * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The amount to offset the body from the parent Game Object along the x-axis. + * @param {number} [y=x] - The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. * * @return {this} This Game Object. */ @@ -102894,14 +103445,15 @@ var Size = { }, /** - * [description] + * Sets the size of this physics body. Setting the size does not adjust the dimensions + * of the parent Game Object. * * @method Phaser.Physics.Arcade.Components.Size#setSize * @since 3.0.0 * - * @param {number} width - [description] - * @param {number} height - [description] - * @param {boolean} [center=true] - [description] + * @param {number} width - The new width of the physics body, in pixels. + * @param {number} height - The new height of the physics body, in pixels. + * @param {boolean} [center=true] - Should the body be re-positioned so its center aligns with the parent Game Object? * * @return {this} This Game Object. */ @@ -102913,14 +103465,14 @@ var Size = { }, /** - * [description] + * Sets this physics body to use a circle for collision instead of a rectangle. * * @method Phaser.Physics.Arcade.Components.Size#setCircle * @since 3.0.0 * - * @param {number} radius - [description] - * @param {number} [offsetX] - [description] - * @param {number} [offsetY] - [description] + * @param {number} radius - The radius of the physics body, in pixels. + * @param {number} [offsetX] - The amount to offset the body from the parent Game Object along the x-axis. + * @param {number} [offsetY] - The amount to offset the body from the parent Game Object along the y-axis. * * @return {this} This Game Object. */ @@ -103029,7 +103581,8 @@ module.exports = Immovable; */ /** - * [description] + * Provides methods for setting the gravity properties of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. * * @name Phaser.Physics.Arcade.Components.Gravity * @since 3.0.0 @@ -103037,13 +103590,15 @@ module.exports = Immovable; var Gravity = { /** - * [description] + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The gravitational force to be applied to the X-axis. + * @param {number} [y=x] - The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. * * @return {this} This Game Object. */ @@ -103055,12 +103610,12 @@ var Gravity = { }, /** - * [description] + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravityX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The gravitational force to be applied to the X-axis. * * @return {this} This Game Object. */ @@ -103072,12 +103627,12 @@ var Gravity = { }, /** - * [description] + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravityY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} y - The gravitational force to be applied to the Y-axis. * * @return {this} This Game Object. */ @@ -103104,7 +103659,7 @@ module.exports = Gravity; */ /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. The higher than friction, the faster the body will slow down once force stops being applied to it. * * @name Phaser.Physics.Arcade.Components.Friction * @since 3.0.0 @@ -103112,13 +103667,14 @@ module.exports = Gravity; var Friction = { /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. * * @method Phaser.Physics.Arcade.Components.Friction#setFriction * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The amount of horizontal friction to apply. + * @param {number} [y=x] - The amount of vertical friction to apply. * * @return {this} This Game Object. */ @@ -103130,12 +103686,13 @@ var Friction = { }, /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. * * @method Phaser.Physics.Arcade.Components.Friction#setFrictionX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The amount of friction to apply. * * @return {this} This Game Object. */ @@ -103147,12 +103704,13 @@ var Friction = { }, /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. * * @method Phaser.Physics.Arcade.Components.Friction#setFrictionY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} x - The amount of friction to apply. * * @return {this} This Game Object. */ @@ -103187,18 +103745,25 @@ module.exports = Friction; var Enable = { /** - * [description] + * Enables this Game Object's Body. * * @method Phaser.Physics.Arcade.Components.Enable#enableBody * @since 3.0.0 * - * @param {boolean} reset - [description] - * @param {number} x - [description] - * @param {number} y - [description] - * @param {boolean} enableGameObject - [description] - * @param {boolean} showGameObject - [description] + * @param {boolean} reset - Also reset the Body and place it at (x, y). + * @param {number} x - The horizontal position to place the Game Object and Body. + * @param {number} y - The horizontal position to place the Game Object and Body. + * @param {boolean} enableGameObject - Also activate this Game Object. + * @param {boolean} showGameObject - Also show this Game Object. * * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.Body#enable + * @see Phaser.Physics.Arcade.StaticBody#enable + * @see Phaser.Physics.Arcade.Body#reset + * @see Phaser.Physics.Arcade.StaticBody#reset + * @see Phaser.GameObjects.GameObject#active + * @see Phaser.GameObjects.GameObject#visible */ enableBody: function (reset, x, y, enableGameObject, showGameObject) { @@ -103223,15 +103788,20 @@ var Enable = { }, /** - * [description] + * Stops and disables this Game Object's Body. * * @method Phaser.Physics.Arcade.Components.Enable#disableBody * @since 3.0.0 * - * @param {boolean} [disableGameObject=false] - [description] - * @param {boolean} [hideGameObject=false] - [description] + * @param {boolean} [disableGameObject=false] - Also deactivate this Game Object. + * @param {boolean} [hideGameObject=false] - Also hide this Game Object. * * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.Body#enable + * @see Phaser.Physics.Arcade.StaticBody#enable + * @see Phaser.GameObjects.GameObject#active + * @see Phaser.GameObjects.GameObject#visible */ disableBody: function (disableGameObject, hideGameObject) { @@ -103256,7 +103826,7 @@ var Enable = { }, /** - * Syncs the Bodies position and size with its parent Game Object. + * Syncs the Body's position and size with its parent Game Object. * You don't need to call this for Dynamic Bodies, as it happens automatically. * But for Static bodies it's a useful way of modifying the position of a Static Body * in the Physics World, based on its Game Object. @@ -103265,6 +103835,8 @@ var Enable = { * @since 3.1.0 * * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject */ refreshBody: function () { @@ -103671,7 +104243,7 @@ module.exports = Angular; */ /** - * [description] + * Provides methods used for setting the acceleration properties of an Arcade Body. * * @name Phaser.Physics.Arcade.Components.Acceleration * @since 3.0.0 @@ -103679,7 +104251,7 @@ module.exports = Angular; var Acceleration = { /** - * [description] + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. * * @method Phaser.Physics.Arcade.Components.Acceleration#setAcceleration * @since 3.0.0 @@ -103697,7 +104269,7 @@ var Acceleration = { }, /** - * [description] + * Sets the body's horizontal acceleration. * * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationX * @since 3.0.0 @@ -103714,7 +104286,7 @@ var Acceleration = { }, /** - * [description] + * Sets the body's vertical acceleration. * * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationY * @since 3.0.0 @@ -103747,7 +104319,7 @@ module.exports = Acceleration; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(31); -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); var DistanceSquared = __webpack_require__(250); var Factory = __webpack_require__(239); var GetFastValue = __webpack_require__(2); @@ -103756,18 +104328,19 @@ var PluginCache = __webpack_require__(15); var Vector2 = __webpack_require__(3); var World = __webpack_require__(234); -// All methods in this class are available under `this.physics` in a Scene. - /** * @classdesc - * [description] + * The Arcade Physics Plugin belongs to a Scene and sets up and manages the Scene's physics simulation. + * It also holds some useful methods for moving and rotating Arcade Physics Bodies. + * + * You can access it from within a Scene using `this.physics`. * * @class ArcadePhysics * @memberOf Phaser.Physics.Arcade * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene that this Plugin belongs to. */ var ArcadePhysics = new Class({ @@ -103776,7 +104349,7 @@ var ArcadePhysics = new Class({ function ArcadePhysics (scene) { /** - * [description] + * The Scene that this Plugin belongs to. * * @name Phaser.Physics.Arcade.ArcadePhysics#scene * @type {Phaser.Scene} @@ -103785,7 +104358,7 @@ var ArcadePhysics = new Class({ this.scene = scene; /** - * [description] + * The Scene's Systems. * * @name Phaser.Physics.Arcade.ArcadePhysics#systems * @type {Phaser.Scenes.Systems} @@ -103794,7 +104367,7 @@ var ArcadePhysics = new Class({ this.systems = scene.sys; /** - * [description] + * A configuration object. Union of the `physics.arcade.*` properties of the GameConfig and SceneConfig objects. * * @name Phaser.Physics.Arcade.ArcadePhysics#config * @type {object} @@ -103803,7 +104376,7 @@ var ArcadePhysics = new Class({ this.config = this.getConfig(); /** - * [description] + * The physics simulation. * * @name Phaser.Physics.Arcade.ArcadePhysics#world * @type {Phaser.Physics.Arcade.World} @@ -103812,7 +104385,7 @@ var ArcadePhysics = new Class({ this.world; /** - * [description] + * An object holding the Arcade Physics factory methods. * * @name Phaser.Physics.Arcade.ArcadePhysics#add * @type {Phaser.Physics.Arcade.Factory} @@ -103865,12 +104438,12 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Creates the physics configuration for the current Scene. * * @method Phaser.Physics.Arcade.ArcadePhysics#getConfig * @since 3.0.0 * - * @return {object} [description] + * @return {object} The physics configuration. */ getConfig: function () { @@ -103886,31 +104459,20 @@ var ArcadePhysics = new Class({ }, /** - * Checks for overlaps between two Game Objects. The objects can be any Game Object that have an Arcade Physics Body. - * - * Unlike {@link #collide} the objects are NOT automatically separated or have any physics applied, they merely test for overlap results. - * - * Both the first and second parameter can be arrays of objects, of differing types. - * If two arrays are passed, the contents of the first parameter will be tested against all contents of the 2nd parameter. - * - * ##### Tilemaps - * - * Any overlapping tiles, including blank/null tiles, will give a positive result. Tiles marked via {@link Phaser.Tilemap#setCollision} (and similar methods) have no special status, and callbacks added via {@link Phaser.Tilemap#setTileIndexCallback} or {@link Phaser.Tilemap#setTileLocationCallback} are not invoked. So calling this method without any callbacks isn't very useful. - * - * If you're interested only in whether an object overlaps a certain tile or class of tiles, filter the tiles with `processCallback` and then use the result returned by this method. Blank/null tiles can be excluded by their {@link Phaser.Tile#index index} (-1). - * - * If you want to take action on certain overlaps, examine the tiles in `collideCallback` and then handle as you like. + * Tests if Game Objects overlap. See {@link Phaser.Physics.Arcade.World#overlap} * * @method Phaser.Physics.Arcade.ArcadePhysics#overlap * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {ArcadePhysicsCallback} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter. - * @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * - * @return {boolean} True if an overlap occurred otherwise false. + * @return {boolean} True if at least one Game Object overlaps another. + * + * @see Phaser.Physics.Arcade.World#overlap */ overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) { @@ -103922,18 +104484,20 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Tests if Game Objects overlap and separates them (if possible). See {@link Phaser.Physics.Arcade.World#collide}. * * @method Phaser.Physics.Arcade.ArcadePhysics#collide * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {ArcadePhysicsCallback} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter. - * @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * - * @return {boolean} True if a collision occurred otherwise false. + * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. + * + * @see Phaser.Physics.Arcade.World#collide */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -103945,12 +104509,12 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Pauses the simulation. * * @method Phaser.Physics.Arcade.ArcadePhysics#pause * @since 3.0.0 * - * @return {Phaser.Physics.Arcade.World} [description] + * @return {Phaser.Physics.Arcade.World} The simulation. */ pause: function () { @@ -103958,12 +104522,12 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Resumes the simulation (if paused). * * @method Phaser.Physics.Arcade.ArcadePhysics#resume * @since 3.0.0 * - * @return {Phaser.Physics.Arcade.World} [description] + * @return {Phaser.Physics.Arcade.World} The simulation. */ resume: function () { @@ -104209,6 +104773,12 @@ var ArcadePhysics = new Class({ */ shutdown: function () { + if (!this.world) + { + // Already destroyed + return; + } + var eventEmitter = this.systems.events; eventEmitter.off('update', this.world.update, this.world); @@ -104473,9 +105043,9 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#equals * @since 3.0.0 * - * @param {Phaser.Math.Vector4} v - [description] + * @param {Phaser.Math.Vector4} v - The vector to check equality with. * - * @return {boolean} [description] + * @return {boolean} A boolean indicating whether the two Vectors are equal or not. */ equals: function (v) { @@ -104737,7 +105307,7 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#distance * @since 3.0.0 * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. * * @return {number} The distance from this Vector to the given Vector. */ @@ -105960,7 +106530,7 @@ module.exports = DistancePower; module.exports = { - Between: __webpack_require__(51), + Between: __webpack_require__(52), Power: __webpack_require__(560), Squared: __webpack_require__(250) @@ -106314,7 +106884,7 @@ var PhaserMath = { Factorial: __webpack_require__(245), FloatBetween: __webpack_require__(300), FloorTo: __webpack_require__(543), - FromPercent: __webpack_require__(92), + FromPercent: __webpack_require__(93), GetSpeed: __webpack_require__(542), IsEven: __webpack_require__(541), IsEvenStrict: __webpack_require__(540), @@ -106336,7 +106906,7 @@ var PhaserMath = { SmoothStep: __webpack_require__(181), TransformXY: __webpack_require__(333), Within: __webpack_require__(531), - Wrap: __webpack_require__(52), + Wrap: __webpack_require__(53), // Vector classes Vector2: __webpack_require__(3), @@ -107191,6 +107761,12 @@ var LoaderPlugin = new Class({ */ nextFile: function (file, success) { + // Has the game been destroyed during load? If so, bail out now. + if (!this.inflight) + { + return; + } + this.inflight.delete(file); this.updateProgress(); @@ -107231,6 +107807,12 @@ var LoaderPlugin = new Class({ */ fileProcessComplete: function (file) { + // Has the game been destroyed during load? If so, bail out now. + if (!this.scene || !this.systems || !this.systems.game || this.systems.game.pendingDestroy) + { + return; + } + // This file has failed, so move it to the failed Set if (file.state === CONST.FILE_ERRORED) { @@ -107714,7 +108296,7 @@ module.exports = UnityAtlasFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var TILEMAP_FORMATS = __webpack_require__(29); /** @@ -107879,7 +108461,7 @@ module.exports = TilemapJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var TILEMAP_FORMATS = __webpack_require__(29); /** @@ -109421,7 +110003,7 @@ module.exports = PluginFile; var Class = __webpack_require__(0); var CONST = __webpack_require__(18); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); /** * @typedef {object} Phaser.Loader.FileTypes.PackFileConfig @@ -109651,7 +110233,7 @@ var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(2); var ImageFile = __webpack_require__(58); var IsPlainObject = __webpack_require__(8); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var MultiFile = __webpack_require__(57); /** @@ -111073,7 +111655,7 @@ var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(8); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var MultiFile = __webpack_require__(57); /** @@ -111629,7 +112211,7 @@ var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(2); var ImageFile = __webpack_require__(58); var IsPlainObject = __webpack_require__(8); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var MultiFile = __webpack_require__(57); /** @@ -111888,7 +112470,7 @@ module.exports = AtlasJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); /** * @classdesc @@ -112106,7 +112688,7 @@ module.exports = { HTMLFile: __webpack_require__(584), HTMLTextureFile: __webpack_require__(583), ImageFile: __webpack_require__(58), - JSONFile: __webpack_require__(50), + JSONFile: __webpack_require__(51), MultiAtlasFile: __webpack_require__(582), PackFile: __webpack_require__(581), PluginFile: __webpack_require__(580), @@ -113365,20 +113947,20 @@ module.exports = CreatePixelPerfectHandler; */ var Circle = __webpack_require__(71); -var CircleContains = __webpack_require__(39); +var CircleContains = __webpack_require__(40); var Class = __webpack_require__(0); var CreateInteractiveObject = __webpack_require__(261); var CreatePixelPerfectHandler = __webpack_require__(608); -var DistanceBetween = __webpack_require__(51); -var Ellipse = __webpack_require__(89); -var EllipseContains = __webpack_require__(88); +var DistanceBetween = __webpack_require__(52); +var Ellipse = __webpack_require__(90); +var EllipseContains = __webpack_require__(89); var EventEmitter = __webpack_require__(11); var GetFastValue = __webpack_require__(2); var InputPluginCache = __webpack_require__(106); var IsPlainObject = __webpack_require__(8); var PluginCache = __webpack_require__(15); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); var Triangle = __webpack_require__(59); var TriangleContains = __webpack_require__(69); @@ -116808,7 +117390,7 @@ var Length = __webpack_require__(65); // The 2D area of a triangle. The area value is always non-negative. /** - * [description] + * Gets the length of the perimeter of the given triangle. * * @function Phaser.Geom.Triangle.Perimeter * @since 3.0.0 @@ -116840,15 +117422,15 @@ module.exports = Perimeter; */ /** - * [description] + * Returns true if two triangles have the same coordinates. * * @function Phaser.Geom.Triangle.Equals * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Triangle} toCompare - [description] + * @param {Phaser.Geom.Triangle} triangle - The first triangle to check. + * @param {Phaser.Geom.Triangle} toCompare - The second triangle to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the two given triangles have the exact same coordinates, otherwise `false`. */ var Equals = function (triangle, toCompare) { @@ -117138,19 +117720,19 @@ var Offset = __webpack_require__(263); */ /** - * [description] + * Positions the Triangle so that it is centered on the given coordinates. * * @function Phaser.Geom.Triangle.CenterOn * @since 3.0.0 * * @generic {Phaser.Geom.Triangle} O - [triangle,$return] * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {number} x - [description] - * @param {number} y - [description] - * @param {CenterFunction} [centerFunc] - [description] + * @param {Phaser.Geom.Triangle} triangle - The triangle to be positioned. + * @param {number} x - The horizontal coordinate to center on. + * @param {number} y - The vertical coordinate to center on. + * @param {CenterFunction} [centerFunc] - The function used to center the triangle. Defaults to Centroid centering. * - * @return {Phaser.Geom.Triangle} [description] + * @return {Phaser.Geom.Triangle} The Triangle that was centered. */ var CenterOn = function (triangle, x, y, centerFunc) { @@ -117186,17 +117768,17 @@ var Triangle = __webpack_require__(59); // w/h can be positive or negative and represent the length of each side /** - * [description] + * Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles. * * @function Phaser.Geom.Triangle.BuildRight * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} x - The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle. + * @param {number} y - The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle. + * @param {number} width - The length of the side which is to the left or to the right of the right angle. + * @param {number} height - The length of the side which is above or below the right angle. * - * @return {Phaser.Geom.Triangle} [description] + * @return {Phaser.Geom.Triangle} The constructed right Triangle. */ var BuildRight = function (x, y, width, height) { @@ -117305,24 +117887,18 @@ module.exports = BuildFromPolygon; var Triangle = __webpack_require__(59); -// Builds an equilateral triangle. -// In the equilateral triangle, all the sides are the same length (congruent) -// and all the angles are the same size (congruent). - -// The x/y specifies the top-middle of the triangle (x1/y1) and length -// is the length of each side - /** - * [description] + * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). + * The x/y specifies the top-middle of the triangle (x1/y1) and length is the length of each side. * * @function Phaser.Geom.Triangle.BuildEquilateral * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} length - [description] + * @param {number} x - x coordinate of the top point of the triangle. + * @param {number} y - y coordinate of the top point of the triangle. + * @param {number} length - Length of each side of the triangle. * - * @return {Phaser.Geom.Triangle} [description] + * @return {Phaser.Geom.Triangle} The Triangle object of the given size. */ var BuildEquilateral = function (x, y, length) { @@ -117634,17 +118210,17 @@ module.exports = Overlaps; */ /** - * [description] + * Nudges (translates) the top-left corner of a Rectangle by the coordinates of a point (translation vector). * * @function Phaser.Geom.Rectangle.OffsetPoint * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point} point - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * @param {(Phaser.Geom.Point|Phaser.Math.Vector2)} point - The point whose coordinates should be used as an offset. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var OffsetPoint = function (rect, point) { @@ -117668,18 +118244,18 @@ module.exports = OffsetPoint; */ /** - * [description] + * Nudges (translates) the top left corner of a Rectangle by a given offset. * * @function Phaser.Geom.Rectangle.Offset * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * @param {number} x - The distance to move the Rectangle horizontally. + * @param {number} y - The distance to move the Rectangle vertically. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var Offset = function (rect, x, y) { @@ -117703,18 +118279,18 @@ module.exports = Offset; */ /** - * [description] + * Merges a Rectangle with a point by repositioning and/or resizing it so that the point is on or within its bounds. * * @function Phaser.Geom.Rectangle.MergeXY * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [target,$return] * - * @param {Phaser.Geom.Rectangle} target - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged and modified. + * @param {number} x - The X coordinate of the point which should be merged. + * @param {number} y - The Y coordinate of the point which should be merged. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The modified `target` Rectangle. */ var MergeXY = function (target, x, y) { @@ -117750,17 +118326,18 @@ module.exports = MergeXY; // Neither rect should have negative widths or heights /** - * [description] + * Merges the source rectangle into the target rectangle and returns the target. + * Neither rectangle should have a negative width or height. * * @function Phaser.Geom.Rectangle.MergeRect * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [target,$return] * - * @param {Phaser.Geom.Rectangle} target - [description] - * @param {Phaser.Geom.Rectangle} source - [description] + * @param {Phaser.Geom.Rectangle} target - Target rectangle. Will be modified to include source rectangle. + * @param {Phaser.Geom.Rectangle} source - Rectangle that will be merged into target rectangle. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} Modified target rectangle that contains source rectangle. */ var MergeRect = function (target, source) { @@ -117792,21 +118369,18 @@ module.exports = MergeRect; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// Merges the target Rectangle with a list of points. -// The points is an array of objects with public x/y properties. - /** - * [description] + * Merges a Rectangle with a list of points by repositioning and/or resizing it such that all points are located on or within its bounds. * * @function Phaser.Geom.Rectangle.MergePoints * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [target,$return] * - * @param {Phaser.Geom.Rectangle} target - [description] - * @param {Phaser.Geom.Point[]} points - [description] + * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged. + * @param {Phaser.Geom.Point[]} points - An array of Points (or any object with public `x` and `y` properties) which should be merged with the Rectangle. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The modified Rectangle. */ var MergePoints = function (target, points) { @@ -117981,20 +118555,18 @@ module.exports = GetSize; var Point = __webpack_require__(6); -// The center of the Rectangle object, expressed as a Point object - /** - * [description] + * Returns the center of a Rectangle as a Point. * * @function Phaser.Geom.Rectangle.GetCenter * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {(Phaser.Geom.Point|object)} [out] - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the center of. + * @param {(Phaser.Geom.Point|object)} [out] - Optional point-like object to update with the center coordinates. * - * @return {(Phaser.Geom.Point|object)} [description] + * @return {(Phaser.Geom.Point|object)} The modified `out` object, or a new Point if none was provided. */ var GetCenter = function (rect, out) { @@ -118020,16 +118592,16 @@ module.exports = GetCenter; */ /** - * [description] + * Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension. * * @function Phaser.Geom.Rectangle.FloorAll * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var FloorAll = function (rect) { @@ -118258,18 +118830,18 @@ module.exports = CopyFrom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(38); +var Contains = __webpack_require__(39); /** - * [description] + * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. * * @function Phaser.Geom.Rectangle.ContainsPoint * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point} point - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle object. + * @param {Phaser.Geom.Point} point - The point object to be checked. Can be a Phaser Point object or any object with x and y values. * - * @return {boolean} [description] + * @return {boolean} A value of true if the Rectangle object contains the specified point, otherwise false. */ var ContainsPoint = function (rect, point) { @@ -118292,14 +118864,14 @@ module.exports = ContainsPoint; var Rectangle = __webpack_require__(9); /** - * [description] + * Creates a new Rectangle which is identical to the given one. * * @function Phaser.Geom.Rectangle.Clone * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} source - [description] + * @param {Phaser.Geom.Rectangle} source - The Rectangle to clone. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The newly created Rectangle, which is separate from the given one. */ var Clone = function (source) { @@ -118355,16 +118927,16 @@ module.exports = CeilAll; */ /** - * [description] + * Rounds a Rectangle's position up to the smallest integer greater than or equal to each current coordinate. * * @function Phaser.Geom.Rectangle.Ceil * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var Ceil = function (rect) { @@ -118450,17 +119022,19 @@ module.exports = Reverse; // Export the points as an array of flat numbers, following the sequence [ x,y, x,y, x,y ] /** - * [description] + * Stores all of the points of a Polygon into a flat array of numbers following the sequence [ x,y, x,y, x,y ], + * i.e. each point of the Polygon, in the order it's defined, corresponds to two elements of the resultant + * array for the point's X and Y coordinate. * * @function Phaser.Geom.Polygon.GetNumberArray * @since 3.0.0 * * @generic {number[]} O - [output,$return] * - * @param {Phaser.Geom.Polygon} polygon - [description] - * @param {(array|number[])} [output] - [description] + * @param {Phaser.Geom.Polygon} polygon - The Polygon whose points to export. + * @param {(array|number[])} [output] - An array to which the points' coordinates should be appended. * - * @return {(array|number[])} [description] + * @return {(array|number[])} The modified `output` array, or a new array if none was given. */ var GetNumberArray = function (polygon, output) { @@ -118744,16 +119318,16 @@ module.exports = Negative; */ /** - * [description] + * Swaps the X and the Y coordinate of a point. * * @function Phaser.Geom.Point.Invert * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [point,$return] * - * @param {Phaser.Geom.Point} point - [description] + * @param {Phaser.Geom.Point} point - The Point to modify. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} The modified `point`. */ var Invert = function (point) { @@ -118776,7 +119350,7 @@ module.exports = Invert; var Point = __webpack_require__(6); /** - * [description] + * Interpolate two given Point objects, based on `t` value. Return result either as new Point if `out` parameter is omitted or load result into Point passed as `out` parameter and return it. For `out` parameter you can also use any object with public x/y properties. * * @function Phaser.Geom.Point.Interpolate * @since 3.0.0 @@ -118978,15 +119552,15 @@ module.exports = Floor; */ /** - * [description] + * A comparison of two `Point` objects to see if they are equal. * * @function Phaser.Geom.Point.Equals * @since 3.0.0 * - * @param {Phaser.Geom.Point} point - [description] - * @param {Phaser.Geom.Point} toCompare - [description] + * @param {Phaser.Geom.Point} point - The original `Point` to compare against. + * @param {Phaser.Geom.Point} toCompare - The second `Point` to compare. * - * @return {boolean} [description] + * @return {boolean} Returns true if the both `Point` objects are equal. */ var Equals = function (point, toCompare) { @@ -119434,7 +120008,7 @@ var Angle = __webpack_require__(68); * @function Phaser.Geom.Line.NormalX * @since 3.0.0 * - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Line} line - The Line object to get the normal value from. * * @return {number} [description] */ @@ -119834,15 +120408,17 @@ var Contains = __webpack_require__(69); var LineToLine = __webpack_require__(107); /** - * [description] + * Checks if a Triangle and a Line intersect. + * + * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * * @function Phaser.Geom.Intersects.TriangleToLine * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check with. + * @param {Phaser.Geom.Line} line - The Line to check with. * - * @return {boolean} [description] + * @return {boolean} `true` if the Triangle and the Line intersect, otherwise `false`. */ var TriangleToLine = function (triangle, line) { @@ -119988,20 +120564,20 @@ module.exports = RectangleToValues; */ var LineToLine = __webpack_require__(107); -var Contains = __webpack_require__(38); +var Contains = __webpack_require__(39); var ContainsArray = __webpack_require__(146); var Decompose = __webpack_require__(271); /** - * [description] + * Checks for intersection between Rectangle shape and Triangle shape. * * @function Phaser.Geom.Intersects.RectangleToTriangle * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Triangle} triangle - [description] + * @param {Phaser.Geom.Rectangle} rect - Rectangle object to test. + * @param {Phaser.Geom.Triangle} triangle - Triangle object to test. * - * @return {boolean} [description] + * @return {boolean} A value of `true` if objects intersect; otherwise `false`. */ var RectangleToTriangle = function (rect, triangle) { @@ -120226,18 +120802,22 @@ var Rectangle = __webpack_require__(9); var RectangleToRectangle = __webpack_require__(147); /** - * [description] + * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. + * + * If optional `output` parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero). + * + * If Rectangle object is passed as `output` and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersetion, it will be returned without any change. * * @function Phaser.Geom.Intersects.GetRectangleIntersection * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [output,$return] * - * @param {Phaser.Geom.Rectangle} rectA - [description] - * @param {Phaser.Geom.Rectangle} rectB - [description] - * @param {Phaser.Geom.Rectangle} [output] - [description] + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle object. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle object. + * @param {Phaser.Geom.Rectangle} [output] - Optional Rectangle object. If given, the intersection data will be loaded into it (in case of no intersection, it will be left unchanged). Otherwise, new Rectangle object will be created and returned with either intersection data or empty (all values set to zero), if there is no intersection. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} A rectangle object with intersection data. */ var GetRectangleIntersection = function (rectA, rectB, output) { @@ -120321,18 +120901,18 @@ module.exports = CircleToRectangle; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); /** - * [description] + * Checks if two Circles intersect. * * @function Phaser.Geom.Intersects.CircleToCircle * @since 3.0.0 * - * @param {Phaser.Geom.Circle} circleA - [description] - * @param {Phaser.Geom.Circle} circleB - [description] + * @param {Phaser.Geom.Circle} circleA - The first Circle to check for intersection. + * @param {Phaser.Geom.Circle} circleB - The second Circle to check for intersection. * - * @return {boolean} [description] + * @return {boolean} `true` if the two Circles intersect, otherwise `false`. */ var CircleToCircle = function (circleA, circleB) { @@ -120528,7 +121108,7 @@ module.exports = CopyFrom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(88); +var Contains = __webpack_require__(89); /** * Check to see if the Ellipse contains all four points of the given Rectangle object. @@ -120564,7 +121144,7 @@ module.exports = ContainsRect; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(88); +var Contains = __webpack_require__(89); /** * Check to see if the Ellipse contains the given Point object. @@ -120595,7 +121175,7 @@ module.exports = ContainsPoint; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Ellipse = __webpack_require__(89); +var Ellipse = __webpack_require__(90); /** * Creates a new Ellipse instance based on the values contained in the given source. @@ -120659,13 +121239,13 @@ module.exports = Area; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Ellipse = __webpack_require__(89); +var Ellipse = __webpack_require__(90); Ellipse.Area = __webpack_require__(711); Ellipse.Circumference = __webpack_require__(307); Ellipse.CircumferencePoint = __webpack_require__(155); Ellipse.Clone = __webpack_require__(710); -Ellipse.Contains = __webpack_require__(88); +Ellipse.Contains = __webpack_require__(89); Ellipse.ContainsPoint = __webpack_require__(709); Ellipse.ContainsRect = __webpack_require__(708); Ellipse.CopyFrom = __webpack_require__(707); @@ -120865,7 +121445,7 @@ module.exports = CopyFrom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(39); +var Contains = __webpack_require__(40); /** * Check to see if the Circle contains all four points of the given Rectangle object. @@ -120901,7 +121481,7 @@ module.exports = ContainsRect; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(39); +var Contains = __webpack_require__(40); /** * Check to see if the Circle contains the given Point object. @@ -120996,7 +121576,7 @@ Circle.Area = __webpack_require__(721); Circle.Circumference = __webpack_require__(403); Circle.CircumferencePoint = __webpack_require__(192); Circle.Clone = __webpack_require__(720); -Circle.Contains = __webpack_require__(39); +Circle.Contains = __webpack_require__(40); Circle.ContainsPoint = __webpack_require__(719); Circle.ContainsRect = __webpack_require__(718); Circle.CopyFrom = __webpack_require__(717); @@ -121940,7 +122520,7 @@ GameObjectCreator.register('particles', function (config, addToScene) var BuildGameObject = __webpack_require__(28); var GameObjectCreator = __webpack_require__(13); var GetAdvancedValue = __webpack_require__(12); -var Image = __webpack_require__(86); +var Image = __webpack_require__(87); /** * Creates a new Image Game Object and returns it. @@ -121988,7 +122568,7 @@ GameObjectCreator.register('image', function (config, addToScene) */ var GameObjectCreator = __webpack_require__(13); -var Group = __webpack_require__(87); +var Group = __webpack_require__(88); /** * Creates a new Group Game Object and returns it. @@ -123207,7 +123787,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Image = __webpack_require__(86); +var Image = __webpack_require__(87); var GameObjectFactory = __webpack_require__(5); /** @@ -123249,7 +123829,7 @@ GameObjectFactory.register('image', function (x, y, key, frame) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Group = __webpack_require__(87); +var Group = __webpack_require__(88); var GameObjectFactory = __webpack_require__(5); /** @@ -123751,7 +124331,7 @@ module.exports = StarCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -124134,7 +124714,7 @@ module.exports = PolygonCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -125417,7 +125997,7 @@ module.exports = EllipseCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -125611,7 +126191,7 @@ module.exports = CurveCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -125793,7 +126373,7 @@ module.exports = ArcCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -126679,20 +127259,27 @@ var TextStyle = new Class({ */ setFont: function (font) { - if (typeof font === 'string') + var fontFamily = font; + var fontSize = ''; + var fontStyle = ''; + + if (typeof font !== 'string') { - this.fontFamily = font; - this.fontSize = ''; - this.fontStyle = ''; - } - else - { - this.fontFamily = GetValue(font, 'fontFamily', 'Courier'); - this.fontSize = GetValue(font, 'fontSize', '16px'); - this.fontStyle = GetValue(font, 'fontStyle', ''); + fontFamily = GetValue(font, 'fontFamily', 'Courier'); + fontSize = GetValue(font, 'fontSize', '16px'); + fontStyle = GetValue(font, 'fontStyle', ''); } - return this.update(true); + if (fontFamily !== this.fontFamily || fontSize !== this.fontSize || fontStyle !== this.fontStyle) + { + this.fontFamily = fontFamily; + this.fontSize = fontSize; + this.fontStyle = fontStyle; + + this.update(true); + } + + return this.parent; }, /** @@ -126707,9 +127294,14 @@ var TextStyle = new Class({ */ setFontFamily: function (family) { - this.fontFamily = family; + if (this.fontFamily !== family) + { + this.fontFamily = family; - return this.update(true); + this.update(true); + } + + return this.parent; }, /** @@ -126724,9 +127316,14 @@ var TextStyle = new Class({ */ setFontStyle: function (style) { - this.fontStyle = style; + if (this.fontStyle !== style) + { + this.fontStyle = style; - return this.update(true); + this.update(true); + } + + return this.parent; }, /** @@ -126746,9 +127343,14 @@ var TextStyle = new Class({ size = size.toString() + 'px'; } - this.fontSize = size; + if (this.fontSize !== size) + { + this.fontSize = size; - return this.update(true); + this.update(true); + } + + return this.parent; }, /** @@ -126886,24 +127488,31 @@ var TextStyle = new Class({ */ setStroke: function (color, thickness) { - if (color === undefined) + if (thickness === undefined) { thickness = this.strokeThickness; } + + if (color === undefined && this.strokeThickness !== 0) { // Reset the stroke to zero (disabling it) this.strokeThickness = 0; - } - else - { - if (thickness === undefined) { thickness = this.strokeThickness; } + this.update(true); + } + else if (this.stroke !== color || this.strokeThickness !== thickness) + { this.stroke = color; this.strokeThickness = thickness; + + this.update(true); } - return this.update(true); + return this.parent; }, /** * Set the shadow settings. + * + * Calling this method always re-measures the parent Text object, + * so only call it when you actually change the shadow settings. * * @method Phaser.GameObjects.Text.TextStyle#setShadow * @since 3.0.0 @@ -128129,9 +128738,9 @@ module.exports = { var Class = __webpack_require__(0); var FloatBetween = __webpack_require__(300); -var GetEaseFunction = __webpack_require__(85); +var GetEaseFunction = __webpack_require__(86); var GetFastValue = __webpack_require__(2); -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * The returned value sets what the property will be at the START of the particle's life, on emit. @@ -131802,14 +132411,14 @@ var UpdateList = new Class({ while (i--) { - this.this._pendingRemoval[i].destroy(true); + this._pendingRemoval[i].destroy(true); } i = this._pendingInsertion.length; while (i--) { - this.this._pendingInsertion[i].destroy(true); + this._pendingInsertion[i].destroy(true); } this._list.length = 0; @@ -132058,7 +132667,7 @@ module.exports = Replace; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var SpliceOne = __webpack_require__(90); +var SpliceOne = __webpack_require__(91); /** * Removes a random object from the given array and returns it. @@ -132159,7 +132768,7 @@ module.exports = RemoveBetween; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var SpliceOne = __webpack_require__(90); +var SpliceOne = __webpack_require__(91); /** * Removes the item from the given position in the array. @@ -133153,14 +133762,14 @@ module.exports = ReverseRows; */ /** - * [description] + * Reverses the columns in the given Array Matrix. * * @function Phaser.Utils.Array.Matrix.ReverseColumns * @since 3.0.0 * - * @param {array} matrix - [description] + * @param {array} matrix - The array matrix to reverse the columns for. * - * @return {array} [description] + * @return {array} The column reversed matrix. */ var ReverseColumns = function (matrix) { @@ -133192,14 +133801,14 @@ var CheckMatrix = __webpack_require__(162); // Array Matrix. /** - * [description] + * Generates a string (which you can pass to console.log) from the given Array Matrix. * * @function Phaser.Utils.Array.Matrix.MatrixToString * @since 3.0.0 * - * @param {array} matrix - [description] + * @param {array} matrix - A 2-dimensional array. * - * @return {string} [description] + * @return {string} A string representing the matrix. */ var MatrixToString = function (matrix) { @@ -133558,8 +134167,8 @@ var GameObjects = { Container: __webpack_require__(159), DynamicBitmapText: __webpack_require__(158), Graphics: __webpack_require__(157), - Group: __webpack_require__(87), - Image: __webpack_require__(86), + Group: __webpack_require__(88), + Image: __webpack_require__(87), Particles: __webpack_require__(822), PathFollower: __webpack_require__(297), RenderTexture: __webpack_require__(153), @@ -135367,7 +135976,7 @@ var CanvasTexture = new Class({ /** * A reference to the Texture Source of this Canvas. * - * @name Phaser.Textures.CanvasTexturer#_source + * @name Phaser.Textures.CanvasTexture#_source * @type {Phaser.Textures.TextureSource} * @private * @since 3.7.0 @@ -135387,7 +135996,7 @@ var CanvasTexture = new Class({ /** * The 2D Canvas Rendering Context. * - * @name Phaser.Textures.CanvasTexture#canvas + * @name Phaser.Textures.CanvasTexture#context * @readOnly * @type {CanvasRenderingContext2D} * @since 3.7.0 @@ -137190,7 +137799,7 @@ module.exports = init(); * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var OS = __webpack_require__(91); +var OS = __webpack_require__(92); var Browser = __webpack_require__(118); /** @@ -137289,76 +137898,76 @@ var ValueToColor = __webpack_require__(178); /** * @callback BootCallback * - * @param {Phaser.Game} game - [description] + * @param {Phaser.Game} game - The game. */ /** * @typedef {object} InputConfig * - * @property {(boolean|KeyboardInputConfig)} [keyboard=true] - [description] - * @property {(boolean|MouseInputConfig)} [mouse=true] - [description] - * @property {(boolean|TouchInputConfig)} [touch=true] - [description] - * @property {(boolean|GamepadInputConfig)} [gamepad=false] - [description] - * @property {integer} [activePointers=1] - [description] + * @property {(boolean|KeyboardInputConfig)} [keyboard=true] - Keyboard input configuration. `true` uses the default configuration and `false` disables keyboard input. + * @property {(boolean|MouseInputConfig)} [mouse=true] - Mouse input configuration. `true` uses the default configuration and `false` disables mouse input. + * @property {(boolean|TouchInputConfig)} [touch=true] - Touch input configuration. `true` uses the default configuration and `false` disables touch input. + * @property {(boolean|GamepadInputConfig)} [gamepad=false] - Gamepad input configuration. `true` enables gamepad input. + * @property {integer} [activePointers=1] - The maximum number of touch pointers. See {@link Phaser.Input.InputManager#pointers}. */ /** * @typedef {object} MouseInputConfig * - * @property {*} [target=null] - [description] - * @property {boolean} [capture=true] - [description] + * @property {*} [target=null] - Where the Mouse Manager listens for mouse input events. The default is the game canvas. + * @property {boolean} [capture=true] - Whether mouse input events have preventDefault() called on them. */ /** * @typedef {object} KeyboardInputConfig * - * @property {*} [target=window] - [description] + * @property {*} [target=window] - Where the Keyboard Manager listens for keyboard input events. */ /** * @typedef {object} TouchInputConfig * - * @property {*} [target=null] - [description] - * @property {boolean} [capture=true] - [description] + * @property {*} [target=null] - Where the Touch Manager listens for touch input events. The default is the game canvas. + * @property {boolean} [capture=true] - Whether touch input events have preventDefault() called on them. */ /** * @typedef {object} GamepadInputConfig * - * @property {*} [target=window] - [description] + * @property {*} [target=window] - Where the Gamepad Manager listens for gamepad input events. */ /** * @typedef {object} BannerConfig * - * @property {boolean} [hidePhaser=false] - [description] - * @property {string} [text='#ffffff'] - [description] - * @property {string[]} [background] - [description] + * @property {boolean} [hidePhaser=false] - Omit Phaser's name and version from the banner. + * @property {string} [text='#ffffff'] - The color of the banner text. + * @property {string[]} [background] - The background colors of the banner. */ /** * @typedef {object} FPSConfig * - * @property {integer} [min=10] - [description] - * @property {integer} [target=60] - [description] - * @property {boolean} [forceSetTimeOut=false] - [description] - * @property {integer} [deltaHistory=10] - [description] + * @property {integer} [min=10] - The minimum acceptable rendering rate, in frames per second. + * @property {integer} [target=60] - The optimum rendering rate, in frames per second. + * @property {boolean} [forceSetTimeOut=false] - Use setTimeout instead of requestAnimationFrame to run the game loop. + * @property {integer} [deltaHistory=10] - Calculate the average frame delta from this many consecutive frame intervals. * @property {integer} [panicMax=120] - [description] */ /** * @typedef {object} RenderConfig * - * @property {boolean} [antialias=true] - [description] - * @property {boolean} [pixelArt=false] - [description] + * @property {boolean} [antialias=true] - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. + * @property {boolean} [pixelArt=false] - Sets `antialias` and `roundPixels` to true. This is the best setting for pixel-art games. * @property {boolean} [autoResize=true] - Automatically resize the Game Canvas if you resize the renderer. - * @property {boolean} [roundPixels=false] - [description] - * @property {boolean} [transparent=false] - [description] - * @property {boolean} [clearBeforeRender=true] - [description] - * @property {boolean} [premultipliedAlpha=true] - [description] - * @property {boolean} [preserveDrawingBuffer=false] - [description] - * @property {boolean} [failIfMajorPerformanceCaveat=false] - [description] - * @property {string} [powerPreference='default'] - "high-performance", "low-power" or "default" + * @property {boolean} [roundPixels=false] - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. + * @property {boolean} [transparent=false] - Whether the game canvas will be transparent. + * @property {boolean} [clearBeforeRender=true] - Whether the game canvas will be cleared between each rendering frame. + * @property {boolean} [premultipliedAlpha=true] - In WebGL mode, the drawing buffer contains colors with pre-multiplied alpha. + * @property {boolean} [preserveDrawingBuffer=false] - In WebGL mode, the drawing buffer won't be cleared automatically each frame. + * @property {boolean} [failIfMajorPerformanceCaveat=false] - Let the browser abort creating a WebGL context if it judges performance would be unacceptable. + * @property {string} [powerPreference='default'] - "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. * @property {integer} [batchSize=2000] - The default WebGL batch size. */ @@ -137369,8 +137978,8 @@ var ValueToColor = __webpack_require__(178); * @property {(integer|string)} [height=768] - The base height of your game. * @property {integer} [zoom=1] - The zoom value of the game canvas. * @property {number} [resolution=1] - The rendering resolution of the canvas. - * @property {any} [parent] - The parent DOM element. - * @property {integer} [mode=0] - The scale mode to apply to the canvas. + * @property {(HTMLElement|string)} [parent] - The DOM element that will contain the game canvas, or its `id`. If null (the default) or if the named element doesn't exist, the game canvas is inserted directly into the document body. + * @property {integer} [mode=0] - The scale mode to apply to the canvas. SHOW_ALL, EXACT_FIT, USER_SCALE, or RESIZE. * @property {integer} [minWidth] - The minimum width the canvas can be scaled down to. * @property {integer} [minHeight] - The minimum height the canvas can be scaled down to. * @property {integer} [maxWidth] - The maximum width the canvas can be scaled up to. @@ -137380,22 +137989,22 @@ var ValueToColor = __webpack_require__(178); /** * @typedef {object} CallbacksConfig * - * @property {BootCallback} [preBoot=NOOP] - [description] - * @property {BootCallback} [postBoot=NOOP] - [description] + * @property {BootCallback} [preBoot=NOOP] - A function to run at the start of the boot sequence. + * @property {BootCallback} [postBoot=NOOP] - A function to run at the end of the boot sequence. At this point, all the game systems have started and plugins have been loaded. */ /** * @typedef {object} LoaderConfig * - * @property {string} [baseURL] - [description] - * @property {string} [path] - [description] - * @property {integer} [maxParallelDownloads=32] - [description] - * @property {(string|undefined)} [crossOrigin=undefined] - [description] - * @property {string} [responseType] - [description] - * @property {boolean} [async=true] - [description] - * @property {string} [user] - [description] - * @property {string} [password] - [description] - * @property {integer} [timeout=0] - [description] + * @property {string} [baseURL] - An URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. + * @property {string} [path] - An URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. + * @property {integer} [maxParallelDownloads=32] - The maximum number of resources the loader will start loading at once. + * @property {(string|undefined)} [crossOrigin=undefined] - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. + * @property {string} [responseType] - The response type of the XHR request, e.g. `blob`, `text`, etc. + * @property {boolean} [async=true] - Should the XHR request use async or not? + * @property {string} [user] - Optional username for the XHR request. + * @property {string} [password] - Optional password for the XHR request. + * @property {integer} [timeout=0] - Optional XHR timeout value, in ms. */ /** @@ -137408,65 +138017,81 @@ var ValueToColor = __webpack_require__(178); /** * @typedef {object} ImagesConfig * - * @property {string} [default] - [description] - * @property {string} [missing] - [description] + * @property {string} [default] - URL to use for the 'default' texture. + * @property {string} [missing] - URL to use for the 'missing' texture. */ +/** + * @typedef {object} PhysicsConfig + * + * @property {string} [default] - The default physics system. It will be started for each scene. Phaser provides 'arcade', 'impact', and 'matter'. + * @property {ArcadeWorldConfig} [arcade] - Arcade Physics configuration. + * @property {Phaser.Physics.Impact.WorldConfig} [impact] - Impact Physics configuration. + * @property {object} [matter] - Matter Physics configuration. + */ + /** * @typedef {object} PluginObjectItem * - * @property {string} [key] - [description] - * @property {*} [plugin] - [description] - * @property {boolean} [start] - [description] - * @property {string} [systemKey] - [description] - * @property {string} [sceneKey] - [description] - * @property {*} [data] - [description] + * @property {string} [key] - A key to identify the plugin in the Plugin Manager. + * @property {*} [plugin] - The plugin itself. Usually a class/constructor. + * @property {boolean} [start] - Whether the plugin should be started automatically. + * @property {string} [systemKey] - For a scene plugin, add the plugin to the scene's systems object under this key (`this.sys.KEY`, from the scene). + * @property {string} [sceneKey] - For a scene plugin, add the plugin to the scene object under this key (`this.KEY`, from the scene). + * @property {*} [data] - Arbitrary data passed to the plugin's init() method. + * + * @example + * // Global plugin + * { key: 'BankPlugin', plugin: BankPluginV3, start: true, data: { gold: 5000 } } + * @example + * // Scene plugin + * { key: 'WireFramePlugin', plugin: WireFramePlugin, systemKey: 'wireFramePlugin', sceneKey: 'wireframe' } */ /** * @typedef {object} PluginObject * - * @property {?PluginObjectItem[]} [global] - [description] - * @property {?PluginObjectItem[]} [scene] - [description] - * @property {string[]} [default] - [description] - * @property {*} [defaultMerge] - [description] + * @property {?PluginObjectItem[]} [global] - Global plugins to install. + * @property {?PluginObjectItem[]} [scene] - Scene plugins to install. + * @property {string[]} [default] - The default set of scene plugins (names). + * @property {string[]} [defaultMerge] - Plugins to *add* to the default set of scene plugins. */ /** * @typedef {object} GameConfig * - * @property {(integer|string)} [width=1024] - [description] - * @property {(integer|string)} [height=768] - [description] - * @property {number} [zoom=1] - [description] - * @property {number} [resolution=1] - [description] - * @property {number} [type=CONST.AUTO] - [description] - * @property {*} [parent=null] - [description] + * @property {(integer|string)} [width=1024] - The width of the game, in game pixels. + * @property {(integer|string)} [height=768] - The height of the game, in game pixels. + * @property {number} [zoom=1] - Simple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc. + * @property {number} [resolution=1] - The size of each game pixel, in canvas pixels. Values larger than 1 are "high" resolution. + * @property {number} [type=CONST.AUTO] - Which renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS. + * @property {(HTMLElement|string)} [parent=null] - The DOM element that will contain the game canvas, or its `id`. If null (the default) or if the named element doesn't exist, the game canvas is inserted directly into the document body. * @property {HTMLCanvasElement} [canvas=null] - Provide your own Canvas element for Phaser to use instead of creating one. - * @property {string} [canvasStyle=null] - [description] + * @property {string} [canvasStyle=null] - CSS styles to apply to the game canvas instead of Phaser's default styles. * @property {CanvasRenderingContext2D} [context] - Provide your own Canvas Context for Phaser to use, instead of creating one. - * @property {object} [scene=null] - [description] - * @property {string[]} [seed] - [description] - * @property {string} [title=''] - [description] - * @property {string} [url='http://phaser.io'] - [description] - * @property {string} [version=''] - [description] - * @property {boolean} [autoFocus=true] - Automatically call window.focus() when the game boots. - * @property {(boolean|InputConfig)} [input] - [description] - * @property {boolean} [disableContextMenu=false] - [description] - * @property {(boolean|BannerConfig)} [banner=false] - [description] + * @property {object} [scene=null] - A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have { active: true }. + * @property {string[]} [seed] - Seed for the random number generator. + * @property {string} [title=''] - The title of the game. Shown in the browser console. + * @property {string} [url='http://phaser.io'] - The URL of the game. Shown in the browser console. + * @property {string} [version=''] - The version of the game. Shown in the browser console. + * @property {boolean} [autoFocus=true] - Automatically call window.focus() when the game boots. Usually necessary to capture input events if the game is in a separate frame. + * @property {(boolean|InputConfig)} [input] - Input configuration, or `false` to disable all game input. + * @property {boolean} [disableContextMenu=false] - Disable the browser's default 'contextmenu' event (usually triggered by a right-button mouse click). + * @property {(boolean|BannerConfig)} [banner=false] - Configuration for the banner printed in the browser console when the game starts. * @property {DOMContainerConfig} [dom] - The DOM Container configuration object. - * @property {FPSConfig} [fps] - [description] - * @property {RenderConfig} [render] - [description] - * @property {(string|number)} [backgroundColor=0x000000] - [description] - * @property {CallbacksConfig} [callbacks] - [description] - * @property {LoaderConfig} [loader] - [description] - * @property {ImagesConfig} [images] - [description] - * @property {object} [physics] - [description] - * @property {PluginObject|PluginObjectItem[]} [plugins] - [description] + * @property {FPSConfig} [fps] - Game loop configuration. + * @property {RenderConfig} [render] - Game renderer configuration. + * @property {(string|number)} [backgroundColor=0x000000] - The background color of the game canvas. The default is black. + * @property {CallbacksConfig} [callbacks] - Optional callbacks to run before or after game boot. + * @property {LoaderConfig} [loader] - Loader configuration. + * @property {ImagesConfig} [images] - Images configuration. + * @property {object} [physics] - Physics configuration. + * @property {PluginObject|PluginObjectItem[]} [plugins] - Plugins to install. */ /** * @classdesc - * [description] + * The active game configuration settings, parsed from a {@link GameConfig} object. * * @class Config * @memberOf Phaser.Boot @@ -137474,6 +138099,8 @@ var ValueToColor = __webpack_require__(178); * @since 3.0.0 * * @param {GameConfig} [GameConfig] - The configuration object for your Phaser Game instance. + * + * @see Phaser.Game#config */ var Config = new Class({ @@ -137540,7 +138167,7 @@ var Config = new Class({ } /** - * @const {number} Phaser.Boot.Config#renderType - [description] + * @const {number} Phaser.Boot.Config#renderType - Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) */ this.renderType = GetValue(config, 'type', CONST.AUTO); @@ -137572,17 +138199,17 @@ var Config = new Class({ MATH.RND.init(this.seed); /** - * @const {string} Phaser.Boot.Config#gameTitle - [description] + * @const {string} Phaser.Boot.Config#gameTitle - The title of the game. */ this.gameTitle = GetValue(config, 'title', ''); /** - * @const {string} Phaser.Boot.Config#gameURL - [description] + * @const {string} Phaser.Boot.Config#gameURL - The URL of the game. */ this.gameURL = GetValue(config, 'url', 'https://phaser.io'); /** - * @const {string} Phaser.Boot.Config#gameVersion - [description] + * @const {string} Phaser.Boot.Config#gameVersion - The version of the game. */ this.gameVersion = GetValue(config, 'version', ''); @@ -137661,7 +138288,7 @@ var Config = new Class({ this.inputGamepadEventTarget = GetValue(config, 'input.gamepad.target', window); /** - * @const {boolean} Phaser.Boot.Config#disableContextMenu - [description] + * @const {boolean} Phaser.Boot.Config#disableContextMenu - Set to `true` to disable context menu. Default value is `false`. */ this.disableContextMenu = GetValue(config, 'disableContextMenu', false); @@ -137731,7 +138358,7 @@ var Config = new Class({ this.roundPixels = GetValue(renderConfig, 'roundPixels', false); /** - * @const {boolean} Phaser.Boot.Config#pixelArt - [description] + * @const {boolean} Phaser.Boot.Config#pixelArt - Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode). */ this.pixelArt = GetValue(renderConfig, 'pixelArt', false); @@ -137831,7 +138458,7 @@ var Config = new Class({ this.loaderPath = GetValue(config, 'loader.path', ''); /** - * @const {integer} Phaser.Boot.Config#loaderMaxParallelDownloads - [description] + * @const {integer} Phaser.Boot.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). */ this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', 32); @@ -137879,9 +138506,9 @@ var Config = new Class({ * { key: 'WireFramePlugin', plugin: WireFramePlugin, systemKey: 'wireFramePlugin', sceneKey: 'wireframe' } * ], * default: [], OR - * defaultMerge: { + * defaultMerge: [ * 'ModPlayer' - * } + * ] * } */ @@ -139668,20 +140295,20 @@ module.exports = GetOffsetX; module.exports = { CenterOn: __webpack_require__(412), - GetBottom: __webpack_require__(47), + GetBottom: __webpack_require__(48), GetCenterX: __webpack_require__(75), GetCenterY: __webpack_require__(72), - GetLeft: __webpack_require__(45), + GetLeft: __webpack_require__(46), GetOffsetX: __webpack_require__(919), GetOffsetY: __webpack_require__(918), - GetRight: __webpack_require__(43), - GetTop: __webpack_require__(41), - SetBottom: __webpack_require__(46), + GetRight: __webpack_require__(44), + GetTop: __webpack_require__(42), + SetBottom: __webpack_require__(47), SetCenterX: __webpack_require__(74), SetCenterY: __webpack_require__(73), - SetLeft: __webpack_require__(44), - SetRight: __webpack_require__(42), - SetTop: __webpack_require__(40) + SetLeft: __webpack_require__(45), + SetRight: __webpack_require__(43), + SetTop: __webpack_require__(41) }; @@ -139696,10 +140323,10 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetRight = __webpack_require__(43); -var GetTop = __webpack_require__(41); -var SetBottom = __webpack_require__(46); -var SetRight = __webpack_require__(42); +var GetRight = __webpack_require__(44); +var GetTop = __webpack_require__(42); +var SetBottom = __webpack_require__(47); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned next to the top right position of the other. @@ -139740,10 +140367,10 @@ module.exports = TopRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetLeft = __webpack_require__(45); -var GetTop = __webpack_require__(41); -var SetBottom = __webpack_require__(46); -var SetLeft = __webpack_require__(44); +var GetLeft = __webpack_require__(46); +var GetTop = __webpack_require__(42); +var SetBottom = __webpack_require__(47); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the top left position of the other. @@ -139785,8 +140412,8 @@ module.exports = TopLeft; */ var GetCenterX = __webpack_require__(75); -var GetTop = __webpack_require__(41); -var SetBottom = __webpack_require__(46); +var GetTop = __webpack_require__(42); +var SetBottom = __webpack_require__(47); var SetCenterX = __webpack_require__(74); /** @@ -139828,10 +140455,10 @@ module.exports = TopCenter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetRight = __webpack_require__(43); -var GetTop = __webpack_require__(41); -var SetLeft = __webpack_require__(44); -var SetTop = __webpack_require__(40); +var GetRight = __webpack_require__(44); +var GetTop = __webpack_require__(42); +var SetLeft = __webpack_require__(45); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the right top position of the other. @@ -139873,9 +140500,9 @@ module.exports = RightTop; */ var GetCenterY = __webpack_require__(72); -var GetRight = __webpack_require__(43); +var GetRight = __webpack_require__(44); var SetCenterY = __webpack_require__(73); -var SetLeft = __webpack_require__(44); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the right center position of the other. @@ -139916,10 +140543,10 @@ module.exports = RightCenter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetRight = __webpack_require__(43); -var SetBottom = __webpack_require__(46); -var SetLeft = __webpack_require__(44); +var GetBottom = __webpack_require__(48); +var GetRight = __webpack_require__(44); +var SetBottom = __webpack_require__(47); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other. @@ -139960,10 +140587,10 @@ module.exports = RightBottom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetLeft = __webpack_require__(45); -var GetTop = __webpack_require__(41); -var SetRight = __webpack_require__(42); -var SetTop = __webpack_require__(40); +var GetLeft = __webpack_require__(46); +var GetTop = __webpack_require__(42); +var SetRight = __webpack_require__(43); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the left top position of the other. @@ -140005,9 +140632,9 @@ module.exports = LeftTop; */ var GetCenterY = __webpack_require__(72); -var GetLeft = __webpack_require__(45); +var GetLeft = __webpack_require__(46); var SetCenterY = __webpack_require__(73); -var SetRight = __webpack_require__(42); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned next to the left center position of the other. @@ -140048,10 +140675,10 @@ module.exports = LeftCenter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetLeft = __webpack_require__(45); -var SetBottom = __webpack_require__(46); -var SetRight = __webpack_require__(42); +var GetBottom = __webpack_require__(48); +var GetLeft = __webpack_require__(46); +var SetBottom = __webpack_require__(47); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other. @@ -140092,10 +140719,10 @@ module.exports = LeftBottom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetRight = __webpack_require__(43); -var SetRight = __webpack_require__(42); -var SetTop = __webpack_require__(40); +var GetBottom = __webpack_require__(48); +var GetRight = __webpack_require__(44); +var SetRight = __webpack_require__(43); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other. @@ -140136,10 +140763,10 @@ module.exports = BottomRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetLeft = __webpack_require__(45); -var SetLeft = __webpack_require__(44); -var SetTop = __webpack_require__(40); +var GetBottom = __webpack_require__(48); +var GetLeft = __webpack_require__(46); +var SetLeft = __webpack_require__(45); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other. @@ -140180,10 +140807,10 @@ module.exports = BottomLeft; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); +var GetBottom = __webpack_require__(48); var GetCenterX = __webpack_require__(75); var SetCenterX = __webpack_require__(74); -var SetTop = __webpack_require__(40); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other. @@ -141183,9 +141810,9 @@ var Path = new Class({ * @method Phaser.Curves.Path#getPoints * @since 3.0.0 * - * @param {integer} [divisions=12] - [description] + * @param {integer} [divisions=12] - The number of points to divide the path in to. * - * @return {Phaser.Math.Vector2[]} [description] + * @return {Phaser.Math.Vector2[]} An array of Vector2 objects that containing the points along the Path. */ getPoints: function (divisions) { @@ -141239,7 +141866,7 @@ var Path = new Class({ * * @generic {Phaser.Math.Vector2} O - [out,$return] * - * @param {Phaser.Math.Vector2} [out] - [description] + * @param {Phaser.Math.Vector2} [out] - `Vector2` instance that should be used for storing the result. If `undefined` a new `Vector2` will be created. * * @return {Phaser.Math.Vector2} [description] */ @@ -141712,7 +142339,7 @@ var Camera = __webpack_require__(379); var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); var PluginCache = __webpack_require__(15); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); /** * @typedef {object} InputJSONCameraObject @@ -146318,7 +146945,7 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * Wrap each item's coordinates within a rectangle's area. @@ -146367,7 +146994,8 @@ module.exports = WrapInRectangle; */ /** - * [description] + * Takes an array of Game Objects and toggles the visibility of each one. + * Those previously `visible = false` will become `visible = true`, and vice versa. * * @function Phaser.Actions.ToggleVisible * @since 3.0.0 @@ -146402,7 +147030,16 @@ module.exports = ToggleVisible; */ /** - * [description] + * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, the + * calculated spread value. + * + * The spread value is derived from the given `min` and `max` values and the total number of items in the array.//#endregion + * + * For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call: + * + * ```javascript + * Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1); + * ``` * * @function Phaser.Actions.Spread * @since 3.0.0 @@ -146410,12 +147047,12 @@ module.exports = ToggleVisible; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {string} property - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} [inc=false] - [description] + * @param {string} property - The property of the Game Object to spread. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) * - * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that were passed to this Action. */ var Spread = function (items, property, min, max, inc) { @@ -146458,7 +147095,9 @@ module.exports = Spread; var MathSmoothStep = __webpack_require__(181); /** - * [description] + * Smoothstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. * * @function Phaser.Actions.SmoothStep * @since 3.0.0 @@ -146466,10 +147105,10 @@ var MathSmoothStep = __webpack_require__(181); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {string} property - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} inc - [description] + * @param {string} property - The property of the Game Object to interpolate. + * @param {number} min - The minimum interpolation value. + * @param {number} max - The maximum interpolation value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -146514,7 +147153,9 @@ module.exports = SmoothStep; var MathSmootherStep = __webpack_require__(182); /** - * [description] + * Smootherstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. * * @function Phaser.Actions.SmootherStep * @since 3.0.0 @@ -146522,10 +147163,10 @@ var MathSmootherStep = __webpack_require__(182); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {string} property - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} inc - [description] + * @param {string} property - The property of the Game Object to interpolate. + * @param {number} min - The minimum interpolation value. + * @param {number} max - The maximum interpolation value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -146603,9 +147244,11 @@ module.exports = Shuffle; var Vector2 = __webpack_require__(3); /** - * Iterate through items changing the position of each element to - * be that of the element that came before it in the array (or after it if direction = 1) + * Iterate through the items array changing the position of each element to be that of the element that came before + * it in the array (or after it if direction = 1) + * * The first items position is set to x/y. + * * The final x/y coords are returned * * @function Phaser.Actions.ShiftPosition @@ -146615,10 +147258,10 @@ var Vector2 = __webpack_require__(3); * @generic {Phaser.Math.Vector2} O - [output,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {number} x - [description] - * @param {number} y - [description] - * @param {integer} [direction=0] - [description] - * @param {(Phaser.Math.Vector2|object)} [output] - [description] + * @param {number} x - The x coordinate to place the first item in the array at. + * @param {number} y - The y coordinate to place the first item in the array at. + * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {(Phaser.Math.Vector2|object)} [output] - An optional objec to store the final objects position in. * * @return {Phaser.Math.Vector2} The output vector. */ @@ -146896,7 +147539,7 @@ module.exports = SetVisible; */ /** - * [description] + * Takes an array of Game Objects, or any objects that have the public method setTint() and then updates it to the given value(s). You can specify tint color per corner or provide only one color value for `topLeft` parameter, in which case whole item will be tinted with that color. * * @function Phaser.Actions.SetTint * @since 3.0.0 @@ -146904,10 +147547,10 @@ module.exports = SetVisible; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {number} topLeft - [description] - * @param {number} [topRight] - [description] - * @param {number} [bottomLeft] - [description] - * @param {number} [bottomRight] - [description] + * @param {number} topLeft - The tint being applied to top-left corner of item. If other parameters are given no value, this tint will be applied to whole item. + * @param {number} [topRight] - The tint to be applied to top-right corner of item. + * @param {number} [bottomLeft] - The tint to be applied to the bottom-left corner of item. + * @param {number} [bottomRight] - The tint to be applied to the bottom-right corner of item. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147152,7 +147795,9 @@ module.exports = SetOrigin; */ /** - * [description] + * Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks. + * + * @see {@link Phaser.GameObjects.GameObject#setInteractive} * * @function Phaser.Actions.SetHitArea * @since 3.0.0 @@ -147160,8 +147805,8 @@ module.exports = SetOrigin; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {*} hitArea - [description] - * @param {HitAreaCallback} hitAreaCallback - [description] + * @param {*} hitArea - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {HitAreaCallback} hitAreaCallback - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147442,7 +148087,7 @@ module.exports = ScaleX; var MathRotateAroundDistance = __webpack_require__(183); /** - * [description] + * Rotates an array of Game Objects around a point by the given angle and distance. * * @function Phaser.Actions.RotateAroundDistance * @since 3.0.0 @@ -147489,7 +148134,7 @@ module.exports = RotateAroundDistance; */ var RotateAroundDistance = __webpack_require__(183); -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); /** * Rotates each item around the given point by the given angle. @@ -147578,7 +148223,9 @@ module.exports = Rotate; var Random = __webpack_require__(184); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomTriangle * @since 3.0.0 @@ -147586,7 +148233,7 @@ var Random = __webpack_require__(184); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Triangle} triangle - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147616,7 +148263,7 @@ module.exports = RandomTriangle; var Random = __webpack_require__(187); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Ellipse. * * @function Phaser.Actions.RandomRectangle * @since 3.0.0 @@ -147624,7 +148271,7 @@ var Random = __webpack_require__(187); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147654,7 +148301,9 @@ module.exports = RandomRectangle; var Random = __webpack_require__(188); /** - * [description] + * Takes an array of Game Objects and positions them at random locations on the Line. + * + * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomLine * @since 3.0.0 @@ -147662,7 +148311,7 @@ var Random = __webpack_require__(188); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Line} line - The Line to position the Game Objects randomly on. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147692,7 +148341,9 @@ module.exports = RandomLine; var Random = __webpack_require__(185); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomEllipse * @since 3.0.0 @@ -147700,7 +148351,7 @@ var Random = __webpack_require__(185); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Ellipse} ellipse - [description] + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147730,7 +148381,9 @@ module.exports = RandomEllipse; var Random = __webpack_require__(191); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomCircle * @since 3.0.0 @@ -147738,7 +148391,7 @@ var Random = __webpack_require__(191); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Circle} circle - [description] + * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147802,11 +148455,12 @@ module.exports = PlayAnimation; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// var GetPointsOnLine = require('../geom/line/GetPointsOnLine'); var BresenhamPoints = __webpack_require__(386); /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.PlaceOnTriangle * @since 3.0.0 @@ -147814,8 +148468,8 @@ var BresenhamPoints = __webpack_require__(386); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {number} [stepRate=1] - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects on. + * @param {number} [stepRate=1] - An optional step rate, to increase or decrease the packing of the Game Objects on the lines. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147866,14 +148520,11 @@ var MarchingAnts = __webpack_require__(389); var RotateLeft = __webpack_require__(388); var RotateRight = __webpack_require__(387); -// Place the items in the array around the perimeter of the given rectangle. - -// Placement starts from the top-left of the rectangle, and proceeds in a -// clockwise direction. If the shift parameter is given you can offset where -// placement begins. - /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. + * + * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. + * If the `shift` parameter is given you can offset where placement begins. * * @function Phaser.Actions.PlaceOnRectangle * @since 3.0.0 @@ -147881,8 +148532,8 @@ var RotateRight = __webpack_require__(387); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {integer} [shift=1] - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects on. + * @param {integer} [shift=1] - An optional positional offset. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147926,7 +148577,7 @@ module.exports = PlaceOnRectangle; var GetPoints = __webpack_require__(189); /** - * [description] + * Positions an array of Game Objects on evenly spaced points of a Line. * * @function Phaser.Actions.PlaceOnLine * @since 3.0.0 @@ -147934,7 +148585,7 @@ var GetPoints = __webpack_require__(189); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Line} line - The Line to position the Game Objects on. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -147968,7 +148619,9 @@ module.exports = PlaceOnLine; */ /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of an Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.PlaceOnEllipse * @since 3.0.0 @@ -147976,9 +148629,9 @@ module.exports = PlaceOnLine; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Ellipse} ellipse - [description] - * @param {number} [startAngle=0] - [description] - * @param {number} [endAngle=6.28] - [description] + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects on. + * @param {number} [startAngle=0] - Optional angle to start position from, in radians. + * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -148018,7 +148671,9 @@ module.exports = PlaceOnEllipse; */ /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.PlaceOnCircle * @since 3.0.0 @@ -148026,9 +148681,9 @@ module.exports = PlaceOnEllipse; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Circle} circle - [description] - * @param {number} [startAngle=0] - [description] - * @param {number} [endAngle=6.28] - [description] + * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects on. + * @param {number} [startAngle=0] - Optional angle to start position from, in radians. + * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -149098,7 +149753,7 @@ module.exports = Size; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var ScaleModes = __webpack_require__(93); +var ScaleModes = __webpack_require__(94); /** * Provides methods used for getting and setting the scale of a Game Object. @@ -150319,7 +150974,7 @@ module.exports = GetFirst; /** * @callback CallCallback * - * @param {Phaser.GameObjects.GameObject} item - [description] + * @param {Phaser.GameObjects.GameObject} item - The Game Object to run the callback on. */ /** diff --git a/dist/phaser-arcade-physics.min.js b/dist/phaser-arcade-physics.min.js index 057c428eb..d5e5a9c6f 100644 --- a/dist/phaser-arcade-physics.min.js +++ b/dist/phaser-arcade-physics.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1077)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,e,s,r){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,t.exports=n},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;no.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c0&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit("destroy",this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});a.RENDER_MASK=15,t.exports=a},function(t,e,i){var n=i(8),s=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit("filecomplete",e,i,t),this.loader.emit("filecomplete-"+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){t.exports=function(t,e,i,n,s){var r=n.alpha*i.alpha;if(r<=0)return!1;var o=t._tempMatrix1.copyFromArray(n.matrix.matrix),a=t._tempMatrix2.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),h=t._tempMatrix3;return s?(o.multiplyWithOffset(s,-n.scrollX*i.scrollFactorX,-n.scrollY*i.scrollFactorY),a.e=i.x,a.f=i.y,o.multiply(a,h)):(a.e-=n.scrollX*i.scrollFactorX,a.f-=n.scrollY*i.scrollFactorY,o.multiply(a,h)),e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=r,e.save(),h.setToContext(e),!0}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n,s,r,o=i(26),a=i(175),h=[],l=!1;t.exports={create2D:function(t,e,i){return n(t,e,i,o.CANVAS)},create:n=function(t,e,i,n,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=o.CANVAS),void 0===r&&(r=!1);var c=s(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&n===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return n(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n={VERSION:"3.13.0",BlendModes:i(66),ScaleModes:i(93),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(54),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e,i){var n=i(66),s=i(12),r=i(93);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),e.blendMode=s(i,"blendMode",n.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e){t.exports=function(t,e,i){var n=i||e.fillColor,s=e.fillAlpha,r=(16711680&n)>>>16,o=(65280&n)>>>8,a=255&n;t.fillStyle="rgba("+r+","+o+","+a+","+s+")"}},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},,function(t,e,i){var n=i(102),s=i(17);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;d>>16,r=(65280&i)>>>8,o=255&i;t.strokeStyle="rgba("+s+","+r+","+o+","+n+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),s=i(177),r=i(377),o=i(176),a=i(376),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(4),l=i(8),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;sthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=h},function(t,e,i){var n=i(0),s=i(14),r=i(266),o=new n({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=null,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return this.getLeft(t)+this.width/2},getCenterY:function(t){return this.getTop(t)+this.height/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight-(this.height-this.baseHeight),this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.tilemapLayer;return t?t.tileset:null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.loader=t,this.type=e,this.key=i,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={};for(var s=0;s=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;ps||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,a,h,l,u,f,g,v=e&&e.length,m=v?e[0]*i:t.length,y=s(t,0,m,i,!0),x=[];if(!y)return x;if(v&&(y=function(t,e,i,n){var o,a,h,l,u,f=[];for(o=0,a=e.length;o80*i){n=h=t[0],a=l=t[1];for(var w=i;wh&&(h=u),f>l&&(l=f);g=Math.max(h-n,l-a)}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===A(t,e,i,n)>0)for(r=e;r=e;r-=n)o=b(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(_(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(_(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),_(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&w(s,r)&&w(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),_(n),_(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=T(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&w(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=T(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&w(t,e)&&w(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function w(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function T(t,e){var i=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function b(t,e,i,n){var s=new S(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function _(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function S(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={SKIP_CHECK:-1,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}},,function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(0),s=i(172),r=i(9),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){var n=i(0),s=i(39),r=i(406),o=i(404),a=i(191),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation","orthogonal"),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[])}});t.exports=r},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",{}),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null)}});t.exports=r},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i=t.length)){for(var i=t.length-1,n=t[e],s=e;s-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return this.entries.length=t}}});t.exports=n},function(t,e,i){var n=i(63);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e,i){var n=i(128),s=i(12),r=i(83),o=i(85),a=i(98),h=i(206),l=i(130),u=i(4),c=i(129),d=i(127),f=i(126);t.exports=function(t,e,i){void 0===i&&(i=n);for(var p=i.targets?i.targets:l(e),g=h(e),v=a(e,"delay",i.delay),m=a(e,"duration",i.duration),y=u(e,"easeParams",i.easeParams),x=o(u(e,"ease",i.ease),y),w=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),b=a(e,"repeatDelay",i.repeatDelay),_=r(e,"yoyo",i.yoyo),S=r(e,"flipX",i.flipX),A=r(e,"flipY",i.flipY),C=[],M=0;M=this.firstgid&&t=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(730),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,o],initialize:function(t,e,i,n,s,o,a,h,l){if(r.call(this,t,"Mesh"),n.length!==s.length)throw new Error("Mesh Vertex count must match UV count");var u,c=n.length/2|0;if(o.length>0&&o.length0&&a.lengthl&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(0),s=i(23),r=i(20),o=new n({initialize:function(t,e,i,n,s,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,d)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),m=r=s(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,w=e+n,T=i+r;if(!(x.rw||x.y>T)){var b=Math.max(x.x,e),_=Math.max(x.y,i),S=Math.min(x.r,w)-b,A=Math.min(x.b,T)-_;v=S,m=A,p=o?h+(u-(b-x.x)-S):h+(b-x.x),g=a?l+(c-(_-x.y)-A):l+(_-x.y),e=b,i=_,n=S,r=A}else p=0,g=0,v=0,m=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var C=this.source.width,M=this.source.height;return t.u0=Math.max(0,p/C),t.v0=Math.max(0,g/M),t.u1=Math.min(1,(p+v)/C),t.v1=Math.min(1,(g+m)/M),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){var n=i(0),s=i(11),r=i(20),o=i(1),a=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=r(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=r(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=r(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=r(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit("destroy",this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=a},function(t,e,i){var n=i(0),s=i(63),r=i(11),o=i(1),a=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on("blur",function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on("focus",function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on("prestep",this.update,this),t.events.once("destroy",this.destroy,this)},add:o,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once("ended",i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once("ended",n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("pauseall",this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit("resumeall",this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit("stopall",this)},unlock:o,onBlur:o,onFocus:o,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("rate",this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("detune",this,t)}}});t.exports=a},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){var n,s=i(91),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){var n=i(0),s=i(14),r=i(31),o=i(11),a=i(9),h=i(53),l=i(178),u=i(3),c=new n({Extends:o,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.config,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new a,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new a,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new h,this.transparent=!0,this.backgroundColor=l("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new u(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new u);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOn:function(t,e){var i=.5*this.width,n=.5*this.height;return this.midPoint.set(t,e),this.scrollX=t-i,this.scrollY=e-n,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;g-m&&b>-y&&T-m&&S>-y&&_s&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=l(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.config=t.sys.game.config,this.sceneManager=t.sys.game.scene;var e=this.config.resolution;return this.resolution=e,this._cx=this._x*e,this._cy=this._y*e,this._cw=this._width*e,this._ch=this._height*e,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.config){var t=0!==this._x||0!==this._y||this.config.width!==this._width||this.config.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit("cameradestroy",this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.config=null,this.sceneManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=c},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){if(this.state!==o.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this},play:function(t){if(this.state!==o.ACTIVE){this.state!==o.PENDING_REMOVE&&this.state!==o.REMOVED||(this.init(),this.parent.makeActive(this),t=!0);var e=this.callbacks.onStart;this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this))}},resetTweenData:function(t){for(var e=this.data,i=0;i0?(n.elapsed=n.delay,n.state=o.DELAY):n.state=o.PENDING_RENDER}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&ns.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},stop:function(t){this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parent._destroy.push(this),this.parent._toProcess++),this.state=o.PENDING_REMOVE)},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e){function i(t){return!!t.getStart&&"function"==typeof t.getStart}function n(t){return!!t.getEnd&&"function"==typeof t.getEnd}var s=function(t,e){var r,o,a=function(t,e,i){return i},h=function(t,e,i){return i},l=typeof e;if("number"===l)a=function(){return e};else if("string"===l){var u=e[0],c=parseFloat(e.substr(2));switch(u){case"+":a=function(t,e,i){return i+c};break;case"-":a=function(t,e,i){return i-c};break;case"*":a=function(t,e,i){return i*c};break;case"/":a=function(t,e,i){return i/c};break;default:a=function(){return parseFloat(e)}}}else"function"===l?a=e:"object"===l&&(i(o=e)||n(o))?(n(e)&&(a=e.getEnd),i(e)&&(h=e.getStart)):e.hasOwnProperty("value")&&(r=s(t,e.value));return r||(r={getEnd:a,getStart:h}),r};t.exports=s},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"targets",null);return null===e?e:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(29),s=i(76),r=i(218),o=i(210);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",n.ARRAY_2D,u,i,a,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new s({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){var n=i(29),s=i(77),r=i(76),o=i(55);t.exports=function(t,e,i,a,h){for(var l=new s({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],m=s[12],y=s[13],x=s[14],w=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+m)*w,this.y=(e*o+i*u+n*p+y)*w,this.z=(e*a+i*c+n*g+x)*w,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=i(344),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n=0&&r>=0&&s+r<1&&(n.push({x:e[T].x,y:e[T].y}),i)));T++);return n}},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.righte.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),s=i(108),r=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,1,1,1,0],[16777215,16777215,16777215,16777215,16777215,16777215],[1,1,1,1,1,1],n,r),this.resetPosition()},setFrame:function(t){return this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,t=this.frame,this.uv[0]=t.u0,this.uv[1]=t.v0,this.uv[2]=t.u0,this.uv[3]=t.v1,this.uv[4]=t.u1,this.uv[5]=t.v1,this.uv[6]=t.u0,this.uv[7]=t.v0,this.uv[8]=t.u1,this.uv[9]=t.v1,this.uv[10]=t.u1,this.uv[11]=t.v0,this},topLeftX:{get:function(){return this.x+this.vertices[0]},set:function(t){this.vertices[0]=t-this.x,this.vertices[6]=t-this.x}},topLeftY:{get:function(){return this.y+this.vertices[1]},set:function(t){this.vertices[1]=t-this.y,this.vertices[7]=t-this.y}},topRightX:{get:function(){return this.x+this.vertices[10]},set:function(t){this.vertices[10]=t-this.x}},topRightY:{get:function(){return this.y+this.vertices[11]},set:function(t){this.vertices[11]=t-this.y}},bottomLeftX:{get:function(){return this.x+this.vertices[2]},set:function(t){this.vertices[2]=t-this.x}},bottomLeftY:{get:function(){return this.y+this.vertices[3]},set:function(t){this.vertices[3]=t-this.y}},bottomRightX:{get:function(){return this.x+this.vertices[4]},set:function(t){this.vertices[4]=t-this.x,this.vertices[8]=t-this.x}},bottomRightY:{get:function(){return this.y+this.vertices[5]},set:function(t){this.vertices[5]=t-this.y,this.vertices[9]=t-this.y}},topLeftAlpha:{get:function(){return this.alphas[0]},set:function(t){this.alphas[0]=t,this.alphas[3]=t}},topRightAlpha:{get:function(){return this.alphas[5]},set:function(t){this.alphas[5]=t}},bottomLeftAlpha:{get:function(){return this.alphas[1]},set:function(t){this.alphas[1]=t}},bottomRightAlpha:{get:function(){return this.alphas[2]},set:function(t){this.alphas[2]=t,this.alphas[4]=t}},topLeftColor:{get:function(){return this.colors[0]},set:function(t){this.colors[0]=t,this.colors[3]=t}},topRightColor:{get:function(){return this.colors[5]},set:function(t){this.colors[5]=t}},bottomLeftColor:{get:function(){return this.colors[1]},set:function(t){this.colors[1]=t}},bottomRightColor:{get:function(){return this.colors[2]},set:function(t){this.colors[2]=t,this.colors[4]=t}},setTopLeft:function(t,e){return this.topLeftX=t,this.topLeftY=e,this},setTopRight:function(t,e){return this.topRightX=t,this.topRightY=e,this},setBottomLeft:function(t,e){return this.bottomLeftX=t,this.bottomLeftY=e,this},setBottomRight:function(t,e){return this.bottomRightX=t,this.bottomRightY=e,this},resetPosition:function(){var t=this.x,e=this.y,i=Math.floor(this.width/2),n=Math.floor(this.height/2);return this.setTopLeft(t-i,e-n),this.setTopRight(t+i,e-n),this.setBottomLeft(t-i,e+n),this.setBottomRight(t+i,e+n),this},resetAlpha:function(){var t=this.alphas;return t[0]=1,t[1]=1,t[2]=1,t[3]=1,t[4]=1,t[5]=1,this},resetColors:function(){var t=this.colors;return t[0]=16777215,t[1]=16777215,t[2]=16777215,t[3]=16777215,t[4]=16777215,t[5]=16777215,this},reset:function(){return this.resetPosition(),this.resetAlpha(),this.resetColors()}});t.exports=r},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++sl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=y+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h0&&(a+=u.lineSpacing*p),i.rtl?o=d-o:"right"===i.align?o+=u.width-u.lineWidths[p]:"center"===i.align&&(o+=(u.width-u.lineWidths[p])/2),this.autoRound&&(o=Math.round(o),a=Math.round(a)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[p],o,a)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[p],o,a));return e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(120),s=i(24),r=i(0),o=i(14),a=i(26),h=i(113),l=i(19),u=i(816),c=i(296),d=new r({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,r,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===o&&(o=32),l.call(this,t,"RenderTexture"),this.renderer=t.sys.game.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=s.create2D(this,r,o),this.context=this.canvas.getContext("2d"),this.framebuffer=null,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(c(),this.canvas),this.frame=this.texture.get(),this._saved=!1,this.camera=new n(0,0,r,o),this.dirty=!1,this.gl=null;var h=this.renderer;if(h.type===a.WEBGL){var u=h.gl;this.gl=u,this.drawGameObject=this.batchGameObjectWebGL,this.framebuffer=h.createFramebuffer(r,o,this.frame.source.glTexture,!1)}else h.type===a.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas);this.camera.setScene(t),this.setPosition(e,i),this.setSize(r,o),this.setOrigin(0,0),this.initPipeline()},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas.width=t,this.canvas.height=e,this.gl){var i=this.gl;this.renderer.deleteTexture(this.frame.source.glTexture),this.renderer.deleteFramebuffer(this.framebuffer),this.frame.source.glTexture=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1),this.framebuffer=this.renderer.createFramebuffer(t,e,this.frame.source.glTexture,!1),this.frame.glTexture=this.frame.source.glTexture}this.frame.source.width=t,this.frame.source.height=e,this.camera.setSize(t,e),this.frame.setSize(t,e),this.width=t,this.height=e}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e){void 0===e&&(e=1);var i=255&(t>>16|0),n=255&(t>>8|0),s=255&(0|t);if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var r=this.gl;r.clearColor(i/255,n/255,s/255,e),r.clear(r.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else this.context.fillStyle="rgb("+i+","+n+","+s+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height);return this},clear:function(){if(this.dirty){if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.restore()}this.dirty=!1}return this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1,1),r){this.renderer.setFramebuffer(this.framebuffer);var o=this.pipeline;o.projOrtho(0,this.width,0,this.height,-1e3,1e3),this.batchList(t,e,i,n,s),o.flush(),this.renderer.setFramebuffer(null),o.projOrtho(0,o.width,o.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1,1),o){this.renderer.setFramebuffer(this.framebuffer);var h=this.pipeline;h.projOrtho(0,this.width,0,this.height,-1e3,1e3),h.batchTextureFrame(a,i,n,r,s,this.camera.matrix,null),h.flush(),this.renderer.setFramebuffer(null),h.projOrtho(0,h.width,h.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i,n,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;r0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),o.gl&&n&&(n.source[0].glTexture=o.canvasToTexture(s.canvas,n.source[0].glTexture))),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e,i){var n=i(109),s=i(0),r=i(833),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(163),s=i(66),r=i(0),o=i(14),a=i(19),h=i(9),l=i(836),u=i(310),c=i(3),d=new r({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.ScrollFactor,o.Transform,o.Visible,l],initialize:function(t,e,i,n){a.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new h),t.setTo(this.x,this.y,0,0),this.list.length>0)for(var e=this.list,i=new h,n=0;n-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=d},function(t,e,i){var n=i(840),s=i(837),r=i(0),o=i(14),a=i(113),h=i(19),l=i(112),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(t,e,i,n,s){h.call(this,t,"Blitter"),this.setTexture(n,s),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,r){void 0===n&&(n=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new s(this,t,e,i,n);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,n){for(var s=this.createMultiple(e,i,n),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit("start",this),this.events.emit("ready",this,t)},resize:function(t,e){this.events.emit("resize",t,e)},shutdown:function(t){this.events.off("transitioninit"),this.events.off("transitionstart"),this.events.off("transitioncomplete"),this.events.off("transitionout"),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit("destroy",this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,s=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return e.x=t.x+s*Math.cos(i)*t.width/2,e.y=t.y+s*Math.sin(i)*t.height/2,e}},function(t,e){var i={defaultPipeline:null,pipeline:null,initPipeline:function(t){void 0===t&&(t="TextureTintPipeline");var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return e&&e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t)),this},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=i},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),r=s>1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e){t.exports={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}},,,function(t,e,i){var n=i(0),s=i(64),r=i(2),o=i(893),a=i(892),h=i(891),l=i(53),u=i(10),c=i(198),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return this.renderer.setTexture2D(t,e),this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize,s=this.renderer;if(0!==e)return s.setBlankTexture(),t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.width,v=o.height,m=-t.displayOriginX+f,y=-t.displayOriginY+p;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||o.updateCropUVs(x,t.flipX,t.flipY),h=x.u0,l=x.v0,c=x.u1,d=x.v1,g=x.width,v=x.height,f=x.x,p=x.y,m=-t.displayOriginX+f,y=-t.displayOriginY+p}t.flipX&&(m+=g,g*=-1),t.flipY&&(y+=v,v*=-1);var w=m+g,T=y+v;s.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var b=r.getX(m,y),_=r.getY(m,y),S=r.getX(m,T),A=r.getY(m,T),C=r.getX(w,T),M=r.getY(w,T),E=r.getX(w,y),P=r.getY(w,y),L=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),F=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),k=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),R=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(b|=0,_|=0,S|=0,A|=0,C|=0,M|=0,E|=0,P|=0),this.setTexture2D(a,0);var O=t._isTinted&&t.tintFill;this.batchQuad(b,_,S,A,C,M,E,P,h,l,c,d,L,F,k,R,O)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v){var m=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),m=!0);var y=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.vertexComponentCount-1;return y[++w]=t,y[++w]=e,y[++w]=h,y[++w]=l,y[++w]=v,x[++w]=d,y[++w]=i,y[++w]=n,y[++w]=h,y[++w]=c,y[++w]=v,x[++w]=p,y[++w]=s,y[++w]=r,y[++w]=u,y[++w]=c,y[++w]=v,x[++w]=g,y[++w]=t,y[++w]=e,y[++w]=h,y[++w]=l,y[++w]=v,x[++w]=d,y[++w]=s,y[++w]=r,y[++w]=u,y[++w]=c,y[++w]=v,x[++w]=g,y[++w]=o,y[++w]=a,y[++w]=u,y[++w]=l,y[++w]=v,x[++w]=f,this.vertexCount+=6,m},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f){var p=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),p=!0);var g=this.vertexViewF32,v=this.vertexViewU32,m=this.vertexCount*this.vertexComponentCount-1;return g[++m]=t,g[++m]=e,g[++m]=o,g[++m]=a,g[++m]=f,v[++m]=u,g[++m]=i,g[++m]=n,g[++m]=o,g[++m]=l,g[++m]=f,v[++m]=c,g[++m]=s,g[++m]=r,g[++m]=h,g[++m]=l,g[++m]=f,v[++m]=d,this.vertexCount+=3,p},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,w,T,b,_,S,A,C,M,E,P){this.renderer.setPipeline(this,t);var L=this._tempMatrix1,F=this._tempMatrix2,k=this._tempMatrix3,R=m/i+C,O=y/n+M,D=(m+x)/i+C,I=(y+w)/n+M,B=o,Y=a,X=-g,z=-v;if(t.isCropped){var N=t._crop;B=N.width,Y=N.height,o=N.width,a=N.height;var U=m=N.x,G=y=N.y;c&&(U=x-N.x-N.width),d&&!e.isRenderTexture&&(G=w-N.y-N.height),R=U/i+C,O=G/n+M,D=(U+N.width)/i+C,I=(G+N.height)/n+M,X=-g+m,z=-v+y}d^=e.isRenderTexture?1:0,c&&(B*=-1,X+=o),d&&(Y*=-1,z+=a);var W=X+B,V=z+Y;F.applyITRS(s,r,u,h,l),L.copyFrom(E.matrix),P?(L.multiplyWithOffset(P,-E.scrollX*f,-E.scrollY*p),F.e=s,F.f=r,L.multiply(F,k)):(F.e-=E.scrollX*f,F.f-=E.scrollY*p,L.multiply(F,k));var H=k.getX(X,z),j=k.getY(X,z),q=k.getX(X,V),K=k.getY(X,V),J=k.getX(W,V),Z=k.getY(W,V),Q=k.getX(W,z),$=k.getY(W,z);E.roundPixels&&(H|=0,j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0),this.setTexture2D(e,0),this.batchQuad(H,j,q,K,J,Z,Q,$,R,O,D,I,T,b,_,S,A)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),m=h.getY(l,c),y=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,m,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n,h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,w=m.u1,T=m.v1;this.batchQuad(l,u,c,d,f,p,g,v,y,x,w,T,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(R,O,P,L,H[0],H[1],H[2],H[3],U,G,W,V,B,Y,X,z,I):(j[0]=R,j[1]=O,j[2]=P,j[3]=L,j[4]=1),h&&j[4]?this.batchQuad(M,E,F,k,j[0],j[1],j[2],j[3],U,G,W,V,B,Y,X,z,I):(H[0]=M,H[1]=E,H[2]=F,H[3]=k,H[4]=1)}}});t.exports=d},function(t,e,i){var n=i(0),s=i(894),r=i(196),o=new n({Extends:r,initialize:function(t){t.fragShader=s.replace("%LIGHT_COUNT%",10..toString()),r.call(this,t),this.defaultNormalMap},boot:function(){this.defaultNormalMap=this.game.textures.getFrame("__DEFAULT")},onBind:function(t){r.prototype.onBind.call(this);var e=this.renderer,i=this.program;return this.mvpUpdate(),e.setInt1(i,"uNormSampler",1),e.setFloat2(i,"uResolution",this.width,this.height),t&&this.setNormalMap(t),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,10);if(0===s)return this;this.active=!0;var r,o=this.renderer,a=this.program,h=e.matrix,l={x:0,y:0},u=o.height;for(r=0;r<10;++r)o.setFloat1(a,"uLights["+r+"].radius",0);for(o.setFloat4(a,"uCamera",e.x,e.y,e.rotation,e.zoom),o.setFloat3(a,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(52);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(52);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(0),s=i(11),r=i(97),o=i(82),a=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},add:function(t){return this.queue(r(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=o.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit("loop",this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit("complete",this),this.state=o.PENDING_REMOVE}},update:function(t,e){if(this.state!==o.PAUSED){var i=e;switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var n=this.totalData,s=0;s0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var m=0;m0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(0),s=i(14),r=i(26),o=i(19),a=i(446),h=i(103),l=i(10),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=n,this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.vertexBuffer=null,this.renderer=t.sys.game.renderer,this.bufferData=null,this.vertexViewF32=null,this.vertexViewU32=null,this.dirty=!0,this.vertexCount=0,this._renderOrder=0,this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.dirty=!0,this.vertexBuffer=null},this)},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t,this.dirty=!0),this},upload:function(t){var e=this.renderer,i=e.gl,n=e.pipelines.TextureTintPipeline;if(this.dirty){var s,r,o,a=this.tileset,h=this.layer.width,l=this.layer.height,u=a.image.source[0].width,c=a.image.source[0].height,d=this.layer.data,f=this._renderOrder,p=this.vertexBuffer,g=this.bufferData,v=-1,m=h*l*n.vertexSize*6;if(this.vertexCount=0,null===g&&(g=new ArrayBuffer(m),this.bufferData=g,this.vertexViewF32=new Float32Array(g),this.vertexViewU32=new Uint32Array(g)),0===f)for(r=0;r=0;o--)(s=d[r][o])&&-1!==s.index&&s.visible&&(v=this.batchTile(v,s,a,u,c,t));else if(2===f)for(r=l-1;r>=0;r--)for(o=0;o=0;r--)for(o=h-1;o>=0;o--)(s=d[r][o])&&-1!==s.index&&s.visible&&(v=this.batchTile(v,s,a,u,c,t));this.dirty=!1,null===p?(p=e.createVertexBuffer(g,i.STATIC_DRAW),this.vertexBuffer=p):(e.setVertexBuffer(p),i.bufferSubData(i.ARRAY_BUFFER,0,g))}return n.modelIdentity(),n.modelTranslate(this.x-t.scrollX*this.scrollFactorX,this.y-t.scrollY*this.scrollFactorY,0),n.modelScale(this.scaleX,this.scaleY,1),n.viewLoad2D(t.matrix.matrix),this},batchTile:function(t,e,i,n,s,r){var o=e.pixelX,a=e.pixelY,h=o+e.width,u=a+e.height,c=i.getTileTextureCoordinates(e.index);if(c){var d=c.x/n,f=c.y/s,p=(c.x+e.width)/n,g=(c.y+e.height)/s,v=l.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),m=o,y=a,x=o,w=u,T=h,b=u,_=h,S=a;r.roundPixels&&(m|=0,y|=0,x|=0,w|=0,T|=0,b|=0,_|=0,S|=0);var A=this.vertexViewF32,C=this.vertexViewU32;return A[++t]=m,A[++t]=y,A[++t]=d,A[++t]=f,A[++t]=0,C[++t]=v,A[++t]=x,A[++t]=w,A[++t]=d,A[++t]=g,A[++t]=0,C[++t]=v,A[++t]=T,A[++t]=b,A[++t]=p,A[++t]=g,A[++t]=0,C[++t]=v,A[++t]=m,A[++t]=y,A[++t]=d,A[++t]=f,A[++t]=0,C[++t]=v,A[++t]=T,A[++t]=b,A[++t]=p,A[++t]=g,A[++t]=0,C[++t]=v,A[++t]=_,A[++t]=S,A[++t]=p,A[++t]=f,A[++t]=0,C[++t]=v,this.vertexCount+=6,t}},calculateFacesAt:function(t,e){return h.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return h.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return h.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},findByIndex:function(t,e,i){return h.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return h.FindTile(t,e,i,n,s,r,o,this.layer)},filterTiles:function(t,e,i,n,s,r,o){return h.FilterTiles(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return h.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return h.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return h.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return h.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return h.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return h.GetTilesWithinShape(t,e,i,this.layer)},hasTileAt:function(t,e){return h.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return h.HasTileAtWorldXY(t,e,i,this.layer)},renderDebug:function(t,e){return h.RenderDebug(t,e,this.layer),this},setCollision:function(t,e,i){return h.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return h.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return h.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return h.SetCollisionByExclusion(t,e,i,this.layer),this},setTileIndexCallback:function(t,e,i){return h.SetTileIndexCallback(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return h.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return h.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return h.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return h.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return h.TileToWorldXY(t,e,i,n,this.layer)},worldToTileX:function(t,e,i){return h.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return h.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return h.WorldToTileXY(t,e,i,n,s,this.layer)},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.tileset=void 0,this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this)}});t.exports=u},function(t,e,i){var n=i(0),s=i(14),r=i(449),o=i(19),a=i(103),h=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DynamicTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=n,this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=a.CullTiles,this._renderOrder=0,this.setAlpha(this.layer.alpha),this.setPosition(s,r),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline")},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.tileset=void 0,this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(31),r=i(209),o=i(20),a=i(29),h=i(77),l=i(243),u=i(208),c=i(55),d=i(103),f=i(99),p=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn('Invalid image key given for tileset: "'+e+'"'),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn('No data found in the JSON tilemap from Tiled matching the tileset name: "'+t+'"'),null;if(this.tilesets[l])return this.tilesets[l].setTileSize(i,n),this.tilesets[l].setSpacing(s,r),this.tilesets[l].setImage(h),this.tilesets[l];void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0);var u=new f(t,o,i,n,s,r);return u.setImage(h),this.tilesets.push(u),u},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new u(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:(null!==a&&d.Copy(t,e,i,n,s,r,o,a),this)},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===a&&(a=e.tileWidth),void 0===l&&(l=e.tileHeight),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===i&&(i=0),void 0===n&&(n=0),null!==this.getLayerIndex(t))return console.warn("Cannot create blank layer: layer with matching name already exists "+t),null;for(var u,d=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;fa&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[])}});t.exports=r},function(t,e,i){var n=i(455),s=i(215),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=n(t,o);if(a.x+=e,a.y+=i,t.gid){var h=s(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?(a.ellipse=t.ellipse,a.width=t.width,a.height=t.height):t.text?(a.width=t.width,a.height=t.height,a.text=t.text):(a.rectangle=!0,a.width=t.width,a.height=t.height);return a}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|s,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t-1}return!1}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(314);function s(t){if(!(this instanceof s))return new s(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;te._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=i(35);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(39),s=i(0),r=i(35),o=i(171),a=i(9),h=i(38),l=i(3),u=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x,e.y),this.prev=new l(e.x,e.y),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.physicsType=r.DYNAMIC_BODY,this._reset=!0,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY;var n=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,n=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},update:function(t){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds();var e=this.transform;if(this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter(),this.rotation=e.rotation,this.preRotation=this.rotation,this._reset&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves){this.world.updateMotion(this,t);var i=this.velocity.x,n=this.velocity.y;this.newVelocity.set(i*t,n*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(n,i),this.speed=Math.sqrt(i*i+n*n),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit("worldbounds",this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y,this.moves&&(0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.gameObject.x+=this._dx,this.gameObject.y+=this._dy,this._reset=!0),this._dx<0?this.facing=r.FACING_LEFT:this._dx>0&&(this.facing=r.FACING_RIGHT),this._dy<0?this.facing=r.FACING_UP:this._dy>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft(this.position),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height)),this.debugShowVelocity&&(t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t){return void 0===t&&(t=!0),this.collideWorldBounds=t,this},setVelocity:function(t,e){return this.velocity.set(t,e),this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},function(t,e,i){var n=i(233),s=i(23),r=i(0),o=i(232),a=i(35),h=i(51),l=i(11),u=i(249),c=i(248),d=i(247),f=i(231),p=i(230),g=i(4),v=i(229),m=i(514),y=i(9),x=i(228),w=i(513),T=i(508),b=i(507),_=i(95),S=i(226),A=i(227),C=i(53),M=i(3),E=i(52),P=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.bodies=new _,this.staticBodies=new _,this.pendingDestroy=new _,this.colliders=new v,this.gravity=new M(g(e,"gravity.x",0),g(e,"gravity.y",0)),this.bounds=new y(g(e,"x",0),g(e,"y",0),g(e,"width",t.sys.game.config.width),g(e,"height",t.sys.game.config.height)),this.checkCollision={up:g(e,"checkCollision.up",!0),down:g(e,"checkCollision.down",!0),left:g(e,"checkCollision.left",!0),right:g(e,"checkCollision.right",!0)},this.fps=g(e,"fps",60),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=g(e,"timeScale",1),this.OVERLAP_BIAS=g(e,"overlapBias",4),this.TILE_BIAS=g(e,"tileBias",16),this.forceX=g(e,"forceX",!1),this.isPaused=g(e,"isPaused",!1),this._total=0,this.drawDebug=g(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:g(e,"debugShowBody",!0),debugShowStaticBody:g(e,"debugShowStaticBody",!0),debugShowVelocity:g(e,"debugShowVelocity",!0),bodyDebugColor:g(e,"debugBodyColor",16711935),staticBodyDebugColor:g(e,"debugStaticBodyColor",255),velocityDebugColor:g(e,"debugVelocityColor",65280)},this.maxEntries=g(e,"maxEntries",16),this.useTree=g(e,"useTree",!0),this.tree=new x(this.maxEntries),this.staticTree=new x(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new C,this._tempMatrix2=new C,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=a.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=s;)this._elapsed-=s,i++,this.step(n);this.stepsLastFrame=i}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(o=(r=s.entries).length,t=0;ta.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,u=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)l.right&&(a=h(u.x,u.y,l.right,l.y)-u.radius):u.y>l.bottom&&(u.xl.right&&(a=h(u.x,u.y,l.right,l.bottom)-u.radius)),a*=-1}else a=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===a||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==a&&(t.onOverlap||e.onOverlap)&&this.emit("overlap",t.gameObject,e.gameObject,t,e),0!==a;var c=t.velocity.x,d=t.velocity.y,g=t.mass,v=e.velocity.x,m=e.velocity.y,y=e.mass,x=c*Math.cos(o)+d*Math.sin(o),w=c*Math.sin(o)-d*Math.cos(o),T=v*Math.cos(o)+m*Math.sin(o),b=v*Math.sin(o)-m*Math.cos(o),_=((g-y)*x+2*y*T)/(g+y),S=(2*g*x+(y-g)*T)/(g+y);t.immovable||(t.velocity.x=(_*Math.cos(o)-w*Math.sin(o))*t.bounce.x,t.velocity.y=(w*Math.cos(o)+_*Math.sin(o))*t.bounce.y,c=t.velocity.x,d=t.velocity.y),e.immovable||(e.velocity.x=(S*Math.cos(o)-b*Math.sin(o))*e.bounce.x,e.velocity.y=(b*Math.cos(o)+S*Math.sin(o))*e.bounce.y,v=e.velocity.x,m=e.velocity.y),Math.abs(o)0&&!t.immovable&&v>c?t.velocity.x*=-1:v<0&&!e.immovable&&c0&&!t.immovable&&m>d?t.velocity.y*=-1:m<0&&!e.immovable&&dMath.PI/2&&(c<0&&!t.immovable&&v0&&!e.immovable&&c>v?e.velocity.x*=-1:d<0&&!t.immovable&&m0&&!e.immovable&&c>m&&(e.velocity.y*=-1));var A=this._frameTime;return t.immovable||(t.x+=t.velocity.x*A-a*Math.cos(o),t.y+=t.velocity.y*A-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*A+a*Math.cos(o),e.y+=e.velocity.y*A+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),t.postUpdate(),e.postUpdate(),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f,p=e.getTilesWithinWorldXY(a,h,l,u);if(0===p.length)return!1;for(var g={left:0,right:0,top:0,bottom:0},v=0;v0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=o[s],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],m=e*o-i*r,y=e*a-n*r,x=e*h-s*r,w=i*a-n*o,T=i*h-s*o,b=n*h-s*a,_=l*p-u*f,S=l*g-c*f,A=l*v-d*f,C=u*g-c*p,M=u*v-d*p,E=c*v-d*g,P=m*E-y*M+x*C+w*A-T*S+b*_;return P?(P=1/P,t[0]=(o*E-a*M+h*C)*P,t[1]=(n*M-i*E-s*C)*P,t[2]=(p*b-g*T+v*w)*P,t[3]=(c*T-u*b-d*w)*P,t[4]=(a*A-r*E-h*S)*P,t[5]=(e*E-n*A+s*S)*P,t[6]=(g*x-f*b-v*y)*P,t[7]=(l*b-c*x+d*y)*P,t[8]=(r*M-o*A+h*_)*P,t[9]=(i*A-e*M-s*_)*P,t[10]=(f*T-p*x+v*m)*P,t[11]=(u*x-l*T-d*m)*P,t[12]=(o*S-r*C-a*_)*P,t[13]=(e*C-i*S+n*_)*P,t[14]=(p*y-f*w-g*m)*P,t[15]=(l*w-u*y+c*m)*P,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],w=y[1],T=y[2],b=y[3];return e[0]=x*i+w*o+T*u+b*p,e[1]=x*n+w*a+T*c+b*g,e[2]=x*s+w*h+T*d+b*v,e[3]=x*r+w*l+T*f+b*m,x=y[4],w=y[5],T=y[6],b=y[7],e[4]=x*i+w*o+T*u+b*p,e[5]=x*n+w*a+T*c+b*g,e[6]=x*s+w*h+T*d+b*v,e[7]=x*r+w*l+T*f+b*m,x=y[8],w=y[9],T=y[10],b=y[11],e[8]=x*i+w*o+T*u+b*p,e[9]=x*n+w*a+T*c+b*g,e[10]=x*s+w*h+T*d+b*v,e[11]=x*r+w*l+T*f+b*m,x=y[12],w=y[13],T=y[14],b=y[15],e[12]=x*i+w*o+T*u+b*p,e[13]=x*n+w*a+T*c+b*g,e[14]=x*s+w*h+T*d+b*v,e[15]=x*r+w*l+T*f+b*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],m=i[7],y=i[8],x=i[9],w=i[10],T=i[11],b=n*n*l+h,_=s*n*l+r*a,S=r*n*l-s*a,A=n*s*l-r*a,C=s*s*l+h,M=r*s*l+n*a,E=n*r*l+s*a,P=s*r*l-n*a,L=r*r*l+h;return i[0]=u*b+p*_+y*S,i[1]=c*b+g*_+x*S,i[2]=d*b+v*_+w*S,i[3]=f*b+m*_+T*S,i[4]=u*A+p*C+y*M,i[5]=c*A+g*C+x*M,i[6]=d*A+v*C+w*M,i[7]=f*A+m*C+T*M,i[8]=u*E+p*P+y*L,i[9]=c*E+g*P+x*L,i[10]=d*E+v*P+w*L,i[11]=f*E+m*P+T*L,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,m=o*h,y=o*l;return i[0]=1-(f+g),i[1]=c+y,i[2]=d-m,i[3]=0,i[4]=c-y,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+m,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,m=r*h;return e[0]=1-(d+p),e[1]=u+m,e[2]=c-v,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),m=h*(g*=v)-l*(p*=v),y=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(m*m+y*y+x*x))?(m*=v=1/v,y*=v,x*=v):(m=0,y=0,x=0);var w=p*x-g*y,T=g*m-f*x,b=f*y-p*m;return(v=Math.sqrt(w*w+T*T+b*b))?(w*=v=1/v,T*=v,b*=v):(w=0,T=0,b=0),n[0]=m,n[1]=w,n[2]=f,n[3]=0,n[4]=y,n[5]=T,n[6]=p,n[7]=0,n[8]=x,n[9]=b,n[10]=g,n[11]=0,n[12]=-(m*s+y*r+x*o),n[13]=-(w*s+T*r+b*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*n+v*o+m*l,e[5]=g*s+v*a+m*u,e[6]=y*i+x*r+w*h,e[7]=y*n+x*o+w*l,e[8]=y*s+x*a+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=n*h-s*a,w=n*l-r*a,T=n*u-o*a,b=s*l-r*h,_=s*u-o*h,S=r*u-o*l,A=c*v-d*g,C=c*m-f*g,M=c*y-p*g,E=d*m-f*v,P=d*y-p*v,L=f*y-p*m,F=x*L-w*P+T*E+b*M-_*C+S*A;return F?(F=1/F,i[0]=(h*L-l*P+u*E)*F,i[1]=(l*M-a*L-u*C)*F,i[2]=(a*P-h*M+u*A)*F,i[3]=(r*P-s*L-o*E)*F,i[4]=(n*L-r*M+o*C)*F,i[5]=(s*M-n*P-o*A)*F,i[6]=(v*S-m*_+y*b)*F,i[7]=(m*T-g*S-y*w)*F,i[8]=(g*_-v*T+y*x)*F,this):null}});t.exports=n},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e,i){var n=i(245);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),te-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)=0?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="txt";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"text",cache:t.cacheManager.text,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",function(t,e,i){if(Array.isArray(t))for(var n=0;n=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=this.threshold?this.pressed||(this.pressed=!0,this.events.emit("down",e,this,t),this.pad.emit("down",i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit("up",e,this,t),this.pad.emit("up",i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){t.exports={CircleToCircle:i(702),CircleToRectangle:i(701),GetRectangleIntersection:i(700),LineToCircle:i(273),LineToLine:i(107),LineToRectangle:i(699),PointToLine:i(272),PointToLineSegment:i(698),RectangleToRectangle:i(147),RectangleToTriangle:i(697),RectangleToValues:i(696),TriangleToCircle:i(695),TriangleToLine:i(694),TriangleToTriangle:i(693)}},function(t,e,i){t.exports={Circle:i(722),Ellipse:i(712),Intersects:i(274),Line:i(692),Point:i(674),Polygon:i(660),Rectangle:i(266),Triangle:i(631)}},function(t,e,i){var n=i(0),s=i(277),r=i(197),o=i(10),a=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1},enable:function(){return this.active=!0,this},disable:function(){return this.active=!1,this},cull:function(t){var e=this.lights,i=this.culledLights,n=e.length,s=t.x+t.width/2,o=t.y+t.height/2,a=(t.width+t.height)/2,h={x:0,y:0},l=t.matrix,u=this.systems.game.config.height;i.length=0;for(var c=0;c0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],r):h=new s(t,e,i,a[0],a[1],a[2],r),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=a},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t,e,i,n,s,r,o){this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1},set:function(t,e,i,n,s,r,o){return this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1,this},setScrollFactor:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this},setColor:function(t){var e=s.getFloatsFromUintRGB(t);return this.r=e[0],this.g=e[1],this.b=e[2],this},setIntensity:function(t){return this.intensity=t,this},setPosition:function(t,e){return this.x=t,this.y=e,this},setRadius:function(t){return this.radius=t,this}});t.exports=r},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e,i){var n=i(6),s=i(65);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(0),s=i(27),r=i(59),o=i(771),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),s.call(this,t,"Triangle",new r(n,o,a,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,s,r){return this.geom.setTo(t,e,i,n,s,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(774),s=i(0),r=i(64),o=i(27),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(65),s=i(54);t.exports=function(t){for(var e=t.points,i=0,r=0;rc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},function(t,e,i){var n=i(9);t.exports=function(t,e){void 0===e&&(e=new n);for(var i,s=1/0,r=1/0,o=-s,a=-r,h=0;h0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=i(66),s=i(0),r=i(14),o=i(302),a=i(301),h=i(821),l=i(2),u=i(161),c=i(299),d=i(84),f=i(304),p=i(298),g=i(9),v=i(110),m=i(3),y=i(52),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0),this.y=new h(e,"y",0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3),this.angle=new h(e,"angle",{min:0,max:360}),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0?n.pop():new this.particleClass(this)).fire(e,i),this.particleBringToTop?this.alive.push(r):this.alive.unshift(r),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,r,this),this.atLimit())break}return r}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);for(var n=this.manager.getProcessors(),s=this.alive,r=s.length,o=0;o0){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y},indexSortCallback:function(t,e){return t.index-e.index}});t.exports=x},function(t,e,i){var n=i(0),s=i(31),r=i(51),o=new n({initialize:function(t){this.emitter=t,this.frame=null,this.index=0,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint"),this.index=i.alive.length},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s>>16,y=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+m+","+y+","+x+","+d+")",c.lineWidth=v,w+=3;break;case n.FILL_STYLE:g=l[w+1],f=l[w+2],m=(16711680&g)>>>16,y=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+m+","+y+","+x+","+f+")",w+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[w+1],l[w+2],l[w+3],l[w+4]):c.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.fill(),w+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.stroke(),w+=6;break;case n.LINE_TO:c.lineTo(l[w+1],l[w+2]),w+=2;break;case n.MOVE_TO:c.moveTo(l[w+1],l[w+2]),w+=2;break;case n.LINE_FX_TO:c.lineTo(l[w+1],l[w+2]),w+=5;break;case n.MOVE_FX_TO:c.moveTo(l[w+1],l[w+2]),w+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[w+1],l[w+2]),w+=2;break;case n.SCALE:c.scale(l[w+1],l[w+2]),w+=2;break;case n.ROTATE:c.rotate(l[w+1]),w+=1;break;case n.GRADIENT_FILL_STYLE:w+=5;break;case n.GRADIENT_LINE_STYLE:w+=6;break;case n.SET_TEXTURE:w+=2}c.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var n=i(307),s=i(155),r=i(92),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(4),s=i(121),r=function(t,e,i){for(var n=[],s=0;sr;){if(o-r>600){var h=o-r+1,l=e-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*c/h+d)),p=Math.min(o,Math.floor(e+(h-l)*c/h+d));i(t,e,f,p,a)}var g=t[e],v=r,m=o;for(n(t,r,e),a(t[o],g)>0&&n(t,r,o);v0;)m--}0===a(t[r],g)?n(t,r,m):n(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}};function n(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function s(t,e){return te?1:0}t.exports=i},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s-1;r--)n[s][r]=t[r][s]}return n}},function(t,e,i){t.exports={AtlasXML:i(885),Canvas:i(884),Image:i(883),JSONArray:i(882),JSONHash:i(881),SpriteSheet:i(880),SpriteSheetFromAtlas:i(879),UnityYAML:i(878)}},function(t,e,i){var n=i(24),s=i(0),r=i(117),o=i(93),a=new s({initialize:function(t,e,i,n){var s=t.manager.game;this.renderer=s.renderer,this.texture=t,this.source=e,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.width||0,this.height=n||e.naturalHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isRenderTexture="RenderTexture"===e.type,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.init(s)},init:function(t){this.renderer&&(this.renderer.gl?this.isCanvas?this.glTexture=this.renderer.canvasToTexture(this.image):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=this.renderer.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.glTexture=this.renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t)},update:function(){this.renderer.gl&&this.isCanvas&&(this.glTexture=this.renderer.canvasToTexture(this.image,this.glTexture))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&n.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},function(t,e,i){var n=i(24),s=i(886),r=i(0),o=i(37),a=i(26),h=i(11),l=i(358),u=i(4),c=i(317),d=i(164),f=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=n.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once("boot",this.boot,this)},boot:function(){this._pending=2,this.on("onload",this.updatePending,this),this.on("onerror",this.updatePending,this),this.addBase64("__DEFAULT",this.game.config.defaultImage),this.addBase64("__MISSING",this.game.config.missingImage),this.game.events.once("destroy",this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off("onload"),this.off("onerror"),this.game.events.emit("texturesready"))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(delete this.list[t.key],t.destroy(),this.emit("removetexture",t.key)),this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,n=new Image;n.onerror=function(){i.emit("onerror",t)},n.onload=function(){var e=i.create(t,n);c.Image(e,0),i.emit("addtexture",t,e),i.emit("onload",t,e)},n.src=e}return this},getBase64:function(t,e,i,s){void 0===i&&(i="image/png"),void 0===s&&(s=.92);var r="",o=this.getFrame(t,e);if(o){var a=o.canvasData,h=n.create2D(this,a.width,a.height);h.getContext("2d").drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=h.toDataURL(i,s),n.remove(h)}return r},addImage:function(t,e,i){var n=null;return this.checkKey(t)&&(n=this.create(t,e),c.Image(n,0),i&&n.setDataSource(i),this.emit("addtexture",t,n)),n},addRenderTexture:function(t,e){var i=null;return this.checkKey(t)&&((i=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),this.emit("addtexture",t,i)),i},generate:function(t,e){if(this.checkKey(t)){var i=n.create(this,1,1);return e.canvas=i,l(e),this.addCanvas(t,i)}return null},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var s=n.create(this,e,i,a.CANVAS,!0);return this.addCanvas(t,s)}return null},addCanvas:function(t,e,i){void 0===i&&(i=!1);var n=null;return i?n=new s(this,t,e,e.width,e.height):this.checkKey(t)&&(n=new s(this,t,e,e.width,e.height),this.list[t]=n,this.emit("addtexture",t,n)),n},addAtlas:function(t,e,i,n){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,n):this.addAtlasJSONHash(t,e,i,n)},addAtlasJSONArray:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=1===i.length,o=0;o=r.x&&t=r.y&&e=r.x&&t=r.y&&e0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit("resume",this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit("stop",this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,"rate",t)||(this.calculateRate(),this.emit("rate",this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,"detune",t)||(this.calculateRate(),this.emit("detune",this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit("loop",this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(115),s=i(0),r=i(324),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var n=0;n-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit("transitioninit",n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once("complete",this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},resize:function(t,e){for(var i=0;i=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e,i){var n=i(0),s=i(11),r=i(7),o=i(13),a=i(5),h=i(2),l=i(15),u=i(331),c=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once("boot",this.boot,this)},boot:function(){var t,e,i,n,s,r,o,a=this.game.config,l=a.installGlobalPlugins;for(l=l.concat(this._pendingGlobal),t=0;t10&&(t=10-this.pointersTotal);for(var i=0;i0},queueTouchStart:function(t){if(this.queue.push(s.TOUCH_START,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueTouchMove:function(t){if(this.queue.push(s.TOUCH_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueTouchEnd:function(t){if(this.queue.push(s.TOUCH_END,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},queueMouseDown:function(t){if(this.queue.push(s.MOUSE_DOWN,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueMouseMove:function(t){if(this.queue.push(s.MOUSE_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueMouseUp:function(t){if(this.queue.push(s.MOUSE_UP,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},addUpCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.upOnce.push(t):this.domCallbacks.up.push(t),this._hasUpCallback=!0,this},addDownCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.downOnce.push(t):this.domCallbacks.down.push(t),this._hasDownCallback=!0,this},addMoveCallback:function(t,e){return void 0===e&&(e=!1),e?this.domCallbacks.moveOnce.push(t):this.domCallbacks.move.push(t),this._hasMoveCallback=!0,this},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var n=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){n=!1;break}s=s.parentContainer}while(s);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;1!==i.resolution&&(a+=i._x,h+=i._y),i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this._tempMatrix,d=this._tempMatrix2,f=0;f1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e,i){var n=i(37);n.ColorToRGBA=i(914),n.ComponentToHex=i(347),n.GetColor=i(177),n.GetColor32=i(377),n.HexStringToColor=i(378),n.HSLToColor=i(913),n.HSVColorWheel=i(912),n.HSVToRGB=i(176),n.HueToComponent=i(346),n.IntegerToColor=i(375),n.IntegerToRGB=i(374),n.Interpolate=i(911),n.ObjectToColor=i(373),n.RandomRGB=i(910),n.RGBStringToColor=i(372),n.RGBToHSV=i(376),n.RGBToString=i(909),n.ValueToColor=i(178),t.exports=n},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(170),s=i(0),r=i(70),o=i(3),a=new s({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;ei;)n-=i;n16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(37),s=i(374);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(ef.right&&(p=u(p,p+(v-f.right),this.lerp.x)),mf.bottom&&(g=u(g,g+(m-f.bottom),this.lerp.y))):(p=u(p,v-l,this.lerp.x),g=u(g,m-c,this.lerp.y))}this.useBounds&&(p=this.clampX(p),g=this.clampY(g)),this.roundPixels&&(l=Math.round(l),c=Math.round(c)),this.scrollX=p,this.scrollY=g;var y=p+s,x=g+o;this.midPoint.set(y,x);var w=i/a,T=n/a;this.worldView.setTo(y-w/2,x-T/2,w,T),h.loadIdentity(),h.scale(e,e),h.translate(this.x+l,this.y+c),h.rotate(this.rotation),h.scale(a,a),h.translate(-l,-c),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(381),s=new(i(0))({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once("destroy",this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","text","html","obj","tilemap","xml"],e=0;ee.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=i(23),s=i(0),r=i(384),o=i(383),a=i(4),h=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,a(i,"frames",[]),a(i,"defaultTextureKey",null)),this.frameRate=a(i,"frameRate",null),this.duration=a(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=a(i,"skipMissedFrames",!0),this.delay=a(i,"delay",0),this.repeat=a(i,"repeat",0),this.repeatDelay=a(i,"repeatDelay",0),this.yoyo=a(i,"yoyo",!1),this.showOnStart=a(i,"showOnStart",!1),this.hideOnComplete=a(i,"hideOnComplete",!1),this.paused=!1,this.manager.on("pauseall",this.pause,this),this.manager.on("resumeall",this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=l[0],l[0].prevFrame=s;var v=1/(l.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),r(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);t._repeatDelay>0&&!1===t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay):(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter)))},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off("pauseall",this.pause,this),this.manager.off("resumeall",this.resume,this),this.manager.remove(this.key);for(var t=0;t-h&&(c-=h,n+=l),f=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(16),s=i(53),r=i(200),o=i(199),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t}};t.exports=a},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){this.geometryMask=t},preRenderWebGL:function(t,e,i){var n=t.gl,s=this.geometryMask;t.flush(),n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.NOTEQUAL,1,1),n.stencilOp(n.REPLACE,n.REPLACE,n.REPLACE),s.renderWebGL(t,s,0,i),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilFunc(n.EQUAL,1,1),n.stencilOp(n.KEEP,n.KEEP,n.KEEP)},postRenderWebGL:function(t){var e=t.gl;t.flush(),e.disable(e.STENCIL_TEST)},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){var i=t.sys.game.renderer;if(this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,i&&i.gl){var n=i.width,s=i.height,r=0==(n&n-1)&&0==(s&s-1),o=i.gl,a=r?o.REPEAT:o.CLAMP_TO_EDGE,h=o.LINEAR;this.mainTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.maskTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.mainFramebuffer=i.createFramebuffer(n,s,this.mainTexture,!1),this.maskFramebuffer=i.createFramebuffer(n,s,this.maskTexture,!1),i.onContextRestored(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,o=s.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!1),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!1)},this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t){t.pipelines.BitmapMaskPipeline.endMask(this)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null;var t=this.renderer;t&&t.gl&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer)),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null,this.renderer=null}});t.exports=n},function(t,e,i){var n=i(395),s=i(394),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&this.texture&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*s-a*r+e,t.y=o*r+a*s+i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var n=i(190),s=i(123);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e,i){var n=i(23),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var n=i(403),s=i(192),r=i(92),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;i--){var n=Math.floor(this.frac()*(e+1)),s=t[n];t[n]=t[i],t[i]=s}return t}});t.exports=n},function(t,e,i){var n=i(192),s=i(92),r=i(16),o=i(6);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(43),s=i(41),r=i(42),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(45),s=i(41),r=i(44),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(41),r=i(74),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(43),r=i(73),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(72),s=i(45),r=i(73),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(74),s=i(73);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(412),s=i(75),r=i(72);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(47),s=i(43),r=i(46),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(45),r=i(46),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(75),r=i(46),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(193),s=[];s[n.BOTTOM_CENTER]=i(416),s[n.BOTTOM_LEFT]=i(415),s[n.BOTTOM_RIGHT]=i(414),s[n.CENTER]=i(413),s[n.LEFT_CENTER]=i(411),s[n.RIGHT_CENTER]=i(410),s[n.TOP_CENTER]=i(409),s[n.TOP_LEFT]=i(408),s[n.TOP_RIGHT]=i(407);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){t.exports={Angle:i(1049),Call:i(1048),GetFirst:i(1047),GetLast:i(1046),GridAlign:i(1045),IncAlpha:i(1034),IncX:i(1033),IncXY:i(1032),IncY:i(1031),PlaceOnCircle:i(1030),PlaceOnEllipse:i(1029),PlaceOnLine:i(1028),PlaceOnRectangle:i(1027),PlaceOnTriangle:i(1026),PlayAnimation:i(1025),PropertyValueInc:i(32),PropertyValueSet:i(25),RandomCircle:i(1024),RandomEllipse:i(1023),RandomLine:i(1022),RandomRectangle:i(1021),RandomTriangle:i(1020),Rotate:i(1019),RotateAround:i(1018),RotateAroundDistance:i(1017),ScaleX:i(1016),ScaleXY:i(1015),ScaleY:i(1014),SetAlpha:i(1013),SetBlendMode:i(1012),SetDepth:i(1011),SetHitArea:i(1010),SetOrigin:i(1009),SetRotation:i(1008),SetScale:i(1007),SetScaleX:i(1006),SetScaleY:i(1005),SetTint:i(1004),SetVisible:i(1003),SetX:i(1002),SetXY:i(1001),SetY:i(1e3),ShiftPosition:i(999),Shuffle:i(998),SmootherStep:i(997),SmoothStep:i(996),Spread:i(995),ToggleVisible:i(994),WrapInRectangle:i(993)}},,,function(t,e,i){var n=i(0),s=i(896),r=i(895),o=i(198),a=new n({Extends:o,initialize:function(t){o.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:t.topology?t.topology:t.renderer.gl.TRIANGLES,vertShader:t.vertShader?t.vertShader:r,fragShader:t.fragShader?t.fragShader:s,vertexCapacity:t.vertexCapacity?t.vertexCapacity:3,vertexSize:t.vertexSize?t.vertexSize:2*Float32Array.BYTES_PER_ELEMENT,vertices:new Float32Array([-1,1,-1,-7,7,1]).buffer,attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.maxQuads=1,this.resolutionDirty=!0},onBind:function(){o.prototype.onBind.call(this);var t=this.renderer,e=this.program;return this.resolutionDirty&&(t.setFloat2(e,"uResolution",this.width,this.height),t.setInt1(e,"uMainSampler",0),t.setInt1(e,"uMaskSampler",1),this.resolutionDirty=!1),this},resize:function(t,e,i){return o.prototype.resize.call(this,t,e,i),this.resolutionDirty=!0,this},beginMask:function(t,e,i){var n=this.renderer,s=this.gl,r=t.bitmapMask;r&&s&&(n.flush(),n.setFramebuffer(t.maskFramebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),r.renderWebGL(n,r,0,i),n.flush(),n.setFramebuffer(t.mainFramebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT))},endMask:function(t){var e=this.renderer,i=this.gl;t.bitmapMask&&i&&(e.setFramebuffer(null),e.setPipeline(this),e.setTexture2D(t.maskTexture,1),e.setTexture2D(t.mainTexture,0),e.setInt1(this.program,"uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3))}});t.exports=a},function(t,e){t.exports=function(t,e,i){e||(e="image/png"),i||(i=.92);var n=t.getContext("experimental-webgl"),s=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,s);var r,o=document.createElement("canvas"),a=o.getContext("2d");o.width=n.drawingBufferWidth,o.height=n.drawingBufferHeight;for(var h=(r=a.getImageData(0,0,o.width,o.height)).data,l=0;l0&&n>0&&s.scissor(t,this.drawingBufferHeight-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},setBlendMode:function(t){var e=this.gl,i=this.blendModes[t];return t!==r.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),i.func.length>2?e.blendFuncSeparate(i.func[0],i.func[1],i.func[2],i.func[3]):e.blendFunc(i.func[0],i.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>16&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e){var i=this.gl;return t!==this.currentTextures[e]&&(this.flush(),this.currentActiveTextureUnit!==e&&(i.activeTexture(i.TEXTURE0+e),this.currentActiveTextureUnit=e),i.bindTexture(i.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t){var e=this.gl,i=this.width,n=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(i=t.renderTexture.width,n=t.renderTexture.height):this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),e.viewport(0,0,i,n),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,a=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,o(e,i)&&(h=s.REPEAT),n===r.ScaleModes.LINEAR&&this.config.antialias&&(a=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,a,h,h,s.RGBA,t):this.createTexture2D(0,a,a,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&a(this.nativeTextures,e),this.gl.deleteTexture(t),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,s=t._ch,r=this.pipelines.TextureTintPipeline,o=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-s),this.setFramebuffer(t.framebuffer);var a=this.gl;a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),r.projOrtho(e,n+e,i,s+i,-1e3,1e3),o.alphaGL>0&&r.drawFillRect(e,i,n+e,s+i,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL),t.emit("prerender",t)}else o.alphaGL>0?(this.pushScissor(e,i,n,s),r.drawFillRect(e,i,n,s,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL)):this.pushScissor(e,i,n,s)},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,l.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,l.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit("postrender",t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=l.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n in this.config.clearBeforeRender&&(t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)),t.enable(t.SCISSOR_TEST),i)i[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,o=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=0;l=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===y&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(m,y),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=u},function(t,e,i){var n=new(i(0))({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once("remove",this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,this._timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this._delay=0,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this.forward=!0,this._reverse=!1,this.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},setDelay:function(t){return void 0===t&&(t=0),this._delay=t,this.parent},getDelay:function(){return this._delay},delayedPlay:function(t,e,i){return this.play(e,!0,i),this.nextTick+=t,this.parent},getCurrentKey:function(){if(this.currentAnim)return this.currentAnim.key},load:function(t,e){return void 0===e&&(e=0),this.isPlaying&&this.stop(),this.animationManager.load(this,t,e),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.updateFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.updateFrame(t),this.parent},isPaused:{get:function(){return this._paused}},play:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!0,this._reverse=!1,this._startAnimation(t,i))},playReverse:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!1,this._reverse=!0,this._startAnimation(t,i))},_startAnimation:function(t,e){this.load(t,e);var i=this.currentAnim,n=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,i.showOnStart&&(n.visible=!0),n.emit("animationstart",this.currentAnim,this.currentFrame),n},reverse:function(t){return this.isPlaying&&this.currentAnim.key===t?(this._reverse=!this._reverse,this.forward=!this.forward,this.parent):this.parent},getProgress:function(){var t=this.currentFrame.progress;return this.forward||(t=1-t),t},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},remove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},getRepeat:function(){return this._repeat},setRepeat:function(t){return this._repeat=t,this.repeatCounter=0,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){return void 0===t&&(t=!1),this.currentAnim.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(this.currentAnim.frames[0]),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent;return t.emit("animationcomplete",this.currentAnim,this.currentFrame),t},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopOnRepeat:function(){return this._pendingStop=2,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},setTimeScale:function(t){return void 0===t&&(t=1),this._timeScale=t,this.parent},getTimeScale:function(){return this._timeScale},getTotalFrames:function(){return this.currentAnim.frames.length},update:function(t,e){if(this.currentAnim&&this.isPlaying&&!this.currentAnim.paused){if(this.accumulator+=e*this._timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.currentAnim.completeAnimation(this);this.accumulator>=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit("animationupdate",i,t),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off("remove",this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=n},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,function(t,i){return e[Number(i)-1]})}},function(t,e,i){t.exports={Format:i(429),Pad:i(179),Reverse:i(428),UppercaseFirst:i(328),UUID:i(296)}},function(t,e,i){var n=i(63);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)&&(i[s]=e[s]);return i}},function(t,e){t.exports=function(t,e){for(var i=0;i-1&&(e.state=a.REMOVED,s.splice(r,1)):(e.state=a.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t0){var s=t.gl,r=this.pipeline,o=r.vertexBuffer,a=e.tileset.glTexture;t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer,t.setPipeline(r),t.setTexture2D(a,0),s.drawArrays(r.topology,0,e.vertexCount),r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}}},function(t,e,i){var n=i(1),s=i(1);n=i(445),s=i(444),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.tileset,c=t.currentContext,d=u.image.getSourceImage();c.save(),l.copyToContext(c);for(var f=n.alpha*e.alpha,p=0;p-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(20);t.exports=function(t){for(var e,i,s,r,o,a=0;a>>0;return n}},function(t,e,i){var n=i(458),s=i(2),r=i(77),o=i(215),a=i(55);t.exports=function(t,e){for(var i=[],h=0;h0){var m=new a(u,v.gid,c,f.length,t.tilewidth,t.tileheight);m.rotation=v.rotation,m.flipX=v.flipped,d.push(m)}else{var y=e?null:new a(u,-1,c,f.length,t.tilewidth,t.tileheight);d.push(y)}++c===l.width&&(f.push(d),c=0,d=[])}u.data=f,i.push(u)}}return i}},function(t,e,i){t.exports={Parse:i(218),Parse2DArray:i(132),ParseCSV:i(217),Impact:i(211),Tiled:i(216)}},function(t,e,i){var n=i(49),s=i(48),r=i(3);t.exports=function(t,e,i,o,a,h){return void 0===o&&(o=new r(0,0)),o.x=n(t,i,a,h),o.y=s(e,i,a,h),o}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o){if(void 0!==r){var a,h=n(t,e,i,s,null,o),l=0;for(a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e,i){var n=i(56),s=i(34),r=i(84);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;ae)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(56),s=i(34),r=i(133);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=y;a--)for(o=v;o=y;a--)for(o=m;o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(101),s=i(100),r=i(17),o=i(221);t.exports=function(t,e,i,a,h,l){void 0===i&&(i={}),Array.isArray(t)||(t=[t]);var u=l.tilemapLayer;void 0===a&&(a=u.scene),void 0===h&&(h=a.cameras.main);var c,d=r(0,0,l.width,l.height,null,l),f=[];for(c=0;c=0&&p=0&&g=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("update",this.step,this),t.events.emit("transitioncomplete",this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i){return this.manager.add(t,e,i),this},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off("shutdown",this.shutdown,this),t.off("postupdate",this.step,this),t.off("transitionout")},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",a,"scenePlugin"),t.exports=a},function(t,e,i){var n=i(116),s=i(20),r={SceneManager:i(330),ScenePlugin:i(495),Settings:i(327),Systems:i(165)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(222),s=new(i(0))({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=s},function(t,e,i){t.exports={BasePlugin:i(222),DefaultPlugins:i(166),PluginCache:i(15),PluginManager:i(332),ScenePlugin:i(497)}},,,,,,,,,function(t,e,i){var n=i(230);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){var n=i(231);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(509);t.exports=function(t,e,i,s,r){var o=0;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y0&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom>i&&(o=t.bottom-i)>r&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:n(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(511);t.exports=function(t,e,i,s,r){var o=0;return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x0&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right>i&&(o=t.right-i)>r&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:n(t,o)),o}},function(t,e,i){var n=i(512),s=i(510),r=i(227);t.exports=function(t,e,i,o,a,h){var l=o.left,u=o.top,c=o.right,d=o.bottom,f=i.faceLeft||i.faceRight,p=i.faceTop||i.faceBottom;if(!f&&!p)return!1;var g=0,v=0,m=0,y=1;if(e.deltaAbsX()>e.deltaAbsY()?m=-1:e.deltaAbsX()=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l>i&&(n=h,i=l)}return n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(t,e)},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});u.register("ArcadePhysics",f,"arcadePhysics"),t.exports=f},function(t,e,i){var n=i(35),s=i(20),r={ArcadePhysics:i(527),Body:i(233),Collider:i(232),Factory:i(239),Group:i(236),Image:i(238),Sprite:i(104),StaticBody:i(226),StaticGroup:i(235),World:i(234)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(137),s=i(241),r=i(240),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o1?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t){for(var e=0,i=0;i0&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(295),IsSize:i(117),IsValue:i(549)}},function(t,e,i){var n=i(182);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(119);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return e<0?n(t[0],t[1],s):e>1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(170);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return t[0]===t[i]?(e<0&&(r=Math.floor(s=i*(1+e))),n(s-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(n(-s,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("update",this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit("progress",this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e,i){var n=i(0),s=i(11),r=i(4),o=i(106),a=i(257),h=i(142),l=i(256),u=i(602),c=i(601),d=i(600),f=i(141),p=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.keys=[],this.combos=[],this.queue=[],this.onKeyHandler,this.time=0,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.settings.input,e=this.scene.sys.game.config;this.enabled=r(t,"keyboard",e.inputKeyboard),this.target=r(t,"keyboard.target",e.inputKeyboardEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=function(e){if(!e.defaultPrevented&&t.isActive()){t.queue.push(e);var i=t.keys[e.keyCode];i&&i.preventDefault&&e.preventDefault()}};this.onKeyHandler=e,this.target.addEventListener("keydown",e,!1),this.target.addEventListener("keyup",e,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("keydown",this.onKeyHandler),this.target.removeEventListener("keyup",this.onKeyHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},createCursorKeys:function(){return this.addKeys({up:h.UP,down:h.DOWN,left:h.LEFT,right:h.RIGHT,space:h.SPACE,shift:h.SHIFT})},addKeys:function(t){var e={};if("string"==typeof t){t=t.split(",");for(var i=0;i-1?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new a(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);i>-1&&(this.keys[i]=void 0)}else"string"==typeof t&&(t=h[t.toUpperCase()]);e[t]&&(e[t]=void 0)},createCombo:function(t,e){return new l(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=f(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(t){this.time=t;var e=this.queue.length;if(this.enabled&&0!==e)for(var i=this.queue.splice(0,e),n=this.keys,s=0;s=e}}},function(t,e,i){var n=i(71),s=i(39),r=i(0),o=i(261),a=i(608),h=i(51),l=i(89),u=i(88),c=i(11),d=i(2),f=i(106),p=i(8),g=i(15),v=i(9),m=i(38),y=i(59),x=i(69),w=new r({Extends:c,initialize:function(t){c.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new c,this.enabled=!0,this.displayList,this.cameras,f.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once("destroy",this.destroy,this),this.pluginEvents.emit("boot")},start:function(){var t=this.systems.events;t.on("transitionstart",this.transitionIn,this),t.on("transitionout",this.transitionOut,this),t.on("transitioncomplete",this.transitionComplete,this),t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.enabled=!0,this.pluginEvents.emit("start")},preUpdate:function(){this.pluginEvents.emit("preUpdate");var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r-1&&(s.splice(a,1),this.clear(o))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},update:function(t,e){if(this.isActive()){this.pluginEvents.emit("update",t,e);var i=this.manager;if(!i.globalTopOnly||!i.ignoreEvents){var n=i.dirty||0===this.pollRate;if(this.pollRate>-1&&(this._pollTimer-=e,this._pollTimer<0&&(n=!0,this._pollTimer=this.pollRate)),n)for(var s=this.manager.pointers,r=0;r0&&i.globalTopOnly&&(i.ignoreEvents=!0)}}}},clear:function(t){var e=t.input;if(e){this.queueForRemoval(t),e.gameObject=void 0,e.target=void 0,e.hitArea=void 0,e.hitAreaCallback=void 0,e.callbackContext=void 0,this.manager.resetCursor(e),t.input=null;var i=this._draggable.indexOf(t);return i>-1&&this._draggable.splice(i,1),(i=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(i,1),(i=this._over[0].indexOf(t))>-1&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0?t.dragState=1:t.dragState>0&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i1&&(this.sortGameObjects(a),this.topOnly&&a.splice(1)),this._drag[t.id]=a,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(this.dragDistanceThreshold>0&&h(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),this.dragTimeThreshold>0&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(s=this._drag[t.id],i=0;i0?(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),l[0]?(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):r.target=null)}else!r.target&&l[0]&&(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target));var c=t.x-n.input.dragX,d=t.y-n.input.dragY;n.emit("drag",t,c,d),this.emit("drag",t,n,c,d)}return s.length}if(5===t.dragState){for(s=this._drag[t.id],i=0;i0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return a(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,a=!1;if(p(e)){var h=e;e=d(h,"hitArea",null),i=d(h,"hitAreaCallback",null),n=d(h,"draggable",!1),s=d(h,"dropZone",!1),r=d(h,"cursor",!1),a=d(h,"useHandCursor",!1);var l=d(h,"pixelPerfect",!1),u=d(h,"alphaTolerance",1);l&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)e.x&&t.ye.y}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),s=Math.max(t.right,e);t.x=n,t.width=s-n;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var s=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=s,t.height=r-s,t}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;on(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){var n=i(144);t.exports=function(t,e){var i=n(t);return ii&&(i=h.x),h.xr&&(r=h.y),h.ye.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e,i){var n=i(69),s=i(107);t.exports=function(t,e){return!!(n(t,e.getPointA())||n(t,e.getPointB())||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},function(t,e,i){var n=i(273),s=i(69);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottomt.right+r||it.bottom+r||st.right||e.rightt.bottom||e.bottom0}},function(t,e,i){var n=i(272);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(9),s=i(147);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){var n=i(51);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(88);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(88);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(89);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(89);n.Area=i(711),n.Circumference=i(307),n.CircumferencePoint=i(155),n.Clone=i(710),n.Contains=i(88),n.ContainsPoint=i(709),n.ContainsRect=i(708),n.CopyFrom=i(707),n.Equals=i(706),n.GetBounds=i(705),n.GetPoint=i(309),n.GetPoints=i(308),n.Offset=i(704),n.OffsetPoint=i(703),n.Random=i(185),t.exports=n},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e,i){var n=i(39);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(39);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(71);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(71);n.Area=i(721),n.Circumference=i(403),n.CircumferencePoint=i(192),n.Clone=i(720),n.Contains=i(39),n.ContainsPoint=i(719),n.ContainsRect=i(718),n.CopyFrom=i(717),n.Equals=i(716),n.GetBounds=i(715),n.GetPoint=i(406),n.GetPoints=i(404),n.Offset=i(714),n.OffsetPoint=i(713),n.Random=i(191),t.exports=n},function(t,e,i){var n=i(0),s=i(276),r=i(15),o=new n({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once("boot",this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on("shutdown",this.shutdown,this),t.on("destroy",this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(148);s.register("quad",function(t,e){void 0===t&&(t={});var i=r(t,"x",0),s=r(t,"y",0),a=r(t,"key",null),h=r(t,"frame",null),l=new o(this.scene,i,s,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l})},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(4),a=i(108);s.register("mesh",function(t,e){void 0===t&&(t={});var i=r(t,"key",null),s=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"colors",[]),u=o(t,"alphas",[]),c=o(t,"uv",[]),d=new a(this.scene,0,0,h,c,l,u,i,s);return void 0!==e&&(t.add=e),n(this.scene,d,t),d})},function(t,e,i){var n=i(148);i(5).register("quad",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(108);i(5).register("mesh",function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))})},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=this.pipeline;t.setPipeline(o,e);var a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.frame.glTexture,c=e.vertices,d=e.uv,f=e.colors,p=e.alphas,g=c.length,v=Math.floor(.5*g);o.vertexCount+v>=o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var m=o.vertexViewF32,y=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,w=0,T=e.tintFill,b=0;b0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0){var F=o.strokeTint,k=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(F.TL=k,F.TR=k,F.BL=k,F.BR=k,C=1;Cr;h--){for(l=0;l0&&r.maxLines1&&(d+=f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(4);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,m={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},y=0,x=0;x?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(812),s=i(20),r={Parse:i(811)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r),t.setBlankTexture(!0)}},function(t,e,i){var n=i(1),s=i(1);n=i(815),s=i(814),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(302),EdgeZone:i(301),RandomZone:i(298)}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.emitters.list,o=r.length;if(0!==o){var a=t._tempMatrix1.copyFrom(n.matrix),h=t._tempMatrix2,l=t._tempMatrix3,u=t._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);a.multiply(u);var c=n.roundPixels,d=t.currentContext;d.save();for(var f=0;f0&&(Y=Y%b-b):Y>b?Y=b:Y<0&&(Y=b+Y%b),null===C&&(C=new o(O+Math.cos(B)*I,D+Math.sin(B)*I,v),_.push(C),R+=.01);R<1+z;)T=Y*R+B,x=O+Math.cos(T)*I,w=D+Math.sin(T)*I,C.points.push(new r(x,w,v)),R+=.01;T=Y+B,x=O+Math.cos(T)*I,w=D+Math.sin(T)*I,C.points.push(new r(x,w,v));break;case n.FILL_RECT:u.batchFillRect(p[++E],p[++E],p[++E],p[++E],f,c);break;case n.FILL_TRIANGLE:u.batchFillTriangle(p[++E],p[++E],p[++E],p[++E],p[++E],p[++E],f,c);break;case n.STROKE_TRIANGLE:u.batchStrokeTriangle(p[++E],p[++E],p[++E],p[++E],p[++E],p[++E],v,f,c);break;case n.LINE_TO:null!==C?C.points.push(new r(p[++E],p[++E],v)):(C=new o(p[++E],p[++E],v),_.push(C));break;case n.MOVE_TO:C=new o(p[++E],p[++E],v),_.push(C);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:O=p[++E],D=p[++E],f.translate(O,D);break;case n.SCALE:O=p[++E],D=p[++E],f.scale(O,D);break;case n.ROTATE:f.rotate(p[++E]);break;case n.SET_TEXTURE:var N=p[++E],U=p[++E];u.currentFrame=N,t.setTexture2D(N.glTexture,0),u.tintEffect=U;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,t.setTexture2D(t.blankTexture.glTexture,0),u.tintEffect=2}}}},function(t,e,i){var n=i(1),s=i(1);n=i(829),s=i(306),s=i(306),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(22);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length,h=t.currentContext;if(0!==a&&n(t,h,e,s,r)){var l=e.frame,u=e.displayCallback,c=s.scrollX*e.scrollFactorX,d=s.scrollY*e.scrollFactorY,f=e.fontData.chars,p=e.fontData.lineHeight,g=0,v=0,m=0,y=0,x=null,w=0,T=0,b=0,_=0,S=0,A=0,C=null,M=0,E=e.frame.source.image,P=l.cutX,L=l.cutY,F=0,k=e.fontSize/e.fontData.size;e.cropWidth>0&&e.cropHeight>0&&(h.save(),h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var R=0;R0&&e.cropHeight>0&&h.restore(),h.restore()}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length;if(0!==a){var h=this.pipeline;t.setPipeline(h,e);var l=e.cropWidth>0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,m=p.cutY,y=g.width,x=g.height,w=e._isTinted&&e.tintFill,T=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),b=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),_=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),S=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var A,C,M=0,E=0,P=0,L=0,F=e.letterSpacing,k=0,R=0,O=0,D=0,I=e.scrollX,B=e.scrollY,Y=e.fontData,X=Y.chars,z=Y.lineHeight,N=e.fontSize/Y.size,U=0,G=e._align,W=0,V=0;e.getTextBounds(!1);var H=e._bounds.lines;1===G?V=(H.longest-H.lengths[0])/2:2===G&&(V=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;Jv&&(r=v),o>m&&(o=m);var L=v+g.xAdvance,F=m+u;aA&&(A=M),MA&&(A=M),M-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;i0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e,i){var n=i(90);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return n(t,s)}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(s)for(var h=0;ht.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){var n=i(315);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],r=Math.max(n((e-t)/(i||1)),0),o=0;o=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var o=s;o0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t},tick:function(){this.step(window.performance.now())},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime=window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step(window.performance.now())},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e){var i=0,n=function(t,e,n,s){var r=i-s.y-s.height;t.add(n,e,s.x,r,s.width,s.height)};t.exports=function(t,e,s){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height),i=r.height;for(var o=s.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;cx||a<-x)&&(a=0),a<0&&(a=x+a),-1!==h&&(x=a+(h+1));for(var C=l,M=l,E=0,P=e.sourceIndex,L=0;Lg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,m=f,y=0,x=0,w=0;wr&&(y=T-r),b>o&&(x=b-o),t.add(w,e,i+v,s+m,h-y,l-x),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);var r,o=i.frames;for(var a in o){var h=o[a];r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted()),r.customData=n(h)}for(var l in i)"frames"!==l&&(Array.isArray(i[l])?t.customData[l]=i[l].slice(0):t.customData[l]=i[l]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames||i.textures){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e,i){var n=i(91),s=i(118),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),n.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},function(t,e,i){var n=i(0),s=i(26),r=i(341),o=i(2),a=i(4),h=i(8),l=i(16),u=i(1),c=i(166),d=i(178),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",null),this.scaleMode=a(t,"scaleMode",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND.init(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.autoResize=a(i,"autoResize",!0),this.antialias=a(i,"antialias",!0),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",!1),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){var n=i(168),s=i(382),r=i(380),o=i(24),a=i(0),h=i(902),l=i(897),u=i(122),c=i(890),d=i(341),f=i(345),p=i(11),g=i(339),v=i(15),m=i(332),y=i(330),x=i(326),w=i(319),T=i(877),b=i(876),_=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new p,this.anims=new s(this),this.textures=new w(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new y(this,this.config.sceneConfig),this.device=d,this.sound=x.create(this),this.loop=new T(this,this.config.fps),this.plugins=new m(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){v.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),l(this),c(this),n(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("texturesready",this.texturesReady,this)):console.warn("Core Phaser Plugins missing. Cannot start.")},texturesReady:function(){this.events.emit("ready"),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),b(this);var t=this.events;t.on("hidden",this.onHidden,this),t.on("visible",this.onVisible,this),t.on("blur",this.onBlur,this),t.on("focus",this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e);var n=this.renderer;n.preRender(),i.emit("prerender",n,t,e),this.scene.render(n),n.postRender(),i.emit("postrender",n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e),i.emit("prerender"),i.emit("postrender")},onHidden:function(){this.loop.pause(),this.events.emit("pause")},onVisible:function(){this.loop.resume(),this.events.emit("resume")},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},resize:function(t,e){this.config.width=t,this.config.height=e,this.renderer.resize(t,e),this.input.resize(),this.scene.resize(t,e),this.events.emit("resize",t,e)},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit("destroy"),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=_},function(t,e,i){var n=i(0),s=i(11),r=i(15),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){t.exports={EventEmitter:i(904)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c1)for(var i=1;i>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e){t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(i){t.style[i+"user-select"]=e}),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e,i){t.exports={CanvasInterpolation:i(349),CanvasPool:i(24),Smoothing:i(175),TouchAction:i(916),UserSelect:i(915)}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e,i){t.exports={CenterOn:i(412),GetBottom:i(47),GetCenterX:i(75),GetCenterY:i(72),GetLeft:i(45),GetOffsetX:i(919),GetOffsetY:i(918),GetRight:i(43),GetTop:i(41),SetBottom:i(46),SetCenterX:i(74),SetCenterY:i(73),SetLeft:i(44),SetRight:i(42),SetTop:i(40)}},function(t,e,i){var n=i(43),s=i(41),r=i(46),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(45),s=i(41),r=i(46),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(41),r=i(46),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(43),s=i(41),r=i(44),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(43),r=i(73),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(43),r=i(46),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(45),s=i(41),r=i(42),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(45),r=i(73),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(45),r=i(46),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(43),r=i(42),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(45),r=i(44),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(75),r=i(74),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){t.exports={BottomCenter:i(932),BottomLeft:i(931),BottomRight:i(930),LeftBottom:i(929),LeftCenter:i(928),LeftTop:i(927),RightBottom:i(926),RightCenter:i(925),RightTop:i(924),TopCenter:i(923),TopLeft:i(922),TopRight:i(921)}},function(t,e,i){t.exports={BottomCenter:i(416),BottomLeft:i(415),BottomRight:i(414),Center:i(413),LeftCenter:i(411),QuickSet:i(417),RightCenter:i(410),TopCenter:i(409),TopLeft:i(408),TopRight:i(407)}},function(t,e,i){var n=i(193),s=i(20),r={In:i(934),To:i(933)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(935),Bounds:i(920),Canvas:i(917),Color:i(348),Masks:i(908)}},function(t,e,i){var n=i(0),s=i(122),r=i(15),o=new n({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.events=this.systems.events,this.events.once("destroy",this.destroy,this)},start:function(){this.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},function(t,e,i){t.exports={DataManager:i(122),DataManagerPlugin:i(937)}},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},function(t,e,i){var n=i(0),s=i(356),r=i(354),o=i(5),a=i(353),h=i(939),l=i(352),u=i(9),c=i(350),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e0&&(h.preRender(r,o),t.render(n,e,i,h))}},resetAll:function(){for(var t=0;t=1?1:1/e*(1+(e*t|0))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e,i){var n=i(23),s=i(0),r=i(3),o=i(173),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new r,this.current=new r,this.destination=new r,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,a){void 0===i&&(i=1e3),void 0===n&&(n=o.Linear),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning?h:(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(h.scrollX,h.scrollY),this.destination.set(t,e),h.getScroll(t,e,this.current),"string"==typeof n&&o.hasOwnProperty(n)?this.ease=o[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=a,this.camera.emit("camerapanstart",this.camera,this,i,t,e),h)},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=s(t,"speed.x",0),this.speedY=s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={FixedKeyControl:i(988),SmoothedKeyControl:i(987)}},function(t,e,i){t.exports={Controls:i(989),Scene2D:i(986)}},function(t,e,i){t.exports={BaseCache:i(381),CacheManager:i(380)}},function(t,e,i){t.exports={Animation:i(385),AnimationFrame:i(383),AnimationManager:i(382)}},function(t,e,i){var n=i(52);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){var i={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=i},function(t,e){var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.frame.realWidth},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return this.scaleY*this.frame.realHeight},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){var n=i(93),s={_scaleMode:n.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==n.LINEAR&&t!==n.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=s},function(t,e){var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=Math.round(this.originX*this.width),this._displayOriginY=Math.round(this.originY*this.height),this}};t.exports=i},function(t,e,i){var n=i(9),s=i(397),r=i(3),o={getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getTopRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBounds:function(t){var e,i,s,r,o,a,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),s=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,s,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,s,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e,i){var n=i(417),s=i(193),r=i(2),o=i(1),a=new(i(124))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=r(e,"width",-1),o=r(e,"height",-1),h=r(e,"cellWidth",1),l=r(e,"cellHeight",h),u=r(e,"position",s.TOP_LEFT),c=r(e,"x",0),d=r(e,"y",0),f=0,p=0,g=i*h,v=o*l;a.setPosition(c,d),a.setSize(h,l);for(var m=0;m>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,t.exports=n},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;no.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c0&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit("destroy",this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});a.RENDER_MASK=15,t.exports=a},function(t,e,i){var n=i(8),s=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit("filecomplete",e,i,t),this.loader.emit("filecomplete-"+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){t.exports=function(t,e,i,n,s){var r=n.alpha*i.alpha;if(r<=0)return!1;var o=t._tempMatrix1.copyFromArray(n.matrix.matrix),a=t._tempMatrix2.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),h=t._tempMatrix3;return s?(o.multiplyWithOffset(s,-n.scrollX*i.scrollFactorX,-n.scrollY*i.scrollFactorY),a.e=i.x,a.f=i.y,o.multiply(a,h)):(a.e-=n.scrollX*i.scrollFactorX,a.f-=n.scrollY*i.scrollFactorY,o.multiply(a,h)),e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=r,e.save(),h.setToContext(e),!0}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n,s,r,o=i(26),a=i(175),h=[],l=!1;t.exports={create2D:function(t,e,i){return n(t,e,i,o.CANVAS)},create:n=function(t,e,i,n,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=o.CANVAS),void 0===r&&(r=!1);var c=s(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&n===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return n(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n={VERSION:"3.14.0",BlendModes:i(66),ScaleModes:i(94),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(54),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e,i){var n=i(66),s=i(12),r=i(94);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),e.blendMode=s(i,"blendMode",n.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e){t.exports=function(t,e,i){var n=i||e.fillColor,s=e.fillAlpha,r=(16711680&n)>>>16,o=(65280&n)>>>8,a=255&n;t.fillStyle="rgba("+r+","+o+","+a+","+s+")"}},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},,function(t,e,i){var n=i(102),s=i(17);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;d>>16,r=(65280&i)>>>8,o=255&i;t.strokeStyle="rgba("+s+","+r+","+o+","+n+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),s=i(177),r=i(377),o=i(176),a=i(376),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,n,s,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},scaleY:{get:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[5]=s*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,s,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*i,a=n*n,h=s*s,l=r*r,u=Math.sqrt(o+h),c=Math.sqrt(a+l);return t.translateX=e[4],t.translateY=e[5],t.scaleX=u,t.scaleY=c,t.rotation=Math.acos(i/u)*(Math.atan(-s/i)<0?-1:1),t},applyITRS:function(t,e,i,n,s){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=r*c*e+-o*c*t+(-u*r+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=r},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(4),l=i(8),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;sthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=h},function(t,e,i){var n=i(0),s=i(14),r=i(266),o=new n({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=null,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return this.getLeft(t)+this.width/2},getCenterY:function(t){return this.getTop(t)+this.height/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight-(this.height-this.baseHeight),this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.tilemapLayer;return t?t.tileset:null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.loader=t,this.type=e,this.key=i,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={};for(var s=0;s=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;ps||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,a,h,l,u,f,g,v=e&&e.length,m=v?e[0]*i:t.length,y=s(t,0,m,i,!0),x=[];if(!y)return x;if(v&&(y=function(t,e,i,n){var o,a,h,l,u,f=[];for(o=0,a=e.length;o80*i){n=h=t[0],a=l=t[1];for(var w=i;wh&&(h=u),f>l&&(l=f);g=Math.max(h-n,l-a)}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===A(t,e,i,n)>0)for(r=e;r=e;r-=n)o=b(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(_(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(_(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),_(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&w(s,r)&&w(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),_(n),_(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=T(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&w(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=T(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&w(t,e)&&w(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function w(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function T(t,e){var i=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function b(t,e,i,n){var s=new S(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function _(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function S(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={SKIP_CHECK:-1,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}},,function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(0),s=i(172),r=i(9),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){var n=i(0),s=i(40),r=i(406),o=i(404),a=i(191),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},,function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation","orthogonal"),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[])}});t.exports=r},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",{}),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null)}});t.exports=r},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i=t.length)){for(var i=t.length-1,n=t[e],s=e;s-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t=this.firstgid&&t=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(730),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,o],initialize:function(t,e,i,n,s,o,a,h,l){if(r.call(this,t,"Mesh"),n.length!==s.length)throw new Error("Mesh Vertex count must match UV count");var u,c=n.length/2|0;if(o.length>0&&o.length0&&a.lengthl&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(0),s=i(23),r=i(20),o=new n({initialize:function(t,e,i,n,s,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,d)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),m=r=s(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,w=e+(n=s(n,0,u-e)),T=i+(r=s(r,0,c-i));if(!(x.rw||x.y>T)){var b=Math.max(x.x,e),_=Math.max(x.y,i),S=Math.min(x.r,w)-b,A=Math.min(x.b,T)-_;v=S,m=A,p=o?h+(u-(b-x.x)-S):h+(b-x.x),g=a?l+(c-(_-x.y)-A):l+(_-x.y),e=b,i=_,n=S,r=A}else p=0,g=0,v=0,m=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var C=this.source.width,M=this.source.height;return t.u0=Math.max(0,p/C),t.v0=Math.max(0,g/M),t.u1=Math.min(1,(p+v)/C),t.v1=Math.min(1,(g+m)/M),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){var n=i(0),s=i(11),r=i(20),o=i(1),a=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=r(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=r(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=r(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=r(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit("destroy",this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=a},function(t,e,i){var n=i(0),s=i(63),r=i(11),o=i(1),a=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on("blur",function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on("focus",function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on("prestep",this.update,this),t.events.once("destroy",this.destroy,this)},add:o,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once("ended",i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once("ended",n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("pauseall",this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit("resumeall",this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit("stopall",this)},unlock:o,onBlur:o,onFocus:o,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("rate",this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("detune",this,t)}}});t.exports=a},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){var n,s=i(92),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){var n=i(0),s=i(14),r=i(31),o=i(11),a=i(9),h=i(38),l=i(178),u=i(3),c=new n({Extends:o,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.config,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new a,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new a,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new h,this.transparent=!0,this.backgroundColor=l("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new u(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new u);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOn:function(t,e){var i=.5*this.width,n=.5*this.height;return this.midPoint.set(t,e),this.scrollX=t-i,this.scrollY=e-n,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;g-m&&b>-y&&T-m&&S>-y&&_s&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=l(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.config=t.sys.game.config,this.sceneManager=t.sys.game.scene;var e=this.config.resolution;return this.resolution=e,this._cx=this._x*e,this._cy=this._y*e,this._cw=this._width*e,this._ch=this._height*e,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.config){var t=0!==this._x||0!==this._y||this.config.width!==this._width||this.config.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit("cameradestroy",this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.config=null,this.sceneManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=c},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){if(this.state!==o.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this},play:function(t){if(this.state!==o.ACTIVE){this.state!==o.PENDING_REMOVE&&this.state!==o.REMOVED||(this.init(),this.parent.makeActive(this),t=!0);var e=this.callbacks.onStart;this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this))}},resetTweenData:function(t){for(var e=this.data,i=0;i0?(n.elapsed=n.delay,n.state=o.DELAY):n.state=o.PENDING_RENDER}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&ns.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},stop:function(t){this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parent._destroy.push(this),this.parent._toProcess++),this.state=o.PENDING_REMOVE)},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e){function i(t){return!!t.getStart&&"function"==typeof t.getStart}function n(t){return!!t.getEnd&&"function"==typeof t.getEnd}var s=function(t,e){var r,o,a=function(t,e,i){return i},h=function(t,e,i){return i},l=typeof e;if("number"===l)a=function(){return e};else if("string"===l){var u=e[0],c=parseFloat(e.substr(2));switch(u){case"+":a=function(t,e,i){return i+c};break;case"-":a=function(t,e,i){return i-c};break;case"*":a=function(t,e,i){return i*c};break;case"/":a=function(t,e,i){return i/c};break;default:a=function(){return parseFloat(e)}}}else"function"===l?a=e:"object"===l&&(i(o=e)||n(o))?(n(e)&&(a=e.getEnd),i(e)&&(h=e.getStart)):e.hasOwnProperty("value")&&(r=s(t,e.value));return r||(r={getEnd:a,getStart:h}),r};t.exports=s},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"targets",null);return null===e?e:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(29),s=i(77),r=i(218),o=i(210);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",n.ARRAY_2D,u,i,a,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new s({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){var n=i(29),s=i(78),r=i(77),o=i(55);t.exports=function(t,e,i,a,h){for(var l=new s({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],m=s[12],y=s[13],x=s[14],w=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+m)*w,this.y=(e*o+i*u+n*p+y)*w,this.z=(e*a+i*c+n*g+x)*w,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=i(344),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n=0&&r>=0&&s+r<1&&(n.push({x:e[T].x,y:e[T].y}),i)));T++);return n}},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.righte.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),s=i(108),r=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,1,1,1,0],[16777215,16777215,16777215,16777215,16777215,16777215],[1,1,1,1,1,1],n,r),this.resetPosition()},setFrame:function(t){return this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,t=this.frame,this.uv[0]=t.u0,this.uv[1]=t.v0,this.uv[2]=t.u0,this.uv[3]=t.v1,this.uv[4]=t.u1,this.uv[5]=t.v1,this.uv[6]=t.u0,this.uv[7]=t.v0,this.uv[8]=t.u1,this.uv[9]=t.v1,this.uv[10]=t.u1,this.uv[11]=t.v0,this},topLeftX:{get:function(){return this.x+this.vertices[0]},set:function(t){this.vertices[0]=t-this.x,this.vertices[6]=t-this.x}},topLeftY:{get:function(){return this.y+this.vertices[1]},set:function(t){this.vertices[1]=t-this.y,this.vertices[7]=t-this.y}},topRightX:{get:function(){return this.x+this.vertices[10]},set:function(t){this.vertices[10]=t-this.x}},topRightY:{get:function(){return this.y+this.vertices[11]},set:function(t){this.vertices[11]=t-this.y}},bottomLeftX:{get:function(){return this.x+this.vertices[2]},set:function(t){this.vertices[2]=t-this.x}},bottomLeftY:{get:function(){return this.y+this.vertices[3]},set:function(t){this.vertices[3]=t-this.y}},bottomRightX:{get:function(){return this.x+this.vertices[4]},set:function(t){this.vertices[4]=t-this.x,this.vertices[8]=t-this.x}},bottomRightY:{get:function(){return this.y+this.vertices[5]},set:function(t){this.vertices[5]=t-this.y,this.vertices[9]=t-this.y}},topLeftAlpha:{get:function(){return this.alphas[0]},set:function(t){this.alphas[0]=t,this.alphas[3]=t}},topRightAlpha:{get:function(){return this.alphas[5]},set:function(t){this.alphas[5]=t}},bottomLeftAlpha:{get:function(){return this.alphas[1]},set:function(t){this.alphas[1]=t}},bottomRightAlpha:{get:function(){return this.alphas[2]},set:function(t){this.alphas[2]=t,this.alphas[4]=t}},topLeftColor:{get:function(){return this.colors[0]},set:function(t){this.colors[0]=t,this.colors[3]=t}},topRightColor:{get:function(){return this.colors[5]},set:function(t){this.colors[5]=t}},bottomLeftColor:{get:function(){return this.colors[1]},set:function(t){this.colors[1]=t}},bottomRightColor:{get:function(){return this.colors[2]},set:function(t){this.colors[2]=t,this.colors[4]=t}},setTopLeft:function(t,e){return this.topLeftX=t,this.topLeftY=e,this},setTopRight:function(t,e){return this.topRightX=t,this.topRightY=e,this},setBottomLeft:function(t,e){return this.bottomLeftX=t,this.bottomLeftY=e,this},setBottomRight:function(t,e){return this.bottomRightX=t,this.bottomRightY=e,this},resetPosition:function(){var t=this.x,e=this.y,i=Math.floor(this.width/2),n=Math.floor(this.height/2);return this.setTopLeft(t-i,e-n),this.setTopRight(t+i,e-n),this.setBottomLeft(t-i,e+n),this.setBottomRight(t+i,e+n),this},resetAlpha:function(){var t=this.alphas;return t[0]=1,t[1]=1,t[2]=1,t[3]=1,t[4]=1,t[5]=1,this},resetColors:function(){var t=this.colors;return t[0]=16777215,t[1]=16777215,t[2]=16777215,t[3]=16777215,t[4]=16777215,t[5]=16777215,this},reset:function(){return this.resetPosition(),this.resetAlpha(),this.resetColors()}});t.exports=r},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++sl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=y+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h0&&(a+=u.lineSpacing*p),i.rtl?o=d-o:"right"===i.align?o+=u.width-u.lineWidths[p]:"center"===i.align&&(o+=(u.width-u.lineWidths[p])/2),this.autoRound&&(o=Math.round(o),a=Math.round(a)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[p],o,a)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[p],o,a));return e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(120),s=i(24),r=i(0),o=i(14),a=i(26),h=i(113),l=i(19),u=i(816),c=i(296),d=new r({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,r,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===o&&(o=32),l.call(this,t,"RenderTexture"),this.renderer=t.sys.game.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=s.create2D(this,r,o),this.context=this.canvas.getContext("2d"),this.framebuffer=null,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(c(),this.canvas),this.frame=this.texture.get(),this._saved=!1,this.camera=new n(0,0,r,o),this.dirty=!1,this.gl=null;var h=this.renderer;if(h.type===a.WEBGL){var u=h.gl;this.gl=u,this.drawGameObject=this.batchGameObjectWebGL,this.framebuffer=h.createFramebuffer(r,o,this.frame.source.glTexture,!1)}else h.type===a.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas);this.camera.setScene(t),this.setPosition(e,i),this.setSize(r,o),this.setOrigin(0,0),this.initPipeline()},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas.width=t,this.canvas.height=e,this.gl){var i=this.gl;this.renderer.deleteTexture(this.frame.source.glTexture),this.renderer.deleteFramebuffer(this.framebuffer),this.frame.source.glTexture=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1),this.framebuffer=this.renderer.createFramebuffer(t,e,this.frame.source.glTexture,!1),this.frame.glTexture=this.frame.source.glTexture}this.frame.source.width=t,this.frame.source.height=e,this.camera.setSize(t,e),this.frame.setSize(t,e),this.width=t,this.height=e}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e){void 0===e&&(e=1);var i=255&(t>>16|0),n=255&(t>>8|0),s=255&(0|t);if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var r=this.gl;r.clearColor(i/255,n/255,s/255,e),r.clear(r.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else this.context.fillStyle="rgb("+i+","+n+","+s+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height);return this},clear:function(){if(this.dirty){if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.restore()}this.dirty=!1}return this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1,1),r){this.renderer.setFramebuffer(this.framebuffer);var o=this.pipeline;o.projOrtho(0,this.width,0,this.height,-1e3,1e3),this.batchList(t,e,i,n,s),o.flush(),this.renderer.setFramebuffer(null),o.projOrtho(0,o.width,o.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1,1),o){this.renderer.setFramebuffer(this.framebuffer);var h=this.pipeline;h.projOrtho(0,this.width,0,this.height,-1e3,1e3),h.batchTextureFrame(a,i,n,r,s,this.camera.matrix,null),h.flush(),this.renderer.setFramebuffer(null),h.projOrtho(0,h.width,h.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i,n,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;r0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e,i){var n=i(109),s=i(0),r=i(833),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(163),s=i(66),r=i(0),o=i(14),a=i(19),h=i(9),l=i(836),u=i(310),c=i(3),d=new r({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.ScrollFactor,o.Transform,o.Visible,l],initialize:function(t,e,i,n){a.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new h),t.setTo(this.x,this.y,0,0),this.list.length>0)for(var e=this.list,i=new h,n=0;n-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=d},function(t,e,i){var n=i(840),s=i(837),r=i(0),o=i(14),a=i(113),h=i(19),l=i(112),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(t,e,i,n,s){h.call(this,t,"Blitter"),this.setTexture(n,s),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,r){void 0===n&&(n=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new s(this,t,e,i,n);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,n){for(var s=this.createMultiple(e,i,n),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit("start",this),this.events.emit("ready",this,t)},resize:function(t,e){this.events.emit("resize",t,e)},shutdown:function(t){this.events.off("transitioninit"),this.events.off("transitionstart"),this.events.off("transitioncomplete"),this.events.off("transitionout"),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit("destroy",this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,s=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return e.x=t.x+s*Math.cos(i)*t.width/2,e.y=t.y+s*Math.sin(i)*t.height/2,e}},function(t,e){var i={defaultPipeline:null,pipeline:null,initPipeline:function(t){void 0===t&&(t="TextureTintPipeline");var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return e&&e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t)),this},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=i},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),r=s>1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e){t.exports={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}},,,function(t,e,i){var n=i(0),s=i(64),r=i(2),o=i(893),a=i(892),h=i(891),l=i(38),u=i(10),c=i(198),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return this.renderer.setTexture2D(t,e),this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize,s=this.renderer;if(0!==e)return s.setBlankTexture(),t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=-t.displayOriginX+f,y=-t.displayOriginY+p;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||o.updateCropUVs(x,t.flipX,t.flipY),h=x.u0,l=x.v0,c=x.u1,d=x.v1,g=x.width,v=x.height,f=x.x,p=x.y,m=-t.displayOriginX+f,y=-t.displayOriginY+p}t.flipX&&(m+=g,g*=-1),t.flipY&&(y+=v,v*=-1);var w=m+g,T=y+v;s.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var b=r.getX(m,y),_=r.getY(m,y),S=r.getX(m,T),A=r.getY(m,T),C=r.getX(w,T),M=r.getY(w,T),P=r.getX(w,y),E=r.getY(w,y),L=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),F=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),k=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),R=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(b|=0,_|=0,S|=0,A|=0,C|=0,M|=0,P|=0,E|=0),this.setTexture2D(a,0);var O=t._isTinted&&t.tintFill;this.batchQuad(b,_,S,A,C,M,P,E,h,l,c,d,L,F,k,R,O)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v){var m=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),m=!0);var y=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.vertexComponentCount-1;return y[++w]=t,y[++w]=e,y[++w]=h,y[++w]=l,y[++w]=v,x[++w]=d,y[++w]=i,y[++w]=n,y[++w]=h,y[++w]=c,y[++w]=v,x[++w]=p,y[++w]=s,y[++w]=r,y[++w]=u,y[++w]=c,y[++w]=v,x[++w]=g,y[++w]=t,y[++w]=e,y[++w]=h,y[++w]=l,y[++w]=v,x[++w]=d,y[++w]=s,y[++w]=r,y[++w]=u,y[++w]=c,y[++w]=v,x[++w]=g,y[++w]=o,y[++w]=a,y[++w]=u,y[++w]=l,y[++w]=v,x[++w]=f,this.vertexCount+=6,m},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f){var p=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),p=!0);var g=this.vertexViewF32,v=this.vertexViewU32,m=this.vertexCount*this.vertexComponentCount-1;return g[++m]=t,g[++m]=e,g[++m]=o,g[++m]=a,g[++m]=f,v[++m]=u,g[++m]=i,g[++m]=n,g[++m]=o,g[++m]=l,g[++m]=f,v[++m]=c,g[++m]=s,g[++m]=r,g[++m]=h,g[++m]=l,g[++m]=f,v[++m]=d,this.vertexCount+=3,p},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,w,T,b,_,S,A,C,M,P,E,L){this.renderer.setPipeline(this,t);var F=this._tempMatrix1,k=this._tempMatrix2,R=this._tempMatrix3,O=m/i+C,D=y/n+M,I=(m+x)/i+C,B=(y+w)/n+M,Y=o,X=a,z=-g,N=-v;if(t.isCropped){var U=t._crop;Y=U.width,X=U.height,o=U.width,a=U.height;var G=m=U.x,W=y=U.y;c&&(G=x-U.x-U.width),d&&!e.isRenderTexture&&(W=w-U.y-U.height),O=G/i+C,D=W/n+M,I=(G+U.width)/i+C,B=(W+U.height)/n+M,z=-g+m,N=-v+y}d^=!L&&e.isRenderTexture?1:0,c&&(Y*=-1,z+=o),d&&(X*=-1,N+=a);var V=z+Y,H=N+X;k.applyITRS(s,r,u,h,l),F.copyFrom(P.matrix),E?(F.multiplyWithOffset(E,-P.scrollX*f,-P.scrollY*p),k.e=s,k.f=r,F.multiply(k,R)):(k.e-=P.scrollX*f,k.f-=P.scrollY*p,F.multiply(k,R));var j=R.getX(z,N),q=R.getY(z,N),K=R.getX(z,H),J=R.getY(z,H),Z=R.getX(V,H),Q=R.getY(V,H),$=R.getX(V,N),tt=R.getY(V,N);P.roundPixels&&(j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0,tt|=0),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,O,D,I,B,T,b,_,S,A)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),m=h.getY(l,c),y=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,m,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n,h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,w=m.u1,T=m.v1;this.batchQuad(l,u,c,d,f,p,g,v,y,x,w,T,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(R,O,E,L,H[0],H[1],H[2],H[3],U,G,W,V,B,Y,X,z,I):(j[0]=R,j[1]=O,j[2]=E,j[3]=L,j[4]=1),h&&j[4]?this.batchQuad(M,P,F,k,j[0],j[1],j[2],j[3],U,G,W,V,B,Y,X,z,I):(H[0]=M,H[1]=P,H[2]=F,H[3]=k,H[4]=1)}}});t.exports=d},function(t,e,i){var n=i(0),s=i(894),r=i(196),o=new n({Extends:r,initialize:function(t){t.fragShader=s.replace("%LIGHT_COUNT%",10..toString()),r.call(this,t),this.defaultNormalMap},boot:function(){this.defaultNormalMap=this.game.textures.getFrame("__DEFAULT")},onBind:function(t){r.prototype.onBind.call(this);var e=this.renderer,i=this.program;return this.mvpUpdate(),e.setInt1(i,"uNormSampler",1),e.setFloat2(i,"uResolution",this.width,this.height),t&&this.setNormalMap(t),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,10);if(0===s)return this;this.active=!0;var r,o=this.renderer,a=this.program,h=e.matrix,l={x:0,y:0},u=o.height;for(r=0;r<10;++r)o.setFloat1(a,"uLights["+r+"].radius",0);for(o.setFloat4(a,"uCamera",e.x,e.y,e.rotation,e.zoom),o.setFloat3(a,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(53);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(53);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(0),s=i(11),r=i(97),o=i(83),a=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},add:function(t){return this.queue(r(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=o.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit("loop",this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit("complete",this),this.state=o.PENDING_REMOVE}},update:function(t,e){if(this.state!==o.PAUSED){var i=e;switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var n=this.totalData,s=0;s0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var m=0;m0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(0),s=i(14),r=i(26),o=i(19),a=i(446),h=i(103),l=i(38),u=i(10),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===m?(m=i.createVertexBuffer(y,n.STATIC_DRAW),this.vertexBuffer[e]=m):(i.setVertexBuffer(m),n.bufferSubData(n.ARRAY_BUFFER,0,y))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=a.x/n,l=a.y/s,c=(a.x+e.width)/n,d=(a.y+e.height)/s,f=this._tempMatrix,p=e.width,g=e.height,v=p/2,m=g/2,y=-v,x=-m;e.flipX&&(p*=-1,y+=e.width),e.flipY&&(g*=-1,x+=e.height);var w=y+p,T=x+g;f.applyITRS(v+e.pixelX,m+e.pixelY,e.rotation,1,1);var b=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),_=f.getX(y,x),S=f.getY(y,x),A=f.getX(y,T),C=f.getY(y,T),M=f.getX(w,T),P=f.getY(w,T),E=f.getX(w,x),L=f.getY(w,x);r.roundPixels&&(_|=0,S|=0,A|=0,C|=0,M|=0,P|=0,E|=0,L|=0);var F=this.vertexViewF32[o],k=this.vertexViewU32[o];return F[++t]=_,F[++t]=S,F[++t]=h,F[++t]=l,F[++t]=0,k[++t]=b,F[++t]=A,F[++t]=C,F[++t]=h,F[++t]=d,F[++t]=0,k[++t]=b,F[++t]=M,F[++t]=P,F[++t]=c,F[++t]=d,F[++t]=0,k[++t]=b,F[++t]=_,F[++t]=S,F[++t]=h,F[++t]=l,F[++t]=0,k[++t]=b,F[++t]=M,F[++t]=P,F[++t]=c,F[++t]=d,F[++t]=0,k[++t]=b,F[++t]=E,F[++t]=L,F[++t]=c,F[++t]=l,F[++t]=0,k[++t]=b,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(31),r=i(209),o=i(20),a=i(29),h=i(78),l=i(243),u=i(208),c=i(55),d=i(103),f=i(99),p=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new f(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new u(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:(null!==a&&d.Copy(t,e,i,n,s,r,o,a),this)},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===a&&(a=e.tileWidth),void 0===l&&(l=e.tileHeight),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===i&&(i=0),void 0===n&&(n=0),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,d=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;fa&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[])}});t.exports=r},function(t,e,i){var n=i(455),s=i(215),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=n(t,o);if(a.x+=e,a.y+=i,t.gid){var h=s(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?(a.ellipse=t.ellipse,a.width=t.width,a.height=t.height):t.text?(a.width=t.width,a.height=t.height,a.text=t.text):(a.rectangle=!0,a.width=t.width,a.height=t.height);return a}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|s,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t-1}return!1}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(314);function s(t){if(!(this instanceof s))return new s(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;te._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=i(35);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(40),s=i(0),r=i(35),o=i(171),a=i(9),h=i(39),l=i(3),u=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x,e.y),this.prev=new l(e.x,e.y),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.physicsType=r.DYNAMIC_BODY,this._reset=!0,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var n=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,n=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},update:function(t){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds();var e=this.transform;if(this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter(),this.rotation=e.rotation,this.preRotation=this.rotation,this._reset&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves){this.world.updateMotion(this,t);var i=this.velocity.x,n=this.velocity.y;this.newVelocity.set(i*t,n*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(n,i),this.speed=Math.sqrt(i*i+n*n),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit("worldbounds",this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y,this.moves&&(0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.gameObject.x+=this._dx,this.gameObject.y+=this._dy,this._reset=!0),this._dx<0?this.facing=r.FACING_LEFT:this._dx>0&&(this.facing=r.FACING_RIGHT),this._dy<0?this.facing=r.FACING_UP:this._dy>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft(this.position),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height)),this.debugShowVelocity&&(t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t){return void 0===t&&(t=!0),this.collideWorldBounds=t,this},setVelocity:function(t,e){return this.velocity.set(t,e),this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},function(t,e,i){var n=i(233),s=i(23),r=i(0),o=i(232),a=i(35),h=i(52),l=i(11),u=i(249),c=i(248),d=i(247),f=i(231),p=i(230),g=i(4),v=i(229),m=i(514),y=i(9),x=i(228),w=i(513),T=i(508),b=i(507),_=i(95),S=i(226),A=i(227),C=i(38),M=i(3),P=i(53),E=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.bodies=new _,this.staticBodies=new _,this.pendingDestroy=new _,this.colliders=new v,this.gravity=new M(g(e,"gravity.x",0),g(e,"gravity.y",0)),this.bounds=new y(g(e,"x",0),g(e,"y",0),g(e,"width",t.sys.game.config.width),g(e,"height",t.sys.game.config.height)),this.checkCollision={up:g(e,"checkCollision.up",!0),down:g(e,"checkCollision.down",!0),left:g(e,"checkCollision.left",!0),right:g(e,"checkCollision.right",!0)},this.fps=g(e,"fps",60),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=g(e,"timeScale",1),this.OVERLAP_BIAS=g(e,"overlapBias",4),this.TILE_BIAS=g(e,"tileBias",16),this.forceX=g(e,"forceX",!1),this.isPaused=g(e,"isPaused",!1),this._total=0,this.drawDebug=g(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:g(e,"debugShowBody",!0),debugShowStaticBody:g(e,"debugShowStaticBody",!0),debugShowVelocity:g(e,"debugShowVelocity",!0),bodyDebugColor:g(e,"debugBodyColor",16711935),staticBodyDebugColor:g(e,"debugStaticBodyColor",255),velocityDebugColor:g(e,"debugVelocityColor",65280)},this.maxEntries=g(e,"maxEntries",16),this.useTree=g(e,"useTree",!0),this.tree=new x(this.maxEntries),this.staticTree=new x(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new C,this._tempMatrix2=new C,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=a.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=s;)this._elapsed-=s,i++,this.step(n);this.stepsLastFrame=i}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(o=(r=s.entries).length,t=0;ta.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,u=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)l.right&&(a=h(u.x,u.y,l.right,l.y)-u.radius):u.y>l.bottom&&(u.xl.right&&(a=h(u.x,u.y,l.right,l.bottom)-u.radius)),a*=-1}else a=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===a||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==a&&(t.onOverlap||e.onOverlap)&&this.emit("overlap",t.gameObject,e.gameObject,t,e),0!==a;var c=t.velocity.x,d=t.velocity.y,g=t.mass,v=e.velocity.x,m=e.velocity.y,y=e.mass,x=c*Math.cos(o)+d*Math.sin(o),w=c*Math.sin(o)-d*Math.cos(o),T=v*Math.cos(o)+m*Math.sin(o),b=v*Math.sin(o)-m*Math.cos(o),_=((g-y)*x+2*y*T)/(g+y),S=(2*g*x+(y-g)*T)/(g+y);t.immovable||(t.velocity.x=(_*Math.cos(o)-w*Math.sin(o))*t.bounce.x,t.velocity.y=(w*Math.cos(o)+_*Math.sin(o))*t.bounce.y,c=t.velocity.x,d=t.velocity.y),e.immovable||(e.velocity.x=(S*Math.cos(o)-b*Math.sin(o))*e.bounce.x,e.velocity.y=(b*Math.cos(o)+S*Math.sin(o))*e.bounce.y,v=e.velocity.x,m=e.velocity.y),Math.abs(o)0&&!t.immovable&&v>c?t.velocity.x*=-1:v<0&&!e.immovable&&c0&&!t.immovable&&m>d?t.velocity.y*=-1:m<0&&!e.immovable&&dMath.PI/2&&(c<0&&!t.immovable&&v0&&!e.immovable&&c>v?e.velocity.x*=-1:d<0&&!t.immovable&&m0&&!e.immovable&&c>m&&(e.velocity.y*=-1));var A=this._frameTime;return t.immovable||(t.x+=t.velocity.x*A-a*Math.cos(o),t.y+=t.velocity.y*A-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*A+a*Math.cos(o),e.y+=e.velocity.y*A+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),t.postUpdate(),e.postUpdate(),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f,p=e.getTilesWithinWorldXY(a,h,l,u);if(0===p.length)return!1;for(var g={left:0,right:0,top:0,bottom:0},v=0;v0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=o[s],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],m=e*o-i*r,y=e*a-n*r,x=e*h-s*r,w=i*a-n*o,T=i*h-s*o,b=n*h-s*a,_=l*p-u*f,S=l*g-c*f,A=l*v-d*f,C=u*g-c*p,M=u*v-d*p,P=c*v-d*g,E=m*P-y*M+x*C+w*A-T*S+b*_;return E?(E=1/E,t[0]=(o*P-a*M+h*C)*E,t[1]=(n*M-i*P-s*C)*E,t[2]=(p*b-g*T+v*w)*E,t[3]=(c*T-u*b-d*w)*E,t[4]=(a*A-r*P-h*S)*E,t[5]=(e*P-n*A+s*S)*E,t[6]=(g*x-f*b-v*y)*E,t[7]=(l*b-c*x+d*y)*E,t[8]=(r*M-o*A+h*_)*E,t[9]=(i*A-e*M-s*_)*E,t[10]=(f*T-p*x+v*m)*E,t[11]=(u*x-l*T-d*m)*E,t[12]=(o*S-r*C-a*_)*E,t[13]=(e*C-i*S+n*_)*E,t[14]=(p*y-f*w-g*m)*E,t[15]=(l*w-u*y+c*m)*E,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],w=y[1],T=y[2],b=y[3];return e[0]=x*i+w*o+T*u+b*p,e[1]=x*n+w*a+T*c+b*g,e[2]=x*s+w*h+T*d+b*v,e[3]=x*r+w*l+T*f+b*m,x=y[4],w=y[5],T=y[6],b=y[7],e[4]=x*i+w*o+T*u+b*p,e[5]=x*n+w*a+T*c+b*g,e[6]=x*s+w*h+T*d+b*v,e[7]=x*r+w*l+T*f+b*m,x=y[8],w=y[9],T=y[10],b=y[11],e[8]=x*i+w*o+T*u+b*p,e[9]=x*n+w*a+T*c+b*g,e[10]=x*s+w*h+T*d+b*v,e[11]=x*r+w*l+T*f+b*m,x=y[12],w=y[13],T=y[14],b=y[15],e[12]=x*i+w*o+T*u+b*p,e[13]=x*n+w*a+T*c+b*g,e[14]=x*s+w*h+T*d+b*v,e[15]=x*r+w*l+T*f+b*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],m=i[7],y=i[8],x=i[9],w=i[10],T=i[11],b=n*n*l+h,_=s*n*l+r*a,S=r*n*l-s*a,A=n*s*l-r*a,C=s*s*l+h,M=r*s*l+n*a,P=n*r*l+s*a,E=s*r*l-n*a,L=r*r*l+h;return i[0]=u*b+p*_+y*S,i[1]=c*b+g*_+x*S,i[2]=d*b+v*_+w*S,i[3]=f*b+m*_+T*S,i[4]=u*A+p*C+y*M,i[5]=c*A+g*C+x*M,i[6]=d*A+v*C+w*M,i[7]=f*A+m*C+T*M,i[8]=u*P+p*E+y*L,i[9]=c*P+g*E+x*L,i[10]=d*P+v*E+w*L,i[11]=f*P+m*E+T*L,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,m=o*h,y=o*l;return i[0]=1-(f+g),i[1]=c+y,i[2]=d-m,i[3]=0,i[4]=c-y,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+m,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,m=r*h;return e[0]=1-(d+p),e[1]=u+m,e[2]=c-v,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),m=h*(g*=v)-l*(p*=v),y=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(m*m+y*y+x*x))?(m*=v=1/v,y*=v,x*=v):(m=0,y=0,x=0);var w=p*x-g*y,T=g*m-f*x,b=f*y-p*m;return(v=Math.sqrt(w*w+T*T+b*b))?(w*=v=1/v,T*=v,b*=v):(w=0,T=0,b=0),n[0]=m,n[1]=w,n[2]=f,n[3]=0,n[4]=y,n[5]=T,n[6]=p,n[7]=0,n[8]=x,n[9]=b,n[10]=g,n[11]=0,n[12]=-(m*s+y*r+x*o),n[13]=-(w*s+T*r+b*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*n+v*o+m*l,e[5]=g*s+v*a+m*u,e[6]=y*i+x*r+w*h,e[7]=y*n+x*o+w*l,e[8]=y*s+x*a+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=n*h-s*a,w=n*l-r*a,T=n*u-o*a,b=s*l-r*h,_=s*u-o*h,S=r*u-o*l,A=c*v-d*g,C=c*m-f*g,M=c*y-p*g,P=d*m-f*v,E=d*y-p*v,L=f*y-p*m,F=x*L-w*E+T*P+b*M-_*C+S*A;return F?(F=1/F,i[0]=(h*L-l*E+u*P)*F,i[1]=(l*M-a*L-u*C)*F,i[2]=(a*E-h*M+u*A)*F,i[3]=(r*E-s*L-o*P)*F,i[4]=(n*L-r*M+o*C)*F,i[5]=(s*M-n*E-o*A)*F,i[6]=(v*S-m*_+y*b)*F,i[7]=(m*T-g*S-y*w)*F,i[8]=(g*_-v*T+y*x)*F,this):null}});t.exports=n},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e,i){var n=i(245);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),te-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)=0?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="txt";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"text",cache:t.cacheManager.text,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",function(t,e,i){if(Array.isArray(t))for(var n=0;n=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=this.threshold?this.pressed||(this.pressed=!0,this.events.emit("down",e,this,t),this.pad.emit("down",i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit("up",e,this,t),this.pad.emit("up",i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){t.exports={CircleToCircle:i(702),CircleToRectangle:i(701),GetRectangleIntersection:i(700),LineToCircle:i(273),LineToLine:i(107),LineToRectangle:i(699),PointToLine:i(272),PointToLineSegment:i(698),RectangleToRectangle:i(147),RectangleToTriangle:i(697),RectangleToValues:i(696),TriangleToCircle:i(695),TriangleToLine:i(694),TriangleToTriangle:i(693)}},function(t,e,i){t.exports={Circle:i(722),Ellipse:i(712),Intersects:i(274),Line:i(692),Point:i(674),Polygon:i(660),Rectangle:i(266),Triangle:i(631)}},function(t,e,i){var n=i(0),s=i(277),r=i(197),o=i(10),a=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1},enable:function(){return this.active=!0,this},disable:function(){return this.active=!1,this},cull:function(t){var e=this.lights,i=this.culledLights,n=e.length,s=t.x+t.width/2,o=t.y+t.height/2,a=(t.width+t.height)/2,h={x:0,y:0},l=t.matrix,u=this.systems.game.config.height;i.length=0;for(var c=0;c0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],r):h=new s(t,e,i,a[0],a[1],a[2],r),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=a},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t,e,i,n,s,r,o){this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1},set:function(t,e,i,n,s,r,o){return this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1,this},setScrollFactor:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this},setColor:function(t){var e=s.getFloatsFromUintRGB(t);return this.r=e[0],this.g=e[1],this.b=e[2],this},setIntensity:function(t){return this.intensity=t,this},setPosition:function(t,e){return this.x=t,this.y=e,this},setRadius:function(t){return this.radius=t,this}});t.exports=r},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e,i){var n=i(6),s=i(65);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(0),s=i(27),r=i(59),o=i(771),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),s.call(this,t,"Triangle",new r(n,o,a,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,s,r){return this.geom.setTo(t,e,i,n,s,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(774),s=i(0),r=i(64),o=i(27),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(65),s=i(54);t.exports=function(t){for(var e=t.points,i=0,r=0;rc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},function(t,e,i){var n=i(9);t.exports=function(t,e){void 0===e&&(e=new n);for(var i,s=1/0,r=1/0,o=-s,a=-r,h=0;h0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=i(66),s=i(0),r=i(14),o=i(302),a=i(301),h=i(821),l=i(2),u=i(161),c=i(299),d=i(85),f=i(304),p=i(298),g=i(9),v=i(110),m=i(3),y=i(53),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0),this.y=new h(e,"y",0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3),this.angle=new h(e,"angle",{min:0,max:360}),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0?n.pop():new this.particleClass(this)).fire(e,i),this.particleBringToTop?this.alive.push(r):this.alive.unshift(r),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,r,this),this.atLimit())break}return r}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);for(var n=this.manager.getProcessors(),s=this.alive,r=s.length,o=0;o0){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y},indexSortCallback:function(t,e){return t.index-e.index}});t.exports=x},function(t,e,i){var n=i(0),s=i(31),r=i(52),o=new n({initialize:function(t){this.emitter=t,this.frame=null,this.index=0,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint"),this.index=i.alive.length},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s>>16,y=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+m+","+y+","+x+","+d+")",c.lineWidth=v,w+=3;break;case n.FILL_STYLE:g=l[w+1],f=l[w+2],m=(16711680&g)>>>16,y=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+m+","+y+","+x+","+f+")",w+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[w+1],l[w+2],l[w+3],l[w+4]):c.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.fill(),w+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.stroke(),w+=6;break;case n.LINE_TO:c.lineTo(l[w+1],l[w+2]),w+=2;break;case n.MOVE_TO:c.moveTo(l[w+1],l[w+2]),w+=2;break;case n.LINE_FX_TO:c.lineTo(l[w+1],l[w+2]),w+=5;break;case n.MOVE_FX_TO:c.moveTo(l[w+1],l[w+2]),w+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[w+1],l[w+2]),w+=2;break;case n.SCALE:c.scale(l[w+1],l[w+2]),w+=2;break;case n.ROTATE:c.rotate(l[w+1]),w+=1;break;case n.GRADIENT_FILL_STYLE:w+=5;break;case n.GRADIENT_LINE_STYLE:w+=6;break;case n.SET_TEXTURE:w+=2}c.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var n=i(307),s=i(155),r=i(93),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(4),s=i(121),r=function(t,e,i){for(var n=[],s=0;sr;){if(o-r>600){var h=o-r+1,l=e-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*c/h+d)),p=Math.min(o,Math.floor(e+(h-l)*c/h+d));i(t,e,f,p,a)}var g=t[e],v=r,m=o;for(n(t,r,e),a(t[o],g)>0&&n(t,r,o);v0;)m--}0===a(t[r],g)?n(t,r,m):n(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}};function n(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function s(t,e){return te?1:0}t.exports=i},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s-1;r--)n[s][r]=t[r][s]}return n}},function(t,e,i){t.exports={AtlasXML:i(885),Canvas:i(884),Image:i(883),JSONArray:i(882),JSONHash:i(881),SpriteSheet:i(880),SpriteSheetFromAtlas:i(879),UnityYAML:i(878)}},function(t,e,i){var n=i(24),s=i(0),r=i(117),o=i(94),a=new s({initialize:function(t,e,i,n){var s=t.manager.game;this.renderer=s.renderer,this.texture=t,this.source=e,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.width||0,this.height=n||e.naturalHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isRenderTexture="RenderTexture"===e.type,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.init(s)},init:function(t){this.renderer&&(this.renderer.gl?this.isCanvas?this.glTexture=this.renderer.canvasToTexture(this.image):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=this.renderer.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.glTexture=this.renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t)},update:function(){if(this.renderer.gl&&this.isCanvas){this.glTexture=this.renderer.canvasToTexture(this.image,this.glTexture);for(var t=this.texture.getTextureSourceIndex(this),e=this.texture.getFramesFromTextureSource(t,!0),i=0;i=r.x&&t=r.y&&e=r.x&&t=r.y&&e0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit("resume",this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit("stop",this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,"rate",t)||(this.calculateRate(),this.emit("rate",this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,"detune",t)||(this.calculateRate(),this.emit("detune",this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit("loop",this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(115),s=i(0),r=i(324),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var n=0;n-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit("transitioninit",n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once("complete",this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},resize:function(t,e){for(var i=0;i=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e,i){var n=i(0),s=i(11),r=i(7),o=i(13),a=i(5),h=i(2),l=i(15),u=i(331),c=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once("boot",this.boot,this)},boot:function(){var t,e,i,n,s,r,o,a=this.game.config,l=a.installGlobalPlugins;for(l=l.concat(this._pendingGlobal),t=0;t10&&(t=10-this.pointersTotal);for(var i=0;i0},queueTouchStart:function(t){if(this.queue.push(s.TOUCH_START,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueTouchMove:function(t){if(this.queue.push(s.TOUCH_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueTouchEnd:function(t){if(this.queue.push(s.TOUCH_END,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},queueMouseDown:function(t){if(this.queue.push(s.MOUSE_DOWN,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueMouseMove:function(t){if(this.queue.push(s.MOUSE_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueMouseUp:function(t){if(this.queue.push(s.MOUSE_UP,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},addUpCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.upOnce.push(t):this.domCallbacks.up.push(t),this._hasUpCallback=!0,this},addDownCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.downOnce.push(t):this.domCallbacks.down.push(t),this._hasDownCallback=!0,this},addMoveCallback:function(t,e){return void 0===e&&(e=!1),e?this.domCallbacks.moveOnce.push(t):this.domCallbacks.move.push(t),this._hasMoveCallback=!0,this},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var n=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){n=!1;break}s=s.parentContainer}while(s);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;1!==i.resolution&&(a+=i._x,h+=i._y),i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this._tempMatrix,d=this._tempMatrix2,f=0;f1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e,i){var n=i(37);n.ColorToRGBA=i(914),n.ComponentToHex=i(347),n.GetColor=i(177),n.GetColor32=i(377),n.HexStringToColor=i(378),n.HSLToColor=i(913),n.HSVColorWheel=i(912),n.HSVToRGB=i(176),n.HueToComponent=i(346),n.IntegerToColor=i(375),n.IntegerToRGB=i(374),n.Interpolate=i(911),n.ObjectToColor=i(373),n.RandomRGB=i(910),n.RGBStringToColor=i(372),n.RGBToHSV=i(376),n.RGBToString=i(909),n.ValueToColor=i(178),t.exports=n},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(170),s=i(0),r=i(70),o=i(3),a=new s({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;ei;)n-=i;n16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(37),s=i(374);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(ef.right&&(p=u(p,p+(v-f.right),this.lerp.x)),mf.bottom&&(g=u(g,g+(m-f.bottom),this.lerp.y))):(p=u(p,v-l,this.lerp.x),g=u(g,m-c,this.lerp.y))}this.useBounds&&(p=this.clampX(p),g=this.clampY(g)),this.roundPixels&&(l=Math.round(l),c=Math.round(c)),this.scrollX=p,this.scrollY=g;var y=p+s,x=g+o;this.midPoint.set(y,x);var w=i/a,T=n/a;this.worldView.setTo(y-w/2,x-T/2,w,T),h.loadIdentity(),h.scale(e,e),h.translate(this.x+l,this.y+c),h.rotate(this.rotation),h.scale(a,a),h.translate(-l,-c),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(381),s=new(i(0))({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once("destroy",this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","text","html","obj","tilemap","xml"],e=0;ee.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=i(23),s=i(0),r=i(384),o=i(383),a=i(4),h=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,a(i,"frames",[]),a(i,"defaultTextureKey",null)),this.frameRate=a(i,"frameRate",null),this.duration=a(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=a(i,"skipMissedFrames",!0),this.delay=a(i,"delay",0),this.repeat=a(i,"repeat",0),this.repeatDelay=a(i,"repeatDelay",0),this.yoyo=a(i,"yoyo",!1),this.showOnStart=a(i,"showOnStart",!1),this.hideOnComplete=a(i,"hideOnComplete",!1),this.paused=!1,this.manager.on("pauseall",this.pause,this),this.manager.on("resumeall",this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=l[0],l[0].prevFrame=s;var v=1/(l.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),r(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);t._repeatDelay>0&&!1===t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay):(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter,t.parent)))},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off("pauseall",this.pause,this),this.manager.off("resumeall",this.resume,this),this.manager.remove(this.key);for(var t=0;t-h&&(c-=h,n+=l),f=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(16),s=i(38),r=i(200),o=i(199),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t}};t.exports=a},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){this.geometryMask=t},preRenderWebGL:function(t,e,i){var n=t.gl,s=this.geometryMask;t.flush(),n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.NOTEQUAL,1,1),n.stencilOp(n.REPLACE,n.REPLACE,n.REPLACE),s.renderWebGL(t,s,0,i),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilFunc(n.EQUAL,1,1),n.stencilOp(n.KEEP,n.KEEP,n.KEEP)},postRenderWebGL:function(t){var e=t.gl;t.flush(),e.disable(e.STENCIL_TEST)},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){var i=t.sys.game.renderer;if(this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,i&&i.gl){var n=i.width,s=i.height,r=0==(n&n-1)&&0==(s&s-1),o=i.gl,a=r?o.REPEAT:o.CLAMP_TO_EDGE,h=o.LINEAR;this.mainTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.maskTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.mainFramebuffer=i.createFramebuffer(n,s,this.mainTexture,!1),this.maskFramebuffer=i.createFramebuffer(n,s,this.maskTexture,!1),i.onContextRestored(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,o=s.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!1),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!1)},this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t){t.pipelines.BitmapMaskPipeline.endMask(this)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null;var t=this.renderer;t&&t.gl&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer)),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null,this.renderer=null}});t.exports=n},function(t,e,i){var n=i(395),s=i(394),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&this.texture&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*s-a*r+e,t.y=o*r+a*s+i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var n=i(190),s=i(123);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e,i){var n=i(23),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var n=i(403),s=i(192),r=i(93),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;i--){var n=Math.floor(this.frac()*(e+1)),s=t[n];t[n]=t[i],t[i]=s}return t}});t.exports=n},function(t,e,i){var n=i(192),s=i(93),r=i(16),o=i(6);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(44),s=i(42),r=i(43),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(46),s=i(42),r=i(45),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(42),r=i(74),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(44),r=i(73),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(72),s=i(46),r=i(73),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(74),s=i(73);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(412),s=i(75),r=i(72);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(48),s=i(44),r=i(47),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(75),r=i(47),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(193),s=[];s[n.BOTTOM_CENTER]=i(416),s[n.BOTTOM_LEFT]=i(415),s[n.BOTTOM_RIGHT]=i(414),s[n.CENTER]=i(413),s[n.LEFT_CENTER]=i(411),s[n.RIGHT_CENTER]=i(410),s[n.TOP_CENTER]=i(409),s[n.TOP_LEFT]=i(408),s[n.TOP_RIGHT]=i(407);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){t.exports={Angle:i(1049),Call:i(1048),GetFirst:i(1047),GetLast:i(1046),GridAlign:i(1045),IncAlpha:i(1034),IncX:i(1033),IncXY:i(1032),IncY:i(1031),PlaceOnCircle:i(1030),PlaceOnEllipse:i(1029),PlaceOnLine:i(1028),PlaceOnRectangle:i(1027),PlaceOnTriangle:i(1026),PlayAnimation:i(1025),PropertyValueInc:i(32),PropertyValueSet:i(25),RandomCircle:i(1024),RandomEllipse:i(1023),RandomLine:i(1022),RandomRectangle:i(1021),RandomTriangle:i(1020),Rotate:i(1019),RotateAround:i(1018),RotateAroundDistance:i(1017),ScaleX:i(1016),ScaleXY:i(1015),ScaleY:i(1014),SetAlpha:i(1013),SetBlendMode:i(1012),SetDepth:i(1011),SetHitArea:i(1010),SetOrigin:i(1009),SetRotation:i(1008),SetScale:i(1007),SetScaleX:i(1006),SetScaleY:i(1005),SetTint:i(1004),SetVisible:i(1003),SetX:i(1002),SetXY:i(1001),SetY:i(1e3),ShiftPosition:i(999),Shuffle:i(998),SmootherStep:i(997),SmoothStep:i(996),Spread:i(995),ToggleVisible:i(994),WrapInRectangle:i(993)}},,,function(t,e,i){var n=i(0),s=i(896),r=i(895),o=i(198),a=new n({Extends:o,initialize:function(t){o.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:t.topology?t.topology:t.renderer.gl.TRIANGLES,vertShader:t.vertShader?t.vertShader:r,fragShader:t.fragShader?t.fragShader:s,vertexCapacity:t.vertexCapacity?t.vertexCapacity:3,vertexSize:t.vertexSize?t.vertexSize:2*Float32Array.BYTES_PER_ELEMENT,vertices:new Float32Array([-1,1,-1,-7,7,1]).buffer,attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.maxQuads=1,this.resolutionDirty=!0},onBind:function(){o.prototype.onBind.call(this);var t=this.renderer,e=this.program;return this.resolutionDirty&&(t.setFloat2(e,"uResolution",this.width,this.height),t.setInt1(e,"uMainSampler",0),t.setInt1(e,"uMaskSampler",1),this.resolutionDirty=!1),this},resize:function(t,e,i){return o.prototype.resize.call(this,t,e,i),this.resolutionDirty=!0,this},beginMask:function(t,e,i){var n=this.renderer,s=this.gl,r=t.bitmapMask;r&&s&&(n.flush(),n.setFramebuffer(t.maskFramebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),r.renderWebGL(n,r,0,i),n.flush(),n.setFramebuffer(t.mainFramebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT))},endMask:function(t){var e=this.renderer,i=this.gl;t.bitmapMask&&i&&(e.setFramebuffer(null),e.setPipeline(this),e.setTexture2D(t.maskTexture,1),e.setTexture2D(t.mainTexture,0),e.setInt1(this.program,"uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3))}});t.exports=a},function(t,e){t.exports=function(t,e,i){e||(e="image/png"),i||(i=.92);var n=t.getContext("experimental-webgl"),s=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,s);var r,o=document.createElement("canvas"),a=o.getContext("2d");o.width=n.drawingBufferWidth,o.height=n.drawingBufferHeight;for(var h=(r=a.getImageData(0,0,o.width,o.height)).data,l=0;l0&&n>0&&s.scissor(t,this.drawingBufferHeight-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},setBlendMode:function(t){var e=this.gl,i=this.blendModes[t];return t!==r.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),i.func.length>2?e.blendFuncSeparate(i.func[0],i.func[1],i.func[2],i.func[3]):e.blendFunc(i.func[0],i.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>16&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e){var i=this.gl;return t!==this.currentTextures[e]&&(this.flush(),this.currentActiveTextureUnit!==e&&(i.activeTexture(i.TEXTURE0+e),this.currentActiveTextureUnit=e),i.bindTexture(i.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t){var e=this.gl,i=this.width,n=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(i=t.renderTexture.width,n=t.renderTexture.height):this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),e.viewport(0,0,i,n),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,a=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,o(e,i)&&(h=s.REPEAT),n===r.ScaleModes.LINEAR&&this.config.antialias&&(a=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,a,h,h,s.RGBA,t):this.createTexture2D(0,a,a,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&a(this.nativeTextures,e),this.gl.deleteTexture(t),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,s=t._ch,r=this.pipelines.TextureTintPipeline,o=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-s),this.setFramebuffer(t.framebuffer);var a=this.gl;a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),r.projOrtho(e,n+e,i,s+i,-1e3,1e3),o.alphaGL>0&&r.drawFillRect(e,i,n+e,s+i,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL),t.emit("prerender",t)}else this.pushScissor(e,i,n,s),o.alphaGL>0&&r.drawFillRect(e,i,n,s,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL)},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,l.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,l.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit("postrender",t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=l.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n in this.config.clearBeforeRender&&(t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)),t.enable(t.SCISSOR_TEST),i)i[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,o=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=0;l=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===y&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(m,y),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=u},function(t,e,i){var n=new(i(0))({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once("remove",this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,this._timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this._delay=0,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this.forward=!0,this._reverse=!1,this.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},setDelay:function(t){return void 0===t&&(t=0),this._delay=t,this.parent},getDelay:function(){return this._delay},delayedPlay:function(t,e,i){return this.play(e,!0,i),this.nextTick+=t,this.parent},getCurrentKey:function(){if(this.currentAnim)return this.currentAnim.key},load:function(t,e){return void 0===e&&(e=0),this.isPlaying&&this.stop(),this.animationManager.load(this,t,e),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.updateFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.updateFrame(t),this.parent},isPaused:{get:function(){return this._paused}},play:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!0,this._reverse=!1,this._startAnimation(t,i))},playReverse:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!1,this._reverse=!0,this._startAnimation(t,i))},_startAnimation:function(t,e){this.load(t,e);var i=this.currentAnim,n=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,i.showOnStart&&(n.visible=!0),n.emit("animationstart",this.currentAnim,this.currentFrame,n),n},reverse:function(t){return this.isPlaying&&this.currentAnim.key===t?(this._reverse=!this._reverse,this.forward=!this.forward,this.parent):this.parent},getProgress:function(){var t=this.currentFrame.progress;return this.forward||(t=1-t),t},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},remove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},getRepeat:function(){return this._repeat},setRepeat:function(t){return this._repeat=t,this.repeatCounter=0,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){void 0===t&&(t=!1),this.currentAnim.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(this.currentAnim.frames[0]);var e=this.parent;return e.emit("animationrestart",this.currentAnim,this.currentFrame,e),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent;return t.emit("animationcomplete",this.currentAnim,this.currentFrame,t),t},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopOnRepeat:function(){return this._pendingStop=2,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},setTimeScale:function(t){return void 0===t&&(t=1),this._timeScale=t,this.parent},getTimeScale:function(){return this._timeScale},getTotalFrames:function(){return this.currentAnim.frames.length},update:function(t,e){if(this.currentAnim&&this.isPlaying&&!this.currentAnim.paused){if(this.accumulator+=e*this._timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.currentAnim.completeAnimation(this);this.accumulator>=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit("animationupdate",i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off("remove",this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=n},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,function(t,i){return e[Number(i)-1]})}},function(t,e,i){t.exports={Format:i(429),Pad:i(179),Reverse:i(428),UppercaseFirst:i(328),UUID:i(296)}},function(t,e,i){var n=i(63);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)&&(i[s]=e[s]);return i}},function(t,e){t.exports=function(t,e){for(var i=0;i-1&&(e.state=a.REMOVED,s.splice(r,1)):(e.state=a.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e,i){var n=i(1),s=i(1);n=i(445),s=i(444),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,a.multiply(h,l));var u=t.currentContext,c=e.gidMap;u.save(),l.copyToContext(u);for(var d=n.alpha*e.alpha,f=0;f-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(20);t.exports=function(t){for(var e,i,s,r,o,a=0;a1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f>>0;return n}},function(t,e,i){var n=i(458),s=i(2),r=i(78),o=i(215),a=i(55);t.exports=function(t,e){for(var i=[],h=0;h0){var m=new a(u,v.gid,c,f.length,t.tilewidth,t.tileheight);m.rotation=v.rotation,m.flipX=v.flipped,d.push(m)}else{var y=e?null:new a(u,-1,c,f.length,t.tilewidth,t.tileheight);d.push(y)}++c===l.width&&(f.push(d),c=0,d=[])}u.data=f,i.push(u)}}return i}},function(t,e,i){t.exports={Parse:i(218),Parse2DArray:i(132),ParseCSV:i(217),Impact:i(211),Tiled:i(216)}},function(t,e,i){var n=i(50),s=i(49),r=i(3);t.exports=function(t,e,i,o,a,h){return void 0===o&&(o=new r(0,0)),o.x=n(t,i,a,h),o.y=s(e,i,a,h),o}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o){if(void 0!==r){var a,h=n(t,e,i,s,null,o),l=0;for(a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e,i){var n=i(56),s=i(34),r=i(85);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;ae)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(56),s=i(34),r=i(133);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=y;a--)for(o=v;o=y;a--)for(o=m;o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(101),s=i(100),r=i(17),o=i(221);t.exports=function(t,e,i,a,h,l){void 0===i&&(i={}),Array.isArray(t)||(t=[t]);var u=l.tilemapLayer;void 0===a&&(a=u.scene),void 0===h&&(h=a.cameras.main);var c,d=r(0,0,l.width,l.height,null,l),f=[];for(c=0;c=0&&p=0&&g=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("update",this.step,this),t.events.emit("transitioncomplete",this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i){return this.manager.add(t,e,i),this},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off("shutdown",this.shutdown,this),t.off("postupdate",this.step,this),t.off("transitionout")},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",a,"scenePlugin"),t.exports=a},function(t,e,i){var n=i(116),s=i(20),r={SceneManager:i(330),ScenePlugin:i(495),Settings:i(327),Systems:i(165)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(222),s=new(i(0))({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=s},function(t,e,i){t.exports={BasePlugin:i(222),DefaultPlugins:i(166),PluginCache:i(15),PluginManager:i(332),ScenePlugin:i(497)}},,,,,,,,,function(t,e,i){var n=i(230);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){var n=i(231);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(509);t.exports=function(t,e,i,s,r){var o=0;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y0&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom>i&&(o=t.bottom-i)>r&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:n(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(511);t.exports=function(t,e,i,s,r){var o=0;return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x0&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right>i&&(o=t.right-i)>r&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:n(t,o)),o}},function(t,e,i){var n=i(512),s=i(510),r=i(227);t.exports=function(t,e,i,o,a,h){var l=o.left,u=o.top,c=o.right,d=o.bottom,f=i.faceLeft||i.faceRight,p=i.faceTop||i.faceBottom;if(!f&&!p)return!1;var g=0,v=0,m=0,y=1;if(e.deltaAbsX()>e.deltaAbsY()?m=-1:e.deltaAbsX()=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l>i&&(n=h,i=l)}return n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(t,e)},shutdown:function(){if(this.world){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});u.register("ArcadePhysics",f,"arcadePhysics"),t.exports=f},function(t,e,i){var n=i(35),s=i(20),r={ArcadePhysics:i(527),Body:i(233),Collider:i(232),Factory:i(239),Group:i(236),Image:i(238),Sprite:i(104),StaticBody:i(226),StaticGroup:i(235),World:i(234)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(137),s=i(241),r=i(240),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o1?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t){for(var e=0,i=0;i0&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(295),IsSize:i(117),IsValue:i(549)}},function(t,e,i){var n=i(182);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(119);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return e<0?n(t[0],t[1],s):e>1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(170);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return t[0]===t[i]?(e<0&&(r=Math.floor(s=i*(1+e))),n(s-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(n(-s,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("update",this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit("progress",this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e,i){var n=i(0),s=i(11),r=i(4),o=i(106),a=i(257),h=i(142),l=i(256),u=i(602),c=i(601),d=i(600),f=i(141),p=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.keys=[],this.combos=[],this.queue=[],this.onKeyHandler,this.time=0,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.settings.input,e=this.scene.sys.game.config;this.enabled=r(t,"keyboard",e.inputKeyboard),this.target=r(t,"keyboard.target",e.inputKeyboardEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=function(e){if(!e.defaultPrevented&&t.isActive()){t.queue.push(e);var i=t.keys[e.keyCode];i&&i.preventDefault&&e.preventDefault()}};this.onKeyHandler=e,this.target.addEventListener("keydown",e,!1),this.target.addEventListener("keyup",e,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("keydown",this.onKeyHandler),this.target.removeEventListener("keyup",this.onKeyHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},createCursorKeys:function(){return this.addKeys({up:h.UP,down:h.DOWN,left:h.LEFT,right:h.RIGHT,space:h.SPACE,shift:h.SHIFT})},addKeys:function(t){var e={};if("string"==typeof t){t=t.split(",");for(var i=0;i-1?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new a(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);i>-1&&(this.keys[i]=void 0)}else"string"==typeof t&&(t=h[t.toUpperCase()]);e[t]&&(e[t]=void 0)},createCombo:function(t,e){return new l(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=f(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(t){this.time=t;var e=this.queue.length;if(this.enabled&&0!==e)for(var i=this.queue.splice(0,e),n=this.keys,s=0;s=e}}},function(t,e,i){var n=i(71),s=i(40),r=i(0),o=i(261),a=i(608),h=i(52),l=i(90),u=i(89),c=i(11),d=i(2),f=i(106),p=i(8),g=i(15),v=i(9),m=i(39),y=i(59),x=i(69),w=new r({Extends:c,initialize:function(t){c.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new c,this.enabled=!0,this.displayList,this.cameras,f.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once("destroy",this.destroy,this),this.pluginEvents.emit("boot")},start:function(){var t=this.systems.events;t.on("transitionstart",this.transitionIn,this),t.on("transitionout",this.transitionOut,this),t.on("transitioncomplete",this.transitionComplete,this),t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.enabled=!0,this.pluginEvents.emit("start")},preUpdate:function(){this.pluginEvents.emit("preUpdate");var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r-1&&(s.splice(a,1),this.clear(o))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},update:function(t,e){if(this.isActive()){this.pluginEvents.emit("update",t,e);var i=this.manager;if(!i.globalTopOnly||!i.ignoreEvents){var n=i.dirty||0===this.pollRate;if(this.pollRate>-1&&(this._pollTimer-=e,this._pollTimer<0&&(n=!0,this._pollTimer=this.pollRate)),n)for(var s=this.manager.pointers,r=0;r0&&i.globalTopOnly&&(i.ignoreEvents=!0)}}}},clear:function(t){var e=t.input;if(e){this.queueForRemoval(t),e.gameObject=void 0,e.target=void 0,e.hitArea=void 0,e.hitAreaCallback=void 0,e.callbackContext=void 0,this.manager.resetCursor(e),t.input=null;var i=this._draggable.indexOf(t);return i>-1&&this._draggable.splice(i,1),(i=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(i,1),(i=this._over[0].indexOf(t))>-1&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0?t.dragState=1:t.dragState>0&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i1&&(this.sortGameObjects(a),this.topOnly&&a.splice(1)),this._drag[t.id]=a,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(this.dragDistanceThreshold>0&&h(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),this.dragTimeThreshold>0&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(s=this._drag[t.id],i=0;i0?(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),l[0]?(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):r.target=null)}else!r.target&&l[0]&&(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target));var c=t.x-n.input.dragX,d=t.y-n.input.dragY;n.emit("drag",t,c,d),this.emit("drag",t,n,c,d)}return s.length}if(5===t.dragState){for(s=this._drag[t.id],i=0;i0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return a(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,a=!1;if(p(e)){var h=e;e=d(h,"hitArea",null),i=d(h,"hitAreaCallback",null),n=d(h,"draggable",!1),s=d(h,"dropZone",!1),r=d(h,"cursor",!1),a=d(h,"useHandCursor",!1);var l=d(h,"pixelPerfect",!1),u=d(h,"alphaTolerance",1);l&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)e.x&&t.ye.y}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),s=Math.max(t.right,e);t.x=n,t.width=s-n;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var s=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=s,t.height=r-s,t}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;on(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){var n=i(144);t.exports=function(t,e){var i=n(t);return ii&&(i=h.x),h.xr&&(r=h.y),h.ye.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e,i){var n=i(69),s=i(107);t.exports=function(t,e){return!!(n(t,e.getPointA())||n(t,e.getPointB())||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},function(t,e,i){var n=i(273),s=i(69);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottomt.right+r||it.bottom+r||st.right||e.rightt.bottom||e.bottom0}},function(t,e,i){var n=i(272);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(9),s=i(147);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){var n=i(52);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(89);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(89);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(90);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(90);n.Area=i(711),n.Circumference=i(307),n.CircumferencePoint=i(155),n.Clone=i(710),n.Contains=i(89),n.ContainsPoint=i(709),n.ContainsRect=i(708),n.CopyFrom=i(707),n.Equals=i(706),n.GetBounds=i(705),n.GetPoint=i(309),n.GetPoints=i(308),n.Offset=i(704),n.OffsetPoint=i(703),n.Random=i(185),t.exports=n},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e,i){var n=i(40);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(40);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(71);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(71);n.Area=i(721),n.Circumference=i(403),n.CircumferencePoint=i(192),n.Clone=i(720),n.Contains=i(40),n.ContainsPoint=i(719),n.ContainsRect=i(718),n.CopyFrom=i(717),n.Equals=i(716),n.GetBounds=i(715),n.GetPoint=i(406),n.GetPoints=i(404),n.Offset=i(714),n.OffsetPoint=i(713),n.Random=i(191),t.exports=n},function(t,e,i){var n=i(0),s=i(276),r=i(15),o=new n({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once("boot",this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on("shutdown",this.shutdown,this),t.on("destroy",this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(148);s.register("quad",function(t,e){void 0===t&&(t={});var i=r(t,"x",0),s=r(t,"y",0),a=r(t,"key",null),h=r(t,"frame",null),l=new o(this.scene,i,s,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l})},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(4),a=i(108);s.register("mesh",function(t,e){void 0===t&&(t={});var i=r(t,"key",null),s=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"colors",[]),u=o(t,"alphas",[]),c=o(t,"uv",[]),d=new a(this.scene,0,0,h,c,l,u,i,s);return void 0!==e&&(t.add=e),n(this.scene,d,t),d})},function(t,e,i){var n=i(148);i(5).register("quad",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(108);i(5).register("mesh",function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))})},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=this.pipeline;t.setPipeline(o,e);var a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.frame.glTexture,c=e.vertices,d=e.uv,f=e.colors,p=e.alphas,g=c.length,v=Math.floor(.5*g);o.vertexCount+v>=o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var m=o.vertexViewF32,y=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,w=0,T=e.tintFill,b=0;b0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0){var F=o.strokeTint,k=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(F.TL=k,F.TR=k,F.BL=k,F.BR=k,C=1;Cr;h--){for(l=0;l0&&r.maxLines1&&(d+=f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(4);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,m={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},y=0,x=0;x?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(812),s=i(20),r={Parse:i(811)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r),t.setBlankTexture(!0)}},function(t,e,i){var n=i(1),s=i(1);n=i(815),s=i(814),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(302),EdgeZone:i(301),RandomZone:i(298)}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.emitters.list,o=r.length;if(0!==o){var a=t._tempMatrix1.copyFrom(n.matrix),h=t._tempMatrix2,l=t._tempMatrix3,u=t._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);a.multiply(u);var c=n.roundPixels,d=t.currentContext;d.save();for(var f=0;f0&&(Y=Y%b-b):Y>b?Y=b:Y<0&&(Y=b+Y%b),null===C&&(C=new o(O+Math.cos(B)*I,D+Math.sin(B)*I,v),_.push(C),R+=.01);R<1+z;)T=Y*R+B,x=O+Math.cos(T)*I,w=D+Math.sin(T)*I,C.points.push(new r(x,w,v)),R+=.01;T=Y+B,x=O+Math.cos(T)*I,w=D+Math.sin(T)*I,C.points.push(new r(x,w,v));break;case n.FILL_RECT:u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==C?C.points.push(new r(p[++P],p[++P],v)):(C=new o(p[++P],p[++P],v),_.push(C));break;case n.MOVE_TO:C=new o(p[++P],p[++P],v),_.push(C);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:O=p[++P],D=p[++P],f.translate(O,D);break;case n.SCALE:O=p[++P],D=p[++P],f.scale(O,D);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var N=p[++P],U=p[++P];u.currentFrame=N,t.setTexture2D(N.glTexture,0),u.tintEffect=U;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,t.setTexture2D(t.blankTexture.glTexture,0),u.tintEffect=2}}}},function(t,e,i){var n=i(1),s=i(1);n=i(829),s=i(306),s=i(306),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(22);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length,h=t.currentContext;if(0!==a&&n(t,h,e,s,r)){var l=e.frame,u=e.displayCallback,c=s.scrollX*e.scrollFactorX,d=s.scrollY*e.scrollFactorY,f=e.fontData.chars,p=e.fontData.lineHeight,g=0,v=0,m=0,y=0,x=null,w=0,T=0,b=0,_=0,S=0,A=0,C=null,M=0,P=e.frame.source.image,E=l.cutX,L=l.cutY,F=0,k=e.fontSize/e.fontData.size;e.cropWidth>0&&e.cropHeight>0&&(h.save(),h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var R=0;R0&&e.cropHeight>0&&h.restore(),h.restore()}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length;if(0!==a){var h=this.pipeline;t.setPipeline(h,e);var l=e.cropWidth>0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,m=p.cutY,y=g.width,x=g.height,w=e._isTinted&&e.tintFill,T=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),b=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),_=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),S=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var A,C,M=0,P=0,E=0,L=0,F=e.letterSpacing,k=0,R=0,O=0,D=0,I=e.scrollX,B=e.scrollY,Y=e.fontData,X=Y.chars,z=Y.lineHeight,N=e.fontSize/Y.size,U=0,G=e._align,W=0,V=0;e.getTextBounds(!1);var H=e._bounds.lines;1===G?V=(H.longest-H.lengths[0])/2:2===G&&(V=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;Jv&&(r=v),o>m&&(o=m);var L=v+g.xAdvance,F=m+u;aA&&(A=M),MA&&(A=M),M-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;i0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e,i){var n=i(91);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return n(t,s)}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(s)for(var h=0;ht.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){var n=i(315);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],r=Math.max(n((e-t)/(i||1)),0),o=0;o=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var o=s;o0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t},tick:function(){this.step(window.performance.now())},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime=window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step(window.performance.now())},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e){var i=0,n=function(t,e,n,s){var r=i-s.y-s.height;t.add(n,e,s.x,r,s.width,s.height)};t.exports=function(t,e,s){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height),i=r.height;for(var o=s.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;cx||a<-x)&&(a=0),a<0&&(a=x+a),-1!==h&&(x=a+(h+1));for(var C=l,M=l,P=0,E=e.sourceIndex,L=0;Lg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,m=f,y=0,x=0,w=0;wr&&(y=T-r),b>o&&(x=b-o),t.add(w,e,i+v,s+m,h-y,l-x),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);var r,o=i.frames;for(var a in o){var h=o[a];r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted()),r.customData=n(h)}for(var l in i)"frames"!==l&&(Array.isArray(i[l])?t.customData[l]=i[l].slice(0):t.customData[l]=i[l]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames||i.textures){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e,i){var n=i(92),s=i(118),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),n.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},function(t,e,i){var n=i(0),s=i(26),r=i(341),o=i(2),a=i(4),h=i(8),l=i(16),u=i(1),c=i(166),d=i(178),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",null),this.scaleMode=a(t,"scaleMode",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND.init(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.autoResize=a(i,"autoResize",!0),this.antialias=a(i,"antialias",!0),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",!1),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){var n=i(168),s=i(382),r=i(380),o=i(24),a=i(0),h=i(902),l=i(897),u=i(122),c=i(890),d=i(341),f=i(345),p=i(11),g=i(339),v=i(15),m=i(332),y=i(330),x=i(326),w=i(319),T=i(877),b=i(876),_=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new p,this.anims=new s(this),this.textures=new w(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new y(this,this.config.sceneConfig),this.device=d,this.sound=x.create(this),this.loop=new T(this,this.config.fps),this.plugins=new m(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){v.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),l(this),c(this),n(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("texturesready",this.texturesReady,this)):console.warn("Core Phaser Plugins missing. Cannot start.")},texturesReady:function(){this.events.emit("ready"),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),b(this);var t=this.events;t.on("hidden",this.onHidden,this),t.on("visible",this.onVisible,this),t.on("blur",this.onBlur,this),t.on("focus",this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e);var n=this.renderer;n.preRender(),i.emit("prerender",n,t,e),this.scene.render(n),n.postRender(),i.emit("postrender",n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e),i.emit("prerender"),i.emit("postrender")},onHidden:function(){this.loop.pause(),this.events.emit("pause")},onVisible:function(){this.loop.resume(),this.events.emit("resume")},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},resize:function(t,e){this.config.width=t,this.config.height=e,this.renderer.resize(t,e),this.input.resize(),this.scene.resize(t,e),this.events.emit("resize",t,e)},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit("destroy"),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=_},function(t,e,i){var n=i(0),s=i(11),r=i(15),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){t.exports={EventEmitter:i(904)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c1)for(var i=1;i>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e){t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(i){t.style[i+"user-select"]=e}),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e,i){t.exports={CanvasInterpolation:i(349),CanvasPool:i(24),Smoothing:i(175),TouchAction:i(916),UserSelect:i(915)}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e,i){t.exports={CenterOn:i(412),GetBottom:i(48),GetCenterX:i(75),GetCenterY:i(72),GetLeft:i(46),GetOffsetX:i(919),GetOffsetY:i(918),GetRight:i(44),GetTop:i(42),SetBottom:i(47),SetCenterX:i(74),SetCenterY:i(73),SetLeft:i(45),SetRight:i(43),SetTop:i(41)}},function(t,e,i){var n=i(44),s=i(42),r=i(47),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(46),s=i(42),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(42),r=i(47),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(44),s=i(42),r=i(45),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(44),r=i(73),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(44),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(46),s=i(42),r=i(43),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(46),r=i(73),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(47),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(44),r=i(43),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(45),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(75),r=i(74),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){t.exports={BottomCenter:i(932),BottomLeft:i(931),BottomRight:i(930),LeftBottom:i(929),LeftCenter:i(928),LeftTop:i(927),RightBottom:i(926),RightCenter:i(925),RightTop:i(924),TopCenter:i(923),TopLeft:i(922),TopRight:i(921)}},function(t,e,i){t.exports={BottomCenter:i(416),BottomLeft:i(415),BottomRight:i(414),Center:i(413),LeftCenter:i(411),QuickSet:i(417),RightCenter:i(410),TopCenter:i(409),TopLeft:i(408),TopRight:i(407)}},function(t,e,i){var n=i(193),s=i(20),r={In:i(934),To:i(933)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(935),Bounds:i(920),Canvas:i(917),Color:i(348),Masks:i(908)}},function(t,e,i){var n=i(0),s=i(122),r=i(15),o=new n({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.events=this.systems.events,this.events.once("destroy",this.destroy,this)},start:function(){this.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},function(t,e,i){t.exports={DataManager:i(122),DataManagerPlugin:i(937)}},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},function(t,e,i){var n=i(0),s=i(356),r=i(354),o=i(5),a=i(353),h=i(939),l=i(352),u=i(9),c=i(350),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e0&&(h.preRender(r,o),t.render(n,e,i,h))}},resetAll:function(){for(var t=0;t=1?1:1/e*(1+(e*t|0))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e,i){var n=i(23),s=i(0),r=i(3),o=i(173),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new r,this.current=new r,this.destination=new r,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,a){void 0===i&&(i=1e3),void 0===n&&(n=o.Linear),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning?h:(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(h.scrollX,h.scrollY),this.destination.set(t,e),h.getScroll(t,e,this.current),"string"==typeof n&&o.hasOwnProperty(n)?this.ease=o[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=a,this.camera.emit("camerapanstart",this.camera,this,i,t,e),h)},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=s(t,"speed.x",0),this.speedY=s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={FixedKeyControl:i(988),SmoothedKeyControl:i(987)}},function(t,e,i){t.exports={Controls:i(989),Scene2D:i(986)}},function(t,e,i){t.exports={BaseCache:i(381),CacheManager:i(380)}},function(t,e,i){t.exports={Animation:i(385),AnimationFrame:i(383),AnimationManager:i(382)}},function(t,e,i){var n=i(53);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){var i={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=i},function(t,e){var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.frame.realWidth},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return this.scaleY*this.frame.realHeight},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){var n=i(94),s={_scaleMode:n.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==n.LINEAR&&t!==n.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=s},function(t,e){var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=Math.round(this.originX*this.width),this._displayOriginY=Math.round(this.originY*this.height),this}};t.exports=i},function(t,e,i){var n=i(9),s=i(397),r=i(3),o={getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getTopRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBounds:function(t){var e,i,s,r,o,a,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),s=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,s,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,s,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e,i){var n=i(417),s=i(193),r=i(2),o=i(1),a=new(i(124))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=r(e,"width",-1),o=r(e,"height",-1),h=r(e,"cellWidth",1),l=r(e,"cellHeight",h),u=r(e,"position",s.TOP_LEFT),c=r(e,"x",0),d=r(e,"y",0),f=0,p=0,g=i*h,v=o*l;a.setPosition(c,d),a.setSize(h,l);for(var m=0;m>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * @namespace Phaser.Tilemaps.Formats - */ - -module.exports = { - - /** - * CSV Map Type - * - * @name Phaser.Tilemaps.Formats.CSV - * @type {number} - * @since 3.0.0 - */ - CSV: 0, - - /** - * Tiled JSON Map Type - * - * @name Phaser.Tilemaps.Formats.TILED_JSON - * @type {number} - * @since 3.0.0 - */ - TILED_JSON: 1, - - /** - * 2D Array Map Type - * - * @name Phaser.Tilemaps.Formats.ARRAY_2D - * @type {number} - * @since 3.0.0 - */ - ARRAY_2D: 2, - - /** - * Weltmeister (Impact.js) Map Type - * - * @name Phaser.Tilemaps.Formats.WELTMEISTER - * @type {number} - * @since 3.0.0 - */ - WELTMEISTER: 3 - -}; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var Class = __webpack_require__(0); -var Components = __webpack_require__(16); -var GameObject = __webpack_require__(17); -var Line = __webpack_require__(60); - -/** - * @classdesc - * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. - * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. - * - * @class Shape - * @extends Phaser.GameObjects.GameObject - * @memberOf Phaser.GameObjects - * @constructor - * @since 3.13.0 - * - * @extends Phaser.GameObjects.Components.Alpha - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.ComputedSize - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param {string} [type] - The internal type of the Shape. - * @param {any} [data] - The data of the source shape geometry, if any. - */ -var Shape = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Alpha, - Components.BlendMode, - Components.ComputedSize, - Components.Depth, - Components.GetBounds, - Components.Mask, - Components.Origin, - Components.Pipeline, - Components.ScaleMode, - Components.ScrollFactor, - Components.Transform, - Components.Visible - ], - - initialize: - - function Shape (scene, type, data) - { - if (type === undefined) { type = 'Shape'; } - - GameObject.call(this, scene, type); - - /** - * The source Shape data. Typically a geometry object. - * You should not manipulate this directly. - * - * @name Phaser.GameObjects.Shape#data - * @type {any} - * @readonly - * @since 3.13.0 - */ - this.geom = data; - - /** - * Holds the polygon path data for filled rendering. - * - * @name Phaser.GameObjects.Shape#pathData - * @type {number[]} - * @readonly - * @since 3.13.0 - */ - this.pathData = []; - - /** - * Holds the earcut polygon path index data for filled rendering. - * - * @name Phaser.GameObjects.Shape#pathIndexes - * @type {integer[]} - * @readonly - * @since 3.13.0 - */ - this.pathIndexes = []; - - /** - * The fill color used by this Shape. - * - * @name Phaser.GameObjects.Shape#fillColor - * @type {number} - * @since 3.13.0 - */ - this.fillColor = 0xffffff; - - /** - * The fill alpha value used by this Shape. - * - * @name Phaser.GameObjects.Shape#fillAlpha - * @type {number} - * @since 3.13.0 - */ - this.fillAlpha = 1; - - /** - * The stroke color used by this Shape. - * - * @name Phaser.GameObjects.Shape#strokeColor - * @type {number} - * @since 3.13.0 - */ - this.strokeColor = 0xffffff; - - /** - * The stroke alpha value used by this Shape. - * - * @name Phaser.GameObjects.Shape#strokeAlpha - * @type {number} - * @since 3.13.0 - */ - this.strokeAlpha = 1; - - /** - * The stroke line width used by this Shape. - * - * @name Phaser.GameObjects.Shape#lineWidth - * @type {number} - * @since 3.13.0 - */ - this.lineWidth = 1; - - /** - * Controls if this Shape is filled or not. - * Note that some Shapes do not support being filled (such as Line shapes) - * - * @name Phaser.GameObjects.Shape#isFilled - * @type {boolean} - * @since 3.13.0 - */ - this.isFilled = false; - - /** - * Controls if this Shape is stroked or not. - * Note that some Shapes do not support being stroked (such as Iso Box shapes) - * - * @name Phaser.GameObjects.Shape#isStroked - * @type {boolean} - * @since 3.13.0 - */ - this.isStroked = false; - - /** - * Controls if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - * - * @name Phaser.GameObjects.Shape#closePath - * @type {boolean} - * @since 3.13.0 - */ - this.closePath = true; - - /** - * Private internal value. - * A Line used when parsing internal path data to avoid constant object re-creation. - * - * @name Phaser.GameObjects.Curve#_tempLine - * @type {Phaser.Geom.Line} - * @private - * @since 3.13.0 - */ - this._tempLine = new Line(); - - this.initPipeline(); - }, - - /** - * Sets the fill color and alpha for this Shape. - * - * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. - * - * Note that some Shapes do not support fill colors, such as the Line shape. - * - * This call can be chained. - * - * @method Phaser.GameObjects.Shape#setFillStyle - * @since 3.13.0 - * - * @param {number} [color] - The color used to fill this shape. If not provided the Shape will not be filled. - * @param {number} [alpha=1] - The alpha value used when filling this shape, if a fill color is given. - * - * @return {this} This Game Object instance. - */ - setFillStyle: function (color, alpha) - { - if (alpha === undefined) { alpha = 1; } - - if (color === undefined) - { - this.isFilled = false; - } - else - { - this.fillColor = color; - this.fillAlpha = alpha; - this.isFilled = true; - } - - return this; - }, - - /** - * Sets the stroke color and alpha for this Shape. - * - * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. - * - * Note that some Shapes do not support being stroked, such as the Iso Box shape. - * - * This call can be chained. - * - * @method Phaser.GameObjects.Shape#setStrokeStyle - * @since 3.13.0 - * - * @param {number} [color] - The color used to stroke this shape. If not provided the Shape will not be stroked. - * @param {number} [alpha=1] - The alpha value used when stroking this shape, if a stroke color is given. - * - * @return {this} This Game Object instance. - */ - setStrokeStyle: function (lineWidth, color, alpha) - { - if (alpha === undefined) { alpha = 1; } - - if (lineWidth === undefined) - { - this.isStroked = false; - } - else - { - this.lineWidth = lineWidth; - this.strokeColor = color; - this.strokeAlpha = alpha; - this.isStroked = true; - } - - return this; - }, - - /** - * Sets if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - * - * This call can be chained. - * - * @method Phaser.GameObjects.Shape#setClosePath - * @since 3.13.0 - * - * @param {boolean} value - Set to `true` if the Shape should be closed when stroked, otherwise `false`. - * - * @return {this} This Game Object instance. - */ - setClosePath: function (value) - { - this.closePath = value; - - return this; - }, - - /** - * Internal destroy handler, called as part of the destroy process. - * - * @method Phaser.GameObjects.Shape#preDestroy - * @protected - * @since 3.13.0 - */ - preDestroy: function () - { - this.geom = null; - this._tempLine = null; - this.pathData = []; - this.pathIndexes = []; - } - -}); - -module.exports = Shape; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var BlendModes = __webpack_require__(72); -var GetAdvancedValue = __webpack_require__(13); -var ScaleModes = __webpack_require__(104); - -/** - * @typedef {object} GameObjectConfig - * - * @property {number} [x=0] - The x position of the Game Object. - * @property {number} [y=0] - The y position of the Game Object. - * @property {number} [depth=0] - The depth of the GameObject. - * @property {boolean} [flipX=false] - The horizontally flipped state of the Game Object. - * @property {boolean} [flipY=false] - The vertically flipped state of the Game Object. - * @property {?(number|object)} [scale=null] - The scale of the GameObject. - * @property {?(number|object)} [scrollFactor=null] - The scroll factor of the GameObject. - * @property {number} [rotation=0] - The rotation angle of the Game Object, in radians. - * @property {?number} [angle=null] - The rotation angle of the Game Object, in degrees. - * @property {number} [alpha=1] - The alpha (opacity) of the Game Object. - * @property {?(number|object)} [origin=null] - The origin of the Game Object. - * @property {number} [scaleMode=ScaleModes.DEFAULT] - The scale mode of the GameObject. - * @property {number} [blendMode=BlendModes.DEFAULT] - The blend mode of the GameObject. - * @property {boolean} [visible=true] - The visible state of the Game Object. - * @property {boolean} [add=true] - Add the GameObject to the scene. - */ - -/** - * Builds a Game Object using the provided configuration object. - * - * @function Phaser.GameObjects.BuildGameObject - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene. - * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. - * @param {GameObjectConfig} config - The config to build the GameObject with. - * - * @return {Phaser.GameObjects.GameObject} The built Game Object. - */ -var BuildGameObject = function (scene, gameObject, config) -{ - // Position - - gameObject.x = GetAdvancedValue(config, 'x', 0); - gameObject.y = GetAdvancedValue(config, 'y', 0); - gameObject.depth = GetAdvancedValue(config, 'depth', 0); - - // Flip - - gameObject.flipX = GetAdvancedValue(config, 'flipX', false); - gameObject.flipY = GetAdvancedValue(config, 'flipY', false); - - // Scale - // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} - - var scale = GetAdvancedValue(config, 'scale', null); - - if (typeof scale === 'number') - { - gameObject.setScale(scale); - } - else if (scale !== null) - { - gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); - gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); - } - - // ScrollFactor - // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} - - var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); - - if (typeof scrollFactor === 'number') - { - gameObject.setScrollFactor(scrollFactor); - } - else if (scrollFactor !== null) - { - gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); - gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); - } - - // Rotation - - gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); - - var angle = GetAdvancedValue(config, 'angle', null); - - if (angle !== null) - { - gameObject.angle = angle; - } - - // Alpha - - gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); - - // Origin - // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} - - var origin = GetAdvancedValue(config, 'origin', null); - - if (typeof origin === 'number') - { - gameObject.setOrigin(origin); - } - else if (origin !== null) - { - var ox = GetAdvancedValue(origin, 'x', 0.5); - var oy = GetAdvancedValue(origin, 'y', 0.5); - - gameObject.setOrigin(ox, oy); - } - - // ScaleMode - - gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT); - - // BlendMode - - gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); - - // Visible - - gameObject.visible = GetAdvancedValue(config, 'visible', true); - - // Add to Scene - - var add = GetAdvancedValue(config, 'add', true); - - if (add) - { - scene.sys.displayList.add(gameObject); - } - - if (gameObject.preUpdate) - { - scene.sys.updateList.add(gameObject); - } - - return gameObject; -}; - -module.exports = BuildGameObject; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports) { - -/** -* The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB). -* -* @class Bounds -*/ - -var Bounds = {}; - -module.exports = Bounds; - -(function() { - - /** - * Creates a new axis-aligned bounding box (AABB) for the given vertices. - * @method create - * @param {vertices} vertices - * @return {bounds} A new bounds object - */ - Bounds.create = function(vertices) { - var bounds = { - min: { x: 0, y: 0 }, - max: { x: 0, y: 0 } - }; - - if (vertices) - Bounds.update(bounds, vertices); - - return bounds; - }; - - /** - * Updates bounds using the given vertices and extends the bounds given a velocity. - * @method update - * @param {bounds} bounds - * @param {vertices} vertices - * @param {vector} velocity - */ - Bounds.update = function(bounds, vertices, velocity) { - bounds.min.x = Infinity; - bounds.max.x = -Infinity; - bounds.min.y = Infinity; - bounds.max.y = -Infinity; - - for (var i = 0; i < vertices.length; i++) { - var vertex = vertices[i]; - if (vertex.x > bounds.max.x) bounds.max.x = vertex.x; - if (vertex.x < bounds.min.x) bounds.min.x = vertex.x; - if (vertex.y > bounds.max.y) bounds.max.y = vertex.y; - if (vertex.y < bounds.min.y) bounds.min.y = vertex.y; - } - - if (velocity) { - if (velocity.x > 0) { - bounds.max.x += velocity.x; - } else { - bounds.min.x += velocity.x; - } - - if (velocity.y > 0) { - bounds.max.y += velocity.y; - } else { - bounds.min.y += velocity.y; - } - } - }; - - /** - * Returns true if the bounds contains the given point. - * @method contains - * @param {bounds} bounds - * @param {vector} point - * @return {boolean} True if the bounds contain the point, otherwise false - */ - Bounds.contains = function(bounds, point) { - return point.x >= bounds.min.x && point.x <= bounds.max.x - && point.y >= bounds.min.y && point.y <= bounds.max.y; - }; - - /** - * Returns true if the two bounds intersect. - * @method overlaps - * @param {bounds} boundsA - * @param {bounds} boundsB - * @return {boolean} True if the bounds overlap, otherwise false - */ - Bounds.overlaps = function(boundsA, boundsB) { - return (boundsA.min.x <= boundsB.max.x && boundsA.max.x >= boundsB.min.x - && boundsA.max.y >= boundsB.min.y && boundsA.min.y <= boundsB.max.y); - }; - - /** - * Translates the bounds by the given vector. - * @method translate - * @param {bounds} bounds - * @param {vector} vector - */ - Bounds.translate = function(bounds, vector) { - bounds.min.x += vector.x; - bounds.max.x += vector.x; - bounds.min.y += vector.y; - bounds.max.y += vector.y; - }; - - /** - * Shifts the bounds to the given position. - * @method shift - * @param {bounds} bounds - * @param {vector} position - */ - Bounds.shift = function(bounds, position) { - var deltaX = bounds.max.x - bounds.min.x, - deltaY = bounds.max.y - bounds.min.y; - - bounds.min.x = position.x; - bounds.max.x = position.x + deltaX; - bounds.min.y = position.y; - bounds.max.y = position.y + deltaY; - }; - -})(); - - -/***/ }), -/* 33 */ -/***/ (function(module, exports) { - -/** -* The `Matter.Vector` module contains methods for creating and manipulating vectors. -* Vectors are the basis of all the geometry related operations in the engine. -* A `Matter.Vector` object is of the form `{ x: 0, y: 0 }`. -* -* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). -* -* @class Vector -*/ - -// TODO: consider params for reusing vector objects - -var Vector = {}; - -module.exports = Vector; - -(function() { - - /** - * Creates a new vector. - * @method create - * @param {number} x - * @param {number} y - * @return {vector} A new vector - */ - Vector.create = function(x, y) { - return { x: x || 0, y: y || 0 }; - }; - - /** - * Returns a new vector with `x` and `y` copied from the given `vector`. - * @method clone - * @param {vector} vector - * @return {vector} A new cloned vector - */ - Vector.clone = function(vector) { - return { x: vector.x, y: vector.y }; - }; - - /** - * Returns the magnitude (length) of a vector. - * @method magnitude - * @param {vector} vector - * @return {number} The magnitude of the vector - */ - Vector.magnitude = function(vector) { - return Math.sqrt((vector.x * vector.x) + (vector.y * vector.y)); - }; - - /** - * Returns the magnitude (length) of a vector (therefore saving a `sqrt` operation). - * @method magnitudeSquared - * @param {vector} vector - * @return {number} The squared magnitude of the vector - */ - Vector.magnitudeSquared = function(vector) { - return (vector.x * vector.x) + (vector.y * vector.y); - }; - - /** - * Rotates the vector about (0, 0) by specified angle. - * @method rotate - * @param {vector} vector - * @param {number} angle - * @param {vector} [output] - * @return {vector} The vector rotated about (0, 0) - */ - Vector.rotate = function(vector, angle, output) { - var cos = Math.cos(angle), sin = Math.sin(angle); - if (!output) output = {}; - var x = vector.x * cos - vector.y * sin; - output.y = vector.x * sin + vector.y * cos; - output.x = x; - return output; - }; - - /** - * Rotates the vector about a specified point by specified angle. - * @method rotateAbout - * @param {vector} vector - * @param {number} angle - * @param {vector} point - * @param {vector} [output] - * @return {vector} A new vector rotated about the point - */ - Vector.rotateAbout = function(vector, angle, point, output) { - var cos = Math.cos(angle), sin = Math.sin(angle); - if (!output) output = {}; - var x = point.x + ((vector.x - point.x) * cos - (vector.y - point.y) * sin); - output.y = point.y + ((vector.x - point.x) * sin + (vector.y - point.y) * cos); - output.x = x; - return output; - }; - - /** - * Normalises a vector (such that its magnitude is `1`). - * @method normalise - * @param {vector} vector - * @return {vector} A new vector normalised - */ - Vector.normalise = function(vector) { - var magnitude = Vector.magnitude(vector); - if (magnitude === 0) - return { x: 0, y: 0 }; - return { x: vector.x / magnitude, y: vector.y / magnitude }; - }; - - /** - * Returns the dot-product of two vectors. - * @method dot - * @param {vector} vectorA - * @param {vector} vectorB - * @return {number} The dot product of the two vectors - */ - Vector.dot = function(vectorA, vectorB) { - return (vectorA.x * vectorB.x) + (vectorA.y * vectorB.y); - }; - - /** - * Returns the cross-product of two vectors. - * @method cross - * @param {vector} vectorA - * @param {vector} vectorB - * @return {number} The cross product of the two vectors - */ - Vector.cross = function(vectorA, vectorB) { - return (vectorA.x * vectorB.y) - (vectorA.y * vectorB.x); - }; - - /** - * Returns the cross-product of three vectors. - * @method cross3 - * @param {vector} vectorA - * @param {vector} vectorB - * @param {vector} vectorC - * @return {number} The cross product of the three vectors - */ - Vector.cross3 = function(vectorA, vectorB, vectorC) { - return (vectorB.x - vectorA.x) * (vectorC.y - vectorA.y) - (vectorB.y - vectorA.y) * (vectorC.x - vectorA.x); - }; - - /** - * Adds the two vectors. - * @method add - * @param {vector} vectorA - * @param {vector} vectorB - * @param {vector} [output] - * @return {vector} A new vector of vectorA and vectorB added - */ - Vector.add = function(vectorA, vectorB, output) { - if (!output) output = {}; - output.x = vectorA.x + vectorB.x; - output.y = vectorA.y + vectorB.y; - return output; - }; - - /** - * Subtracts the two vectors. - * @method sub - * @param {vector} vectorA - * @param {vector} vectorB - * @param {vector} [output] - * @return {vector} A new vector of vectorA and vectorB subtracted - */ - Vector.sub = function(vectorA, vectorB, output) { - if (!output) output = {}; - output.x = vectorA.x - vectorB.x; - output.y = vectorA.y - vectorB.y; - return output; - }; - - /** - * Multiplies a vector and a scalar. - * @method mult - * @param {vector} vector - * @param {number} scalar - * @return {vector} A new vector multiplied by scalar - */ - Vector.mult = function(vector, scalar) { - return { x: vector.x * scalar, y: vector.y * scalar }; - }; - - /** - * Divides a vector and a scalar. - * @method div - * @param {vector} vector - * @param {number} scalar - * @return {vector} A new vector divided by scalar - */ - Vector.div = function(vector, scalar) { - return { x: vector.x / scalar, y: vector.y / scalar }; - }; - - /** - * Returns the perpendicular vector. Set `negate` to true for the perpendicular in the opposite direction. - * @method perp - * @param {vector} vector - * @param {bool} [negate=false] - * @return {vector} The perpendicular vector - */ - Vector.perp = function(vector, negate) { - negate = negate === true ? -1 : 1; - return { x: negate * -vector.y, y: negate * vector.x }; - }; - - /** - * Negates both components of a vector such that it points in the opposite direction. - * @method neg - * @param {vector} vector - * @return {vector} The negated vector - */ - Vector.neg = function(vector) { - return { x: -vector.x, y: -vector.y }; - }; - - /** - * Returns the angle between the vector `vectorB - vectorA` and the x-axis in radians. - * @method angle - * @param {vector} vectorA - * @param {vector} vectorB - * @return {number} The angle in radians - */ - Vector.angle = function(vectorA, vectorB) { - return Math.atan2(vectorB.y - vectorA.y, vectorB.x - vectorA.x); - }; - - /** - * Temporary vector pool (not thread-safe). - * @property _temp - * @type {vector[]} - * @private - */ - Vector._temp = [ - Vector.create(), Vector.create(), - Vector.create(), Vector.create(), - Vector.create(), Vector.create() - ]; - -})(); - -/***/ }), -/* 34 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7777,7 +6906,7 @@ var Vertices = {}; module.exports = Vertices; -var Vector = __webpack_require__(33); +var Vector = __webpack_require__(34); var Common = __webpack_require__(12); (function() { @@ -8219,6 +7348,885 @@ var Common = __webpack_require__(12); })(); +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * @namespace Phaser.Tilemaps.Formats + */ + +module.exports = { + + /** + * CSV Map Type + * + * @name Phaser.Tilemaps.Formats.CSV + * @type {number} + * @since 3.0.0 + */ + CSV: 0, + + /** + * Tiled JSON Map Type + * + * @name Phaser.Tilemaps.Formats.TILED_JSON + * @type {number} + * @since 3.0.0 + */ + TILED_JSON: 1, + + /** + * 2D Array Map Type + * + * @name Phaser.Tilemaps.Formats.ARRAY_2D + * @type {number} + * @since 3.0.0 + */ + ARRAY_2D: 2, + + /** + * Weltmeister (Impact.js) Map Type + * + * @name Phaser.Tilemaps.Formats.WELTMEISTER + * @type {number} + * @since 3.0.0 + */ + WELTMEISTER: 3 + +}; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(16); +var GameObject = __webpack_require__(17); +var Line = __webpack_require__(60); + +/** + * @classdesc + * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. + * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. + * + * @class Shape + * @extends Phaser.GameObjects.GameObject + * @memberOf Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.ComputedSize + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScaleMode + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {string} [type] - The internal type of the Shape. + * @param {any} [data] - The data of the source shape geometry, if any. + */ +var Shape = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.ComputedSize, + Components.Depth, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScaleMode, + Components.ScrollFactor, + Components.Transform, + Components.Visible + ], + + initialize: + + function Shape (scene, type, data) + { + if (type === undefined) { type = 'Shape'; } + + GameObject.call(this, scene, type); + + /** + * The source Shape data. Typically a geometry object. + * You should not manipulate this directly. + * + * @name Phaser.GameObjects.Shape#data + * @type {any} + * @readonly + * @since 3.13.0 + */ + this.geom = data; + + /** + * Holds the polygon path data for filled rendering. + * + * @name Phaser.GameObjects.Shape#pathData + * @type {number[]} + * @readonly + * @since 3.13.0 + */ + this.pathData = []; + + /** + * Holds the earcut polygon path index data for filled rendering. + * + * @name Phaser.GameObjects.Shape#pathIndexes + * @type {integer[]} + * @readonly + * @since 3.13.0 + */ + this.pathIndexes = []; + + /** + * The fill color used by this Shape. + * + * @name Phaser.GameObjects.Shape#fillColor + * @type {number} + * @since 3.13.0 + */ + this.fillColor = 0xffffff; + + /** + * The fill alpha value used by this Shape. + * + * @name Phaser.GameObjects.Shape#fillAlpha + * @type {number} + * @since 3.13.0 + */ + this.fillAlpha = 1; + + /** + * The stroke color used by this Shape. + * + * @name Phaser.GameObjects.Shape#strokeColor + * @type {number} + * @since 3.13.0 + */ + this.strokeColor = 0xffffff; + + /** + * The stroke alpha value used by this Shape. + * + * @name Phaser.GameObjects.Shape#strokeAlpha + * @type {number} + * @since 3.13.0 + */ + this.strokeAlpha = 1; + + /** + * The stroke line width used by this Shape. + * + * @name Phaser.GameObjects.Shape#lineWidth + * @type {number} + * @since 3.13.0 + */ + this.lineWidth = 1; + + /** + * Controls if this Shape is filled or not. + * Note that some Shapes do not support being filled (such as Line shapes) + * + * @name Phaser.GameObjects.Shape#isFilled + * @type {boolean} + * @since 3.13.0 + */ + this.isFilled = false; + + /** + * Controls if this Shape is stroked or not. + * Note that some Shapes do not support being stroked (such as Iso Box shapes) + * + * @name Phaser.GameObjects.Shape#isStroked + * @type {boolean} + * @since 3.13.0 + */ + this.isStroked = false; + + /** + * Controls if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * @name Phaser.GameObjects.Shape#closePath + * @type {boolean} + * @since 3.13.0 + */ + this.closePath = true; + + /** + * Private internal value. + * A Line used when parsing internal path data to avoid constant object re-creation. + * + * @name Phaser.GameObjects.Curve#_tempLine + * @type {Phaser.Geom.Line} + * @private + * @since 3.13.0 + */ + this._tempLine = new Line(); + + this.initPipeline(); + }, + + /** + * Sets the fill color and alpha for this Shape. + * + * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. + * + * Note that some Shapes do not support fill colors, such as the Line shape. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setFillStyle + * @since 3.13.0 + * + * @param {number} [color] - The color used to fill this shape. If not provided the Shape will not be filled. + * @param {number} [alpha=1] - The alpha value used when filling this shape, if a fill color is given. + * + * @return {this} This Game Object instance. + */ + setFillStyle: function (color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + if (color === undefined) + { + this.isFilled = false; + } + else + { + this.fillColor = color; + this.fillAlpha = alpha; + this.isFilled = true; + } + + return this; + }, + + /** + * Sets the stroke color and alpha for this Shape. + * + * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. + * + * Note that some Shapes do not support being stroked, such as the Iso Box shape. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setStrokeStyle + * @since 3.13.0 + * + * @param {number} [color] - The color used to stroke this shape. If not provided the Shape will not be stroked. + * @param {number} [alpha=1] - The alpha value used when stroking this shape, if a stroke color is given. + * + * @return {this} This Game Object instance. + */ + setStrokeStyle: function (lineWidth, color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + if (lineWidth === undefined) + { + this.isStroked = false; + } + else + { + this.lineWidth = lineWidth; + this.strokeColor = color; + this.strokeAlpha = alpha; + this.isStroked = true; + } + + return this; + }, + + /** + * Sets if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setClosePath + * @since 3.13.0 + * + * @param {boolean} value - Set to `true` if the Shape should be closed when stroked, otherwise `false`. + * + * @return {this} This Game Object instance. + */ + setClosePath: function (value) + { + this.closePath = value; + + return this; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.Shape#preDestroy + * @protected + * @since 3.13.0 + */ + preDestroy: function () + { + this.geom = null; + this._tempLine = null; + this.pathData = []; + this.pathIndexes = []; + } + +}); + +module.exports = Shape; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var BlendModes = __webpack_require__(72); +var GetAdvancedValue = __webpack_require__(13); +var ScaleModes = __webpack_require__(104); + +/** + * @typedef {object} GameObjectConfig + * + * @property {number} [x=0] - The x position of the Game Object. + * @property {number} [y=0] - The y position of the Game Object. + * @property {number} [depth=0] - The depth of the GameObject. + * @property {boolean} [flipX=false] - The horizontally flipped state of the Game Object. + * @property {boolean} [flipY=false] - The vertically flipped state of the Game Object. + * @property {?(number|object)} [scale=null] - The scale of the GameObject. + * @property {?(number|object)} [scrollFactor=null] - The scroll factor of the GameObject. + * @property {number} [rotation=0] - The rotation angle of the Game Object, in radians. + * @property {?number} [angle=null] - The rotation angle of the Game Object, in degrees. + * @property {number} [alpha=1] - The alpha (opacity) of the Game Object. + * @property {?(number|object)} [origin=null] - The origin of the Game Object. + * @property {number} [scaleMode=ScaleModes.DEFAULT] - The scale mode of the GameObject. + * @property {number} [blendMode=BlendModes.DEFAULT] - The blend mode of the GameObject. + * @property {boolean} [visible=true] - The visible state of the Game Object. + * @property {boolean} [add=true] - Add the GameObject to the scene. + */ + +/** + * Builds a Game Object using the provided configuration object. + * + * @function Phaser.GameObjects.BuildGameObject + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene. + * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. + * @param {GameObjectConfig} config - The config to build the GameObject with. + * + * @return {Phaser.GameObjects.GameObject} The built Game Object. + */ +var BuildGameObject = function (scene, gameObject, config) +{ + // Position + + gameObject.x = GetAdvancedValue(config, 'x', 0); + gameObject.y = GetAdvancedValue(config, 'y', 0); + gameObject.depth = GetAdvancedValue(config, 'depth', 0); + + // Flip + + gameObject.flipX = GetAdvancedValue(config, 'flipX', false); + gameObject.flipY = GetAdvancedValue(config, 'flipY', false); + + // Scale + // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} + + var scale = GetAdvancedValue(config, 'scale', null); + + if (typeof scale === 'number') + { + gameObject.setScale(scale); + } + else if (scale !== null) + { + gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); + gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); + } + + // ScrollFactor + // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} + + var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); + + if (typeof scrollFactor === 'number') + { + gameObject.setScrollFactor(scrollFactor); + } + else if (scrollFactor !== null) + { + gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); + gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); + } + + // Rotation + + gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); + + var angle = GetAdvancedValue(config, 'angle', null); + + if (angle !== null) + { + gameObject.angle = angle; + } + + // Alpha + + gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); + + // Origin + // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} + + var origin = GetAdvancedValue(config, 'origin', null); + + if (typeof origin === 'number') + { + gameObject.setOrigin(origin); + } + else if (origin !== null) + { + var ox = GetAdvancedValue(origin, 'x', 0.5); + var oy = GetAdvancedValue(origin, 'y', 0.5); + + gameObject.setOrigin(ox, oy); + } + + // ScaleMode + + gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT); + + // BlendMode + + gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); + + // Visible + + gameObject.visible = GetAdvancedValue(config, 'visible', true); + + // Add to Scene + + var add = GetAdvancedValue(config, 'add', true); + + if (add) + { + scene.sys.displayList.add(gameObject); + } + + if (gameObject.preUpdate) + { + scene.sys.updateList.add(gameObject); + } + + return gameObject; +}; + +module.exports = BuildGameObject; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports) { + +/** +* The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB). +* +* @class Bounds +*/ + +var Bounds = {}; + +module.exports = Bounds; + +(function() { + + /** + * Creates a new axis-aligned bounding box (AABB) for the given vertices. + * @method create + * @param {vertices} vertices + * @return {bounds} A new bounds object + */ + Bounds.create = function(vertices) { + var bounds = { + min: { x: 0, y: 0 }, + max: { x: 0, y: 0 } + }; + + if (vertices) + Bounds.update(bounds, vertices); + + return bounds; + }; + + /** + * Updates bounds using the given vertices and extends the bounds given a velocity. + * @method update + * @param {bounds} bounds + * @param {vertices} vertices + * @param {vector} velocity + */ + Bounds.update = function(bounds, vertices, velocity) { + bounds.min.x = Infinity; + bounds.max.x = -Infinity; + bounds.min.y = Infinity; + bounds.max.y = -Infinity; + + for (var i = 0; i < vertices.length; i++) { + var vertex = vertices[i]; + if (vertex.x > bounds.max.x) bounds.max.x = vertex.x; + if (vertex.x < bounds.min.x) bounds.min.x = vertex.x; + if (vertex.y > bounds.max.y) bounds.max.y = vertex.y; + if (vertex.y < bounds.min.y) bounds.min.y = vertex.y; + } + + if (velocity) { + if (velocity.x > 0) { + bounds.max.x += velocity.x; + } else { + bounds.min.x += velocity.x; + } + + if (velocity.y > 0) { + bounds.max.y += velocity.y; + } else { + bounds.min.y += velocity.y; + } + } + }; + + /** + * Returns true if the bounds contains the given point. + * @method contains + * @param {bounds} bounds + * @param {vector} point + * @return {boolean} True if the bounds contain the point, otherwise false + */ + Bounds.contains = function(bounds, point) { + return point.x >= bounds.min.x && point.x <= bounds.max.x + && point.y >= bounds.min.y && point.y <= bounds.max.y; + }; + + /** + * Returns true if the two bounds intersect. + * @method overlaps + * @param {bounds} boundsA + * @param {bounds} boundsB + * @return {boolean} True if the bounds overlap, otherwise false + */ + Bounds.overlaps = function(boundsA, boundsB) { + return (boundsA.min.x <= boundsB.max.x && boundsA.max.x >= boundsB.min.x + && boundsA.max.y >= boundsB.min.y && boundsA.min.y <= boundsB.max.y); + }; + + /** + * Translates the bounds by the given vector. + * @method translate + * @param {bounds} bounds + * @param {vector} vector + */ + Bounds.translate = function(bounds, vector) { + bounds.min.x += vector.x; + bounds.max.x += vector.x; + bounds.min.y += vector.y; + bounds.max.y += vector.y; + }; + + /** + * Shifts the bounds to the given position. + * @method shift + * @param {bounds} bounds + * @param {vector} position + */ + Bounds.shift = function(bounds, position) { + var deltaX = bounds.max.x - bounds.min.x, + deltaY = bounds.max.y - bounds.min.y; + + bounds.min.x = position.x; + bounds.max.x = position.x + deltaX; + bounds.min.y = position.y; + bounds.max.y = position.y + deltaY; + }; + +})(); + + +/***/ }), +/* 34 */ +/***/ (function(module, exports) { + +/** +* The `Matter.Vector` module contains methods for creating and manipulating vectors. +* Vectors are the basis of all the geometry related operations in the engine. +* A `Matter.Vector` object is of the form `{ x: 0, y: 0 }`. +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Vector +*/ + +// TODO: consider params for reusing vector objects + +var Vector = {}; + +module.exports = Vector; + +(function() { + + /** + * Creates a new vector. + * @method create + * @param {number} x + * @param {number} y + * @return {vector} A new vector + */ + Vector.create = function(x, y) { + return { x: x || 0, y: y || 0 }; + }; + + /** + * Returns a new vector with `x` and `y` copied from the given `vector`. + * @method clone + * @param {vector} vector + * @return {vector} A new cloned vector + */ + Vector.clone = function(vector) { + return { x: vector.x, y: vector.y }; + }; + + /** + * Returns the magnitude (length) of a vector. + * @method magnitude + * @param {vector} vector + * @return {number} The magnitude of the vector + */ + Vector.magnitude = function(vector) { + return Math.sqrt((vector.x * vector.x) + (vector.y * vector.y)); + }; + + /** + * Returns the magnitude (length) of a vector (therefore saving a `sqrt` operation). + * @method magnitudeSquared + * @param {vector} vector + * @return {number} The squared magnitude of the vector + */ + Vector.magnitudeSquared = function(vector) { + return (vector.x * vector.x) + (vector.y * vector.y); + }; + + /** + * Rotates the vector about (0, 0) by specified angle. + * @method rotate + * @param {vector} vector + * @param {number} angle + * @param {vector} [output] + * @return {vector} The vector rotated about (0, 0) + */ + Vector.rotate = function(vector, angle, output) { + var cos = Math.cos(angle), sin = Math.sin(angle); + if (!output) output = {}; + var x = vector.x * cos - vector.y * sin; + output.y = vector.x * sin + vector.y * cos; + output.x = x; + return output; + }; + + /** + * Rotates the vector about a specified point by specified angle. + * @method rotateAbout + * @param {vector} vector + * @param {number} angle + * @param {vector} point + * @param {vector} [output] + * @return {vector} A new vector rotated about the point + */ + Vector.rotateAbout = function(vector, angle, point, output) { + var cos = Math.cos(angle), sin = Math.sin(angle); + if (!output) output = {}; + var x = point.x + ((vector.x - point.x) * cos - (vector.y - point.y) * sin); + output.y = point.y + ((vector.x - point.x) * sin + (vector.y - point.y) * cos); + output.x = x; + return output; + }; + + /** + * Normalises a vector (such that its magnitude is `1`). + * @method normalise + * @param {vector} vector + * @return {vector} A new vector normalised + */ + Vector.normalise = function(vector) { + var magnitude = Vector.magnitude(vector); + if (magnitude === 0) + return { x: 0, y: 0 }; + return { x: vector.x / magnitude, y: vector.y / magnitude }; + }; + + /** + * Returns the dot-product of two vectors. + * @method dot + * @param {vector} vectorA + * @param {vector} vectorB + * @return {number} The dot product of the two vectors + */ + Vector.dot = function(vectorA, vectorB) { + return (vectorA.x * vectorB.x) + (vectorA.y * vectorB.y); + }; + + /** + * Returns the cross-product of two vectors. + * @method cross + * @param {vector} vectorA + * @param {vector} vectorB + * @return {number} The cross product of the two vectors + */ + Vector.cross = function(vectorA, vectorB) { + return (vectorA.x * vectorB.y) - (vectorA.y * vectorB.x); + }; + + /** + * Returns the cross-product of three vectors. + * @method cross3 + * @param {vector} vectorA + * @param {vector} vectorB + * @param {vector} vectorC + * @return {number} The cross product of the three vectors + */ + Vector.cross3 = function(vectorA, vectorB, vectorC) { + return (vectorB.x - vectorA.x) * (vectorC.y - vectorA.y) - (vectorB.y - vectorA.y) * (vectorC.x - vectorA.x); + }; + + /** + * Adds the two vectors. + * @method add + * @param {vector} vectorA + * @param {vector} vectorB + * @param {vector} [output] + * @return {vector} A new vector of vectorA and vectorB added + */ + Vector.add = function(vectorA, vectorB, output) { + if (!output) output = {}; + output.x = vectorA.x + vectorB.x; + output.y = vectorA.y + vectorB.y; + return output; + }; + + /** + * Subtracts the two vectors. + * @method sub + * @param {vector} vectorA + * @param {vector} vectorB + * @param {vector} [output] + * @return {vector} A new vector of vectorA and vectorB subtracted + */ + Vector.sub = function(vectorA, vectorB, output) { + if (!output) output = {}; + output.x = vectorA.x - vectorB.x; + output.y = vectorA.y - vectorB.y; + return output; + }; + + /** + * Multiplies a vector and a scalar. + * @method mult + * @param {vector} vector + * @param {number} scalar + * @return {vector} A new vector multiplied by scalar + */ + Vector.mult = function(vector, scalar) { + return { x: vector.x * scalar, y: vector.y * scalar }; + }; + + /** + * Divides a vector and a scalar. + * @method div + * @param {vector} vector + * @param {number} scalar + * @return {vector} A new vector divided by scalar + */ + Vector.div = function(vector, scalar) { + return { x: vector.x / scalar, y: vector.y / scalar }; + }; + + /** + * Returns the perpendicular vector. Set `negate` to true for the perpendicular in the opposite direction. + * @method perp + * @param {vector} vector + * @param {bool} [negate=false] + * @return {vector} The perpendicular vector + */ + Vector.perp = function(vector, negate) { + negate = negate === true ? -1 : 1; + return { x: negate * -vector.y, y: negate * vector.x }; + }; + + /** + * Negates both components of a vector such that it points in the opposite direction. + * @method neg + * @param {vector} vector + * @return {vector} The negated vector + */ + Vector.neg = function(vector) { + return { x: -vector.x, y: -vector.y }; + }; + + /** + * Returns the angle between the vector `vectorB - vectorA` and the x-axis in radians. + * @method angle + * @param {vector} vectorA + * @param {vector} vectorB + * @return {number} The angle in radians + */ + Vector.angle = function(vectorA, vectorB) { + return Math.atan2(vectorB.y - vectorA.y, vectorB.x - vectorA.x); + }; + + /** + * Temporary vector pool (not thread-safe). + * @property _temp + * @type {vector[]} + * @private + */ + Vector._temp = [ + Vector.create(), Vector.create(), + Vector.create(), Vector.create(), + Vector.create(), Vector.create() + ]; + +})(); + /***/ }), /* 35 */ /***/ (function(module, exports) { @@ -8373,10 +8381,10 @@ var GetTilesWithin = __webpack_require__(19); * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var CalculateFacesWithin = function (tileX, tileY, width, height, layer) @@ -8429,35 +8437,41 @@ module.exports = CalculateFacesWithin; /** * Arcade Physics consts. - * + * * @ignore */ var CONST = { /** - * [description] - * + * Dynamic Body. + * * @name Phaser.Physics.Arcade.DYNAMIC_BODY * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#physicsType + * @see Phaser.Physics.Arcade.Group#physicsType */ DYNAMIC_BODY: 0, /** - * [description] - * + * Static Body. + * * @name Phaser.Physics.Arcade.STATIC_BODY * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#physicsType + * @see Phaser.Physics.Arcade.StaticBody#physicsType */ STATIC_BODY: 1, /** * [description] - * + * * @name Phaser.Physics.Arcade.GROUP * @readOnly * @type {number} @@ -8467,7 +8481,7 @@ var CONST = { /** * [description] - * + * * @name Phaser.Physics.Arcade.TILEMAPLAYER * @readOnly * @type {number} @@ -8476,52 +8490,62 @@ var CONST = { TILEMAPLAYER: 3, /** - * [description] - * + * Facing no direction (initial value). + * * @name Phaser.Physics.Arcade.FACING_NONE * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_NONE: 10, /** - * [description] - * + * Facing up. + * * @name Phaser.Physics.Arcade.FACING_UP * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_UP: 11, /** - * [description] - * + * Facing down. + * * @name Phaser.Physics.Arcade.FACING_DOWN * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_DOWN: 12, /** - * [description] - * + * Facing left. + * * @name Phaser.Physics.Arcade.FACING_LEFT * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_LEFT: 13, /** - * [description] - * + * Facing right. + * * @name Phaser.Physics.Arcade.FACING_RIGHT * @readOnly * @type {number} * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing */ FACING_RIGHT: 14 @@ -9427,1239 +9451,6 @@ module.exports = Color; /***/ }), /* 42 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * [description] - * - * @function Phaser.Geom.Rectangle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {number} x - [description] - * @param {number} y - [description] - * - * @return {boolean} [description] - */ -var Contains = function (rect, x, y) -{ - if (rect.width <= 0 || rect.height <= 0) - { - return false; - } - - return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; - -module.exports = Contains; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Check to see if the Circle contains the given x / y coordinates. - * - * @function Phaser.Geom.Circle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Circle} circle - The Circle to check. - * @param {number} x - The x coordinate to check within the circle. - * @param {number} y - The y coordinate to check within the circle. - * - * @return {boolean} True if the coordinates are within the circle, otherwise false. - */ -var Contains = function (circle, x, y) -{ - // Check if x/y are within the bounds first - if (circle.radius > 0 && x >= circle.left && x <= circle.right && y >= circle.top && y <= circle.bottom) - { - var dx = (circle.x - x) * (circle.x - x); - var dy = (circle.y - y) * (circle.y - y); - - return (dx + dy) <= (circle.radius * circle.radius); - } - else - { - return false; - } -}; - -module.exports = Contains; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the top of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetTop - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetTop = function (gameObject, value) -{ - gameObject.y = value + (gameObject.height * gameObject.originY); - - return gameObject; -}; - -module.exports = SetTop; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the top coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetTop - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The top coordinate of the bounds of the Game Object. - */ -var GetTop = function (gameObject) -{ - return gameObject.y - (gameObject.height * gameObject.originY); -}; - -module.exports = GetTop; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the left of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetRight - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetRight = function (gameObject, value) -{ - gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX); - - return gameObject; -}; - -module.exports = SetRight; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the right coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetRight - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The right coordinate of the bounds of the Game Object. - */ -var GetRight = function (gameObject) -{ - return (gameObject.x + gameObject.width) - (gameObject.width * gameObject.originX); -}; - -module.exports = GetRight; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the left of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetLeft - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetLeft = function (gameObject, value) -{ - gameObject.x = value + (gameObject.width * gameObject.originX); - - return gameObject; -}; - -module.exports = SetLeft; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the left coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetLeft - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The left coordinate of the bounds of the Game Object. - */ -var GetLeft = function (gameObject) -{ - return gameObject.x - (gameObject.width * gameObject.originX); -}; - -module.exports = GetLeft; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetBottom - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetBottom = function (gameObject, value) -{ - gameObject.y = (value - gameObject.height) + (gameObject.height * gameObject.originY); - - return gameObject; -}; - -module.exports = SetBottom; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the bottom coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetBottom - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The bottom coordinate of the bounds of the Game Object. - */ -var GetBottom = function (gameObject) -{ - return (gameObject.y + gameObject.height) - (gameObject.height * gameObject.originY); -}; - -module.exports = GetBottom; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.WorldToTileY - * @private - * @since 3.0.0 - * - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} The Y location in tile units. - */ -var WorldToTileY = function (worldY, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } - - var tileHeight = layer.baseTileHeight; - var tilemapLayer = layer.tilemapLayer; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's vertical scroll - worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); - - tileHeight *= tilemapLayer.scaleY; - } - - return snapToFloor - ? Math.floor(worldY / tileHeight) - : worldY / tileHeight; -}; - -module.exports = WorldToTileY; - - -/***/ }), -/* 53 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.WorldToTileX - * @private - * @since 3.0.0 - * - * @param {number} worldX - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} The X location in tile units. - */ -var WorldToTileX = function (worldX, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } - - var tileWidth = layer.baseTileWidth; - var tilemapLayer = layer.tilemapLayer; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's horizontal scroll - worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); - - tileWidth *= tilemapLayer.scaleX; - } - - return snapToFloor - ? Math.floor(worldX / tileWidth) - : worldX / tileWidth; -}; - -module.exports = WorldToTileX; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -/** -* The `Matter.Bodies` module contains factory methods for creating rigid body models -* with commonly used body configurations (such as rectangles, circles and other polygons). -* -* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). -* -* @class Bodies -*/ - -// TODO: true circle bodies - -var Bodies = {}; - -module.exports = Bodies; - -var Vertices = __webpack_require__(34); -var Common = __webpack_require__(12); -var Body = __webpack_require__(25); -var Bounds = __webpack_require__(32); -var Vector = __webpack_require__(33); -var decomp = __webpack_require__(245); - -(function() { - - /** - * Creates a new rigid body model with a rectangle hull. - * The options parameter is an object that specifies any properties you wish to override the defaults. - * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. - * @method rectangle - * @param {number} x - * @param {number} y - * @param {number} width - * @param {number} height - * @param {object} [options] - * @return {body} A new rectangle body - */ - Bodies.rectangle = function(x, y, width, height, options) { - options = options || {}; - - var rectangle = { - label: 'Rectangle Body', - position: { x: x, y: y }, - vertices: Vertices.fromPath('L 0 0 L ' + width + ' 0 L ' + width + ' ' + height + ' L 0 ' + height) - }; - - if (options.chamfer) { - var chamfer = options.chamfer; - rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius, - chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); - delete options.chamfer; - } - - return Body.create(Common.extend({}, rectangle, options)); - }; - - /** - * Creates a new rigid body model with a trapezoid hull. - * The options parameter is an object that specifies any properties you wish to override the defaults. - * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. - * @method trapezoid - * @param {number} x - * @param {number} y - * @param {number} width - * @param {number} height - * @param {number} slope - * @param {object} [options] - * @return {body} A new trapezoid body - */ - Bodies.trapezoid = function(x, y, width, height, slope, options) { - options = options || {}; - - slope *= 0.5; - var roof = (1 - (slope * 2)) * width; - - var x1 = width * slope, - x2 = x1 + roof, - x3 = x2 + x1, - verticesPath; - - if (slope < 0.5) { - verticesPath = 'L 0 0 L ' + x1 + ' ' + (-height) + ' L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0'; - } else { - verticesPath = 'L 0 0 L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0'; - } - - var trapezoid = { - label: 'Trapezoid Body', - position: { x: x, y: y }, - vertices: Vertices.fromPath(verticesPath) - }; - - if (options.chamfer) { - var chamfer = options.chamfer; - trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius, - chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); - delete options.chamfer; - } - - return Body.create(Common.extend({}, trapezoid, options)); - }; - - /** - * Creates a new rigid body model with a circle hull. - * The options parameter is an object that specifies any properties you wish to override the defaults. - * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. - * @method circle - * @param {number} x - * @param {number} y - * @param {number} radius - * @param {object} [options] - * @param {number} [maxSides] - * @return {body} A new circle body - */ - Bodies.circle = function(x, y, radius, options, maxSides) { - options = options || {}; - - var circle = { - label: 'Circle Body', - circleRadius: radius - }; - - // approximate circles with polygons until true circles implemented in SAT - maxSides = maxSides || 25; - var sides = Math.ceil(Math.max(10, Math.min(maxSides, radius))); - - // optimisation: always use even number of sides (half the number of unique axes) - if (sides % 2 === 1) - sides += 1; - - return Bodies.polygon(x, y, sides, radius, Common.extend({}, circle, options)); - }; - - /** - * Creates a new rigid body model with a regular polygon hull with the given number of sides. - * The options parameter is an object that specifies any properties you wish to override the defaults. - * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. - * @method polygon - * @param {number} x - * @param {number} y - * @param {number} sides - * @param {number} radius - * @param {object} [options] - * @return {body} A new regular polygon body - */ - Bodies.polygon = function(x, y, sides, radius, options) { - options = options || {}; - - if (sides < 3) - return Bodies.circle(x, y, radius, options); - - var theta = 2 * Math.PI / sides, - path = '', - offset = theta * 0.5; - - for (var i = 0; i < sides; i += 1) { - var angle = offset + (i * theta), - xx = Math.cos(angle) * radius, - yy = Math.sin(angle) * radius; - - path += 'L ' + xx.toFixed(3) + ' ' + yy.toFixed(3) + ' '; - } - - var polygon = { - label: 'Polygon Body', - position: { x: x, y: y }, - vertices: Vertices.fromPath(path) - }; - - if (options.chamfer) { - var chamfer = options.chamfer; - polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius, - chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); - delete options.chamfer; - } - - return Body.create(Common.extend({}, polygon, options)); - }; - - /** - * Creates a body using the supplied vertices (or an array containing multiple sets of vertices). - * If the vertices are convex, they will pass through as supplied. - * Otherwise if the vertices are concave, they will be decomposed if [poly-decomp.js](https://github.com/schteppe/poly-decomp.js) is available. - * Note that this process is not guaranteed to support complex sets of vertices (e.g. those with holes may fail). - * By default the decomposition will discard collinear edges (to improve performance). - * It can also optionally discard any parts that have an area less than `minimumArea`. - * If the vertices can not be decomposed, the result will fall back to using the convex hull. - * The options parameter is an object that specifies any `Matter.Body` properties you wish to override the defaults. - * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. - * @method fromVertices - * @param {number} x - * @param {number} y - * @param [[vector]] vertexSets - * @param {object} [options] - * @param {bool} [flagInternal=false] - * @param {number} [removeCollinear=0.01] - * @param {number} [minimumArea=10] - * @return {body} - */ - Bodies.fromVertices = function(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea) { - var body, - parts, - isConvex, - vertices, - i, - j, - k, - v, - z; - - options = options || {}; - parts = []; - - flagInternal = typeof flagInternal !== 'undefined' ? flagInternal : false; - removeCollinear = typeof removeCollinear !== 'undefined' ? removeCollinear : 0.01; - minimumArea = typeof minimumArea !== 'undefined' ? minimumArea : 10; - - if (!decomp) { - Common.warn('Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull.'); - } - - // ensure vertexSets is an array of arrays - if (!Common.isArray(vertexSets[0])) { - vertexSets = [vertexSets]; - } - - for (v = 0; v < vertexSets.length; v += 1) { - vertices = vertexSets[v]; - isConvex = Vertices.isConvex(vertices); - - if (isConvex || !decomp) { - if (isConvex) { - vertices = Vertices.clockwiseSort(vertices); - } else { - // fallback to convex hull when decomposition is not possible - vertices = Vertices.hull(vertices); - } - - parts.push({ - position: { x: x, y: y }, - vertices: vertices - }); - } else { - // initialise a decomposition - var concave = vertices.map(function(vertex) { - return [vertex.x, vertex.y]; - }); - - // vertices are concave and simple, we can decompose into parts - decomp.makeCCW(concave); - if (removeCollinear !== false) - decomp.removeCollinearPoints(concave, removeCollinear); - - // use the quick decomposition algorithm (Bayazit) - var decomposed = decomp.quickDecomp(concave); - - // for each decomposed chunk - for (i = 0; i < decomposed.length; i++) { - var chunk = decomposed[i]; - - // convert vertices into the correct structure - var chunkVertices = chunk.map(function(vertices) { - return { - x: vertices[0], - y: vertices[1] - }; - }); - - // skip small chunks - if (minimumArea > 0 && Vertices.area(chunkVertices) < minimumArea) - continue; - - // create a compound part - parts.push({ - position: Vertices.centre(chunkVertices), - vertices: chunkVertices - }); - } - } - } - - // create body parts - for (i = 0; i < parts.length; i++) { - parts[i] = Body.create(Common.extend(parts[i], options)); - } - - // flag internal edges (coincident part edges) - if (flagInternal) { - var coincident_max_dist = 5; - - for (i = 0; i < parts.length; i++) { - var partA = parts[i]; - - for (j = i + 1; j < parts.length; j++) { - var partB = parts[j]; - - if (Bounds.overlaps(partA.bounds, partB.bounds)) { - var pav = partA.vertices, - pbv = partB.vertices; - - // iterate vertices of both parts - for (k = 0; k < partA.vertices.length; k++) { - for (z = 0; z < partB.vertices.length; z++) { - // find distances between the vertices - var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])), - db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length])); - - // if both vertices are very close, consider the edge concident (internal) - if (da < coincident_max_dist && db < coincident_max_dist) { - pav[k].isInternal = true; - pbv[z].isInternal = true; - } - } - } - - } - } - } - } - - if (parts.length > 1) { - // create the parent body to be returned, that contains generated compound parts - body = Body.create(Common.extend({ parts: parts.slice(0) }, options)); - Body.setPosition(body, { x: x, y: y }); - - return body; - } else { - return parts[0]; - } - }; - -})(); - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(20); -var File = __webpack_require__(22); -var FileTypesManager = __webpack_require__(7); -var GetFastValue = __webpack_require__(1); -var GetValue = __webpack_require__(4); -var IsPlainObject = __webpack_require__(8); - -/** - * @typedef {object} Phaser.Loader.FileTypes.JSONFileConfig - * - * @property {string} key - The key of the file. Must be unique within both the Loader and the JSON Cache. - * @property {string|any} [url] - The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly added to the Cache. - * @property {string} [extension='json'] - The default file extension to use if no url is provided. - * @property {string} [dataKey] - If specified instead of the whole JSON file being parsed and added to the Cache, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. - * @property {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - */ - -/** - * @classdesc - * A single JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. - * - * @class JSONFile - * @extends Phaser.Loader.File - * @memberOf Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - */ -var JSONFile = new Class({ - - Extends: File, - - initialize: - - // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object - // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing - - function JSONFile (loader, key, url, xhrSettings, dataKey) - { - var extension = 'json'; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - dataKey = GetFastValue(config, 'dataKey', dataKey); - } - - var fileConfig = { - type: 'json', - cache: loader.cacheManager.json, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings, - config: dataKey - }; - - File.call(this, loader, fileConfig); - - if (IsPlainObject(url)) - { - // Object provided instead of a URL, so no need to actually load it (populate data with value) - if (dataKey) - { - this.data = GetValue(url, dataKey); - } - else - { - this.data = url; - } - - this.state = CONST.FILE_POPULATED; - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.JSONFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - if (this.state !== CONST.FILE_POPULATED) - { - this.state = CONST.FILE_PROCESSING; - - var json = JSON.parse(this.xhrLoader.responseText); - - var key = this.config; - - if (typeof key === 'string') - { - this.data = GetValue(json, key, json); - } - else - { - this.data = json; - } - } - - this.onProcessComplete(); - } - -}); - -/** - * Adds a JSON file, or array of JSON files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the JSON Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.json({ - * key: 'wavedata', - * url: 'files/AlienWaveData.json' - * }); - * ``` - * - * See the documentation for `Phaser.Loader.FileTypes.JSONFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * // and later in your game ... - * var data = this.cache.json.get('wavedata'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and - * this is what you would use to retrieve the text from the JSON Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" - * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, - * rather than the whole file. For example, if your JSON data had a structure like this: - * - * ```json - * { - * "level1": { - * "baddies": { - * "aliens": {}, - * "boss": {} - * } - * }, - * "level2": {}, - * "level3": {} - * } - * ``` - * - * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. - * - * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#json - * @fires Phaser.Loader.LoaderPlugin#addFileEvent - * @since 3.0.0 - * - * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig|Phaser.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - * @param {XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {Phaser.Loader.LoaderPlugin} The Loader instance. - */ -FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new JSONFile(this, key[i])); - } - } - else - { - this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); - } - - return this; -}); - -module.exports = JSONFile; - - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var Class = __webpack_require__(0); -var Components = __webpack_require__(16); -var GameObject = __webpack_require__(17); -var SpriteRender = __webpack_require__(895); - -/** - * @classdesc - * A Sprite Game Object. - * - * A Sprite Game Object is used for the display of both static and animated images in your game. - * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled - * and animated. - * - * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. - * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation - * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. - * - * @class Sprite - * @extends Phaser.GameObjects.GameObject - * @memberOf Phaser.GameObjects - * @constructor - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.Alpha - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.Flip - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.GameObjects.Components.Size - * @extends Phaser.GameObjects.Components.TextureCrop - * @extends Phaser.GameObjects.Components.Tint - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - */ -var Sprite = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Alpha, - Components.BlendMode, - Components.Depth, - Components.Flip, - Components.GetBounds, - Components.Mask, - Components.Origin, - Components.Pipeline, - Components.ScaleMode, - Components.ScrollFactor, - Components.Size, - Components.TextureCrop, - Components.Tint, - Components.Transform, - Components.Visible, - SpriteRender - ], - - initialize: - - function Sprite (scene, x, y, texture, frame) - { - GameObject.call(this, scene, 'Sprite'); - - /** - * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. - * - * @name Phaser.GameObjects.Sprite#_crop - * @type {object} - * @private - * @since 3.11.0 - */ - this._crop = this.resetCropObject(); - - /** - * The Animation Controller of this Sprite. - * - * @name Phaser.GameObjects.Sprite#anims - * @type {Phaser.GameObjects.Components.Animation} - * @since 3.0.0 - */ - this.anims = new Components.Animation(this); - - this.setTexture(texture, frame); - this.setPosition(x, y); - this.setSizeToFrame(); - this.setOriginFromFrame(); - this.initPipeline(); - }, - - /** - * Update this Sprite's animations. - * - * @method Phaser.GameObjects.Sprite#preUpdate - * @protected - * @since 3.0.0 - * - * @param {number} time - The current timestamp. - * @param {number} delta - The delta time, in ms, elapsed since the last frame. - */ - preUpdate: function (time, delta) - { - this.anims.update(time, delta); - }, - - /** - * Start playing the given animation. - * - * @method Phaser.GameObjects.Sprite#play - * @since 3.0.0 - * - * @param {string} key - The string-based key of the animation to play. - * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.Sprite} This Game Object. - */ - play: function (key, ignoreIfPlaying, startFrame) - { - this.anims.play(key, ignoreIfPlaying, startFrame); - - return this; - }, - - /** - * Build a JSON representation of this Sprite. - * - * @method Phaser.GameObjects.Sprite#toJSON - * @since 3.0.0 - * - * @return {JSONGameObject} A JSON representation of the Game Object. - */ - toJSON: function () - { - var data = Components.ToJSON(this); - - // Extra Sprite data is added here - - return data; - } - -}); - -module.exports = Sprite; - - -/***/ }), -/* 57 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points). - * - * @function Phaser.Math.Distance.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var DistanceBetween = function (x1, y1, x2, y2) -{ - var dx = x1 - x2; - var dy = y1 - y2; - - return Math.sqrt(dx * dx + dy * dy); -}; - -module.exports = DistanceBetween; - - -/***/ }), -/* 58 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Wrap the given `value` between `min` and `max. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The wrapped value. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; - -module.exports = Wrap; - - -/***/ }), -/* 59 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11569,6 +10360,1251 @@ var TransformMatrix = new Class({ module.exports = TransformMatrix; +/***/ }), +/* 43 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * [description] + * + * @function Phaser.Geom.Rectangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {number} x - [description] + * @param {number} y - [description] + * + * @return {boolean} [description] + */ +var Contains = function (rect, x, y) +{ + if (rect.width <= 0 || rect.height <= 0) + { + return false; + } + + return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); +}; + +module.exports = Contains; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Check to see if the Circle contains the given x / y coordinates. + * + * @function Phaser.Geom.Circle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The Circle to check. + * @param {number} x - The x coordinate to check within the circle. + * @param {number} y - The y coordinate to check within the circle. + * + * @return {boolean} True if the coordinates are within the circle, otherwise false. + */ +var Contains = function (circle, x, y) +{ + // Check if x/y are within the bounds first + if (circle.radius > 0 && x >= circle.left && x <= circle.right && y >= circle.top && y <= circle.bottom) + { + var dx = (circle.x - x) * (circle.x - x); + var dy = (circle.y - y) * (circle.y - y); + + return (dx + dy) <= (circle.radius * circle.radius); + } + else + { + return false; + } +}; + +module.exports = Contains; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the top of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetTop + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetTop = function (gameObject, value) +{ + gameObject.y = value + (gameObject.height * gameObject.originY); + + return gameObject; +}; + +module.exports = SetTop; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the top coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetTop + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The top coordinate of the bounds of the Game Object. + */ +var GetTop = function (gameObject) +{ + return gameObject.y - (gameObject.height * gameObject.originY); +}; + +module.exports = GetTop; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetRight + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetRight = function (gameObject, value) +{ + gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX); + + return gameObject; +}; + +module.exports = SetRight; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the right coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetRight + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The right coordinate of the bounds of the Game Object. + */ +var GetRight = function (gameObject) +{ + return (gameObject.x + gameObject.width) - (gameObject.width * gameObject.originX); +}; + +module.exports = GetRight; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetLeft + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetLeft = function (gameObject, value) +{ + gameObject.x = value + (gameObject.width * gameObject.originX); + + return gameObject; +}; + +module.exports = SetLeft; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the left coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetLeft + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The left coordinate of the bounds of the Game Object. + */ +var GetLeft = function (gameObject) +{ + return gameObject.x - (gameObject.width * gameObject.originX); +}; + +module.exports = GetLeft; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetBottom + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetBottom = function (gameObject, value) +{ + gameObject.y = (value - gameObject.height) + (gameObject.height * gameObject.originY); + + return gameObject; +}; + +module.exports = SetBottom; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the bottom coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetBottom + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The bottom coordinate of the bounds of the Game Object. + */ +var GetBottom = function (gameObject) +{ + return (gameObject.y + gameObject.height) - (gameObject.height * gameObject.originY); +}; + +module.exports = GetBottom; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileY + * @private + * @since 3.0.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var WorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return snapToFloor + ? Math.floor(worldY / tileHeight) + : worldY / tileHeight; +}; + +module.exports = WorldToTileY; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileX + * @private + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The X location in tile units. + */ +var WorldToTileX = function (worldX, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileWidth = layer.baseTileWidth; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + return snapToFloor + ? Math.floor(worldX / tileWidth) + : worldX / tileWidth; +}; + +module.exports = WorldToTileX; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Bodies` module contains factory methods for creating rigid body models +* with commonly used body configurations (such as rectangles, circles and other polygons). +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Bodies +*/ + +// TODO: true circle bodies + +var Bodies = {}; + +module.exports = Bodies; + +var Vertices = __webpack_require__(29); +var Common = __webpack_require__(12); +var Body = __webpack_require__(25); +var Bounds = __webpack_require__(33); +var Vector = __webpack_require__(34); +var decomp = __webpack_require__(245); + +(function() { + + /** + * Creates a new rigid body model with a rectangle hull. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method rectangle + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {object} [options] + * @return {body} A new rectangle body + */ + Bodies.rectangle = function(x, y, width, height, options) { + options = options || {}; + + var rectangle = { + label: 'Rectangle Body', + position: { x: x, y: y }, + vertices: Vertices.fromPath('L 0 0 L ' + width + ' 0 L ' + width + ' ' + height + ' L 0 ' + height) + }; + + if (options.chamfer) { + var chamfer = options.chamfer; + rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius, + chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); + delete options.chamfer; + } + + return Body.create(Common.extend({}, rectangle, options)); + }; + + /** + * Creates a new rigid body model with a trapezoid hull. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method trapezoid + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {number} slope + * @param {object} [options] + * @return {body} A new trapezoid body + */ + Bodies.trapezoid = function(x, y, width, height, slope, options) { + options = options || {}; + + slope *= 0.5; + var roof = (1 - (slope * 2)) * width; + + var x1 = width * slope, + x2 = x1 + roof, + x3 = x2 + x1, + verticesPath; + + if (slope < 0.5) { + verticesPath = 'L 0 0 L ' + x1 + ' ' + (-height) + ' L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0'; + } else { + verticesPath = 'L 0 0 L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0'; + } + + var trapezoid = { + label: 'Trapezoid Body', + position: { x: x, y: y }, + vertices: Vertices.fromPath(verticesPath) + }; + + if (options.chamfer) { + var chamfer = options.chamfer; + trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius, + chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); + delete options.chamfer; + } + + return Body.create(Common.extend({}, trapezoid, options)); + }; + + /** + * Creates a new rigid body model with a circle hull. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method circle + * @param {number} x + * @param {number} y + * @param {number} radius + * @param {object} [options] + * @param {number} [maxSides] + * @return {body} A new circle body + */ + Bodies.circle = function(x, y, radius, options, maxSides) { + options = options || {}; + + var circle = { + label: 'Circle Body', + circleRadius: radius + }; + + // approximate circles with polygons until true circles implemented in SAT + maxSides = maxSides || 25; + var sides = Math.ceil(Math.max(10, Math.min(maxSides, radius))); + + // optimisation: always use even number of sides (half the number of unique axes) + if (sides % 2 === 1) + sides += 1; + + return Bodies.polygon(x, y, sides, radius, Common.extend({}, circle, options)); + }; + + /** + * Creates a new rigid body model with a regular polygon hull with the given number of sides. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method polygon + * @param {number} x + * @param {number} y + * @param {number} sides + * @param {number} radius + * @param {object} [options] + * @return {body} A new regular polygon body + */ + Bodies.polygon = function(x, y, sides, radius, options) { + options = options || {}; + + if (sides < 3) + return Bodies.circle(x, y, radius, options); + + var theta = 2 * Math.PI / sides, + path = '', + offset = theta * 0.5; + + for (var i = 0; i < sides; i += 1) { + var angle = offset + (i * theta), + xx = Math.cos(angle) * radius, + yy = Math.sin(angle) * radius; + + path += 'L ' + xx.toFixed(3) + ' ' + yy.toFixed(3) + ' '; + } + + var polygon = { + label: 'Polygon Body', + position: { x: x, y: y }, + vertices: Vertices.fromPath(path) + }; + + if (options.chamfer) { + var chamfer = options.chamfer; + polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius, + chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); + delete options.chamfer; + } + + return Body.create(Common.extend({}, polygon, options)); + }; + + /** + * Creates a body using the supplied vertices (or an array containing multiple sets of vertices). + * If the vertices are convex, they will pass through as supplied. + * Otherwise if the vertices are concave, they will be decomposed if [poly-decomp.js](https://github.com/schteppe/poly-decomp.js) is available. + * Note that this process is not guaranteed to support complex sets of vertices (e.g. those with holes may fail). + * By default the decomposition will discard collinear edges (to improve performance). + * It can also optionally discard any parts that have an area less than `minimumArea`. + * If the vertices can not be decomposed, the result will fall back to using the convex hull. + * The options parameter is an object that specifies any `Matter.Body` properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method fromVertices + * @param {number} x + * @param {number} y + * @param [[vector]] vertexSets + * @param {object} [options] + * @param {bool} [flagInternal=false] + * @param {number} [removeCollinear=0.01] + * @param {number} [minimumArea=10] + * @return {body} + */ + Bodies.fromVertices = function(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea) { + var body, + parts, + isConvex, + vertices, + i, + j, + k, + v, + z; + + options = options || {}; + parts = []; + + flagInternal = typeof flagInternal !== 'undefined' ? flagInternal : false; + removeCollinear = typeof removeCollinear !== 'undefined' ? removeCollinear : 0.01; + minimumArea = typeof minimumArea !== 'undefined' ? minimumArea : 10; + + if (!decomp) { + Common.warn('Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull.'); + } + + // ensure vertexSets is an array of arrays + if (!Common.isArray(vertexSets[0])) { + vertexSets = [vertexSets]; + } + + for (v = 0; v < vertexSets.length; v += 1) { + vertices = vertexSets[v]; + isConvex = Vertices.isConvex(vertices); + + if (isConvex || !decomp) { + if (isConvex) { + vertices = Vertices.clockwiseSort(vertices); + } else { + // fallback to convex hull when decomposition is not possible + vertices = Vertices.hull(vertices); + } + + parts.push({ + position: { x: x, y: y }, + vertices: vertices + }); + } else { + // initialise a decomposition + var concave = vertices.map(function(vertex) { + return [vertex.x, vertex.y]; + }); + + // vertices are concave and simple, we can decompose into parts + decomp.makeCCW(concave); + if (removeCollinear !== false) + decomp.removeCollinearPoints(concave, removeCollinear); + + // use the quick decomposition algorithm (Bayazit) + var decomposed = decomp.quickDecomp(concave); + + // for each decomposed chunk + for (i = 0; i < decomposed.length; i++) { + var chunk = decomposed[i]; + + // convert vertices into the correct structure + var chunkVertices = chunk.map(function(vertices) { + return { + x: vertices[0], + y: vertices[1] + }; + }); + + // skip small chunks + if (minimumArea > 0 && Vertices.area(chunkVertices) < minimumArea) + continue; + + // create a compound part + parts.push({ + position: Vertices.centre(chunkVertices), + vertices: chunkVertices + }); + } + } + } + + // create body parts + for (i = 0; i < parts.length; i++) { + parts[i] = Body.create(Common.extend(parts[i], options)); + } + + // flag internal edges (coincident part edges) + if (flagInternal) { + var coincident_max_dist = 5; + + for (i = 0; i < parts.length; i++) { + var partA = parts[i]; + + for (j = i + 1; j < parts.length; j++) { + var partB = parts[j]; + + if (Bounds.overlaps(partA.bounds, partB.bounds)) { + var pav = partA.vertices, + pbv = partB.vertices; + + // iterate vertices of both parts + for (k = 0; k < partA.vertices.length; k++) { + for (z = 0; z < partB.vertices.length; z++) { + // find distances between the vertices + var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])), + db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length])); + + // if both vertices are very close, consider the edge concident (internal) + if (da < coincident_max_dist && db < coincident_max_dist) { + pav[k].isInternal = true; + pbv[z].isInternal = true; + } + } + } + + } + } + } + } + + if (parts.length > 1) { + // create the parent body to be returned, that contains generated compound parts + body = Body.create(Common.extend({ parts: parts.slice(0) }, options)); + Body.setPosition(body, { x: x, y: y }); + + return body; + } else { + return parts[0]; + } + }; + +})(); + + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(20); +var File = __webpack_require__(22); +var FileTypesManager = __webpack_require__(7); +var GetFastValue = __webpack_require__(1); +var GetValue = __webpack_require__(4); +var IsPlainObject = __webpack_require__(8); + +/** + * @typedef {object} Phaser.Loader.FileTypes.JSONFileConfig + * + * @property {string} key - The key of the file. Must be unique within both the Loader and the JSON Cache. + * @property {string|any} [url] - The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly added to the Cache. + * @property {string} [extension='json'] - The default file extension to use if no url is provided. + * @property {string} [dataKey] - If specified instead of the whole JSON file being parsed and added to the Cache, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. + * @property {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ + +/** + * @classdesc + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * + * @class JSONFile + * @extends Phaser.Loader.File + * @memberOf Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var JSONFile = new Class({ + + Extends: File, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function JSONFile (loader, key, url, xhrSettings, dataKey) + { + var extension = 'json'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); + } + + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey + }; + + File.call(this, loader, fileConfig); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + var json = JSON.parse(this.xhrLoader.responseText); + + var key = this.config; + + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#json + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig|Phaser.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new JSONFile(this, key[i])); + } + } + else + { + this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = JSONFile; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(16); +var GameObject = __webpack_require__(17); +var SpriteRender = __webpack_require__(895); + +/** + * @classdesc + * A Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + * + * @class Sprite + * @extends Phaser.GameObjects.GameObject + * @memberOf Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScaleMode + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.TextureCrop + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var Sprite = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScaleMode, + Components.ScrollFactor, + Components.Size, + Components.TextureCrop, + Components.Tint, + Components.Transform, + Components.Visible, + SpriteRender + ], + + initialize: + + function Sprite (scene, x, y, texture, frame) + { + GameObject.call(this, scene, 'Sprite'); + + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.GameObjects.Sprite#_crop + * @type {object} + * @private + * @since 3.11.0 + */ + this._crop = this.resetCropObject(); + + /** + * The Animation Controller of this Sprite. + * + * @name Phaser.GameObjects.Sprite#anims + * @type {Phaser.GameObjects.Components.Animation} + * @since 3.0.0 + */ + this.anims = new Components.Animation(this); + + this.setTexture(texture, frame); + this.setPosition(x, y); + this.setSizeToFrame(); + this.setOriginFromFrame(); + this.initPipeline(); + }, + + /** + * Update this Sprite's animations. + * + * @method Phaser.GameObjects.Sprite#preUpdate + * @protected + * @since 3.0.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + this.anims.update(time, delta); + }, + + /** + * Start playing the given animation. + * + * @method Phaser.GameObjects.Sprite#play + * @since 3.0.0 + * + * @param {string} key - The string-based key of the animation to play. + * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. + * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. + * + * @return {Phaser.GameObjects.Sprite} This Game Object. + */ + play: function (key, ignoreIfPlaying, startFrame) + { + this.anims.play(key, ignoreIfPlaying, startFrame); + + return this; + }, + + /** + * Build a JSON representation of this Sprite. + * + * @method Phaser.GameObjects.Sprite#toJSON + * @since 3.0.0 + * + * @return {JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + var data = Components.ToJSON(this); + + // Extra Sprite data is added here + + return data; + }, + + /** + * Handles the pre-destroy step for the Sprite, which removes the Animation component. + * + * @method Phaser.GameObjects.Sprite#preDestroy + * @private + * @since 3.14.0 + */ + preDestroy: function () + { + this.anims.destroy(); + + this.anims = undefined; + } + +}); + +module.exports = Sprite; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points). + * + * @function Phaser.Math.Distance.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var DistanceBetween = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetween; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Wrap the given `value` between `min` and `max. + * + * @function Phaser.Math.Wrap + * @since 3.0.0 + * + * @param {number} value - The value to wrap. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The wrapped value. + */ +var Wrap = function (value, min, max) +{ + var range = max - min; + + return (min + ((((value - min) % range) + range) % range)); +}; + +module.exports = Wrap; + + /***/ }), /* 60 */ /***/ (function(module, exports, __webpack_require__) { @@ -12734,8 +12770,8 @@ module.exports = Tile; * @private * @since 3.0.0 * - * @param {Phaser.Tilemaps.Tile} tile - [description] - * @param {boolean} [collides=true] - [description] + * @param {Phaser.Tilemaps.Tile} tile - The Tile to set the collision on. + * @param {boolean} [collides=true] - Should the tile index collide or not? */ var SetTileCollision = function (tile, collides) { @@ -12773,7 +12809,7 @@ module.exports = Composite; var Events = __webpack_require__(74); var Common = __webpack_require__(12); -var Bounds = __webpack_require__(32); +var Bounds = __webpack_require__(33); var Body = __webpack_require__(25); (function() { @@ -13961,12 +13997,12 @@ var Random = __webpack_require__(203); * @constructor * @since 3.0.0 * - * @param {number} [x1=0] - [description] - * @param {number} [y1=0] - [description] - * @param {number} [x2=0] - [description] - * @param {number} [y2=0] - [description] - * @param {number} [x3=0] - [description] - * @param {number} [y3=0] - [description] + * @param {number} [x1=0] - `x` coordinate of the first point. + * @param {number} [y1=0] - `y` coordinate of the first point. + * @param {number} [x2=0] - `x` coordinate of the second point. + * @param {number} [y2=0] - `y` coordinate of the second point. + * @param {number} [x3=0] - `x` coordinate of the third point. + * @param {number} [y3=0] - `y` coordinate of the third point. */ var Triangle = new Class({ @@ -13982,7 +14018,7 @@ var Triangle = new Class({ if (y3 === undefined) { y3 = 0; } /** - * [description] + * `x` coordinate of the first point. * * @name Phaser.Geom.Triangle#x1 * @type {number} @@ -13992,7 +14028,7 @@ var Triangle = new Class({ this.x1 = x1; /** - * [description] + * `y` coordinate of the first point. * * @name Phaser.Geom.Triangle#y1 * @type {number} @@ -14002,7 +14038,7 @@ var Triangle = new Class({ this.y1 = y1; /** - * [description] + * `x` coordinate of the second point. * * @name Phaser.Geom.Triangle#x2 * @type {number} @@ -14012,7 +14048,7 @@ var Triangle = new Class({ this.x2 = x2; /** - * [description] + * `y` coordinate of the second point. * * @name Phaser.Geom.Triangle#y2 * @type {number} @@ -14022,7 +14058,7 @@ var Triangle = new Class({ this.y2 = y2; /** - * [description] + * `x` coordinate of the third point. * * @name Phaser.Geom.Triangle#x3 * @type {number} @@ -14032,7 +14068,7 @@ var Triangle = new Class({ this.x3 = x3; /** - * [description] + * `y` coordinate of the third point. * * @name Phaser.Geom.Triangle#y3 * @type {number} @@ -14043,15 +14079,15 @@ var Triangle = new Class({ }, /** - * [description] + * Checks whether a given points lies within the triangle. * * @method Phaser.Geom.Triangle#contains * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate of the point to check. + * @param {number} y - The y coordinate of the point to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the coordinate pair is within the triangle, otherwise `false`. */ contains: function (x, y) { @@ -14059,17 +14095,17 @@ var Triangle = new Class({ }, /** - * [description] + * Returns a specific point on the triangle. * * @method Phaser.Geom.Triangle#getPoint * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [output,$return] * - * @param {number} position - [description] - * @param {(Phaser.Geom.Point|object)} [output] - [description] + * @param {number} position - Position as float within `0` and `1`. `0` equals the first point. + * @param {(Phaser.Geom.Point|object)} [output] - Optional Point, or point-like object, that the calculated point will be written to. * - * @return {(Phaser.Geom.Point|object)} [description] + * @return {(Phaser.Geom.Point|object)} Calculated `Point` that represents the requested position. It is the same as `output` when this parameter has been given. */ getPoint: function (position, output) { @@ -14077,18 +14113,18 @@ var Triangle = new Class({ }, /** - * [description] + * Calculates a list of evenly distributed points on the triangle. It is either possible to pass an amount of points to be generated (`quantity`) or the distance between two points (`stepRate`). * * @method Phaser.Geom.Triangle#getPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - [description] - * @param {number} [stepRate] - [description] - * @param {(array|Phaser.Geom.Point[])} [output] - [description] + * @param {integer} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param {number} [stepRate] - Distance between two points. Will only be used when `quantity` is falsey. + * @param {(array|Phaser.Geom.Point[])} [output] - Optional Array for writing the calculated points into. Otherwise a new array will be created. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} Returns a list of calculated `Point` instances or the filled array passed as parameter `output`. */ getPoints: function (quantity, stepRate, output) { @@ -14096,16 +14132,16 @@ var Triangle = new Class({ }, /** - * [description] + * Returns a random point along the triangle. * * @method Phaser.Geom.Triangle#getRandomPoint * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [point,$return] * - * @param {Phaser.Geom.Point} [point] - [description] + * @param {Phaser.Geom.Point} [point] - Optional `Point` that should be modified. Otherwise a new one will be created. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} Random `Point`. When parameter `point` has been provided it will be returned. */ getRandomPoint: function (point) { @@ -14113,17 +14149,17 @@ var Triangle = new Class({ }, /** - * [description] + * Sets all three points of the triangle. Leaving out any coordinate sets it to be `0`. * * @method Phaser.Geom.Triangle#setTo * @since 3.0.0 * - * @param {number} [x1=0] - [description] - * @param {number} [y1=0] - [description] - * @param {number} [x2=0] - [description] - * @param {number} [y2=0] - [description] - * @param {number} [x3=0] - [description] - * @param {number} [y3=0] - [description] + * @param {number} [x1=0] - `x` coordinate of the first point. + * @param {number} [y1=0] - `y` coordinate of the first point. + * @param {number} [x2=0] - `x` coordinate of the second point. + * @param {number} [y2=0] - `y` coordinate of the second point. + * @param {number} [x3=0] - `x` coordinate of the third point. + * @param {number} [y3=0] - `y` coordinate of the third point. * * @return {Phaser.Geom.Triangle} This Triangle object. */ @@ -14212,7 +14248,7 @@ var Triangle = new Class({ }, /** - * [description] + * Left most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. * * @name Phaser.Geom.Triangle#left * @type {number} @@ -14250,7 +14286,7 @@ var Triangle = new Class({ }, /** - * [description] + * Right most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. * * @name Phaser.Geom.Triangle#right * @type {number} @@ -14288,7 +14324,7 @@ var Triangle = new Class({ }, /** - * [description] + * Top most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. * * @name Phaser.Geom.Triangle#top * @type {number} @@ -14326,7 +14362,7 @@ var Triangle = new Class({ }, /** - * [description] + * Bottom most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. * * @name Phaser.Geom.Triangle#bottom * @type {number} @@ -15404,10 +15440,10 @@ var Constraint = {}; module.exports = Constraint; -var Vertices = __webpack_require__(34); -var Vector = __webpack_require__(33); +var Vertices = __webpack_require__(29); +var Vector = __webpack_require__(34); var Sleeping = __webpack_require__(89); -var Bounds = __webpack_require__(32); +var Bounds = __webpack_require__(33); var Axes = __webpack_require__(151); var Common = __webpack_require__(12); @@ -16416,9 +16452,9 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getEndPoint * @since 3.0.0 * - * @param {Phaser.Math.Vector2} out - [description] + * @param {Phaser.Math.Vector2} [out] - Optional Vector object to store the result in. * - * @return {Phaser.Math.Vector2} [description] + * @return {Phaser.Math.Vector2} Vector2 containing the coordinates of the curves end point. */ getEndPoint: function (out) { @@ -16622,7 +16658,7 @@ var Curve = new Class({ * @param {number} t - [description] * @param {Phaser.Math.Vector2} [out] - [description] * - * @return {Phaser.Math.Vector2} [description] + * @return {Phaser.Math.Vector2} Vector approximating the tangent line at the point t (delta +/- 0.0001) */ getTangent: function (t, out) { @@ -16804,7 +16840,7 @@ module.exports = Curve; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(43); +var Contains = __webpack_require__(44); var GetPoint = __webpack_require__(442); var GetPoints = __webpack_require__(440); var Random = __webpack_require__(211); @@ -17730,11 +17766,11 @@ module.exports = LayerData; * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {boolean} + * @return {boolean} `true` if the tile coordinates are within the bounds of the layer, otherwise `false`. */ var IsInLayerBounds = function (tileX, tileY, layer) { @@ -18247,16 +18283,16 @@ module.exports = TWEEN_CONST; */ /** - * [description] + * Retrieves the value of the given key from an object. * * @function Phaser.Tweens.Builders.GetBoolean * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {*} defaultValue - [description] + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The key to look for in the `source` object. + * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. * - * @return {*} [description] + * @return {*} The retrieved value. */ var GetBoolean = function (source, key, defaultValue) { @@ -18373,7 +18409,7 @@ var Class = __webpack_require__(0); * @generic T * @genericUse {T[]} - [elements] * - * @param {Array.<*>} [elements] - [description] + * @param {Array.<*>} [elements] - An optional array of elements to insert into this Set. */ var Set = new Class({ @@ -18382,7 +18418,7 @@ var Set = new Class({ function Set (elements) { /** - * [description] + * The entries of this Set. Stored internally as an array. * * @genericUse {T[]} - [$type] * @@ -18403,7 +18439,7 @@ var Set = new Class({ }, /** - * [description] + * Inserts the provided value into this Set. If the value is already contained in this Set this method will have no effect. * * @method Phaser.Structs.Set#set * @since 3.0.0 @@ -18411,7 +18447,7 @@ var Set = new Class({ * @genericUse {T} - [value] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {*} value - [description] + * @param {*} value - The value to insert into this Set. * * @return {Phaser.Structs.Set} This Set object. */ @@ -18426,17 +18462,18 @@ var Set = new Class({ }, /** - * [description] + * Get an element of this Set which has a property of the specified name, if that property is equal to the specified value. + * If no elements of this Set satisfy the condition then this method will return `null`. * * @method Phaser.Structs.Set#get * @since 3.0.0 * * @genericUse {T} - [value,$return] * - * @param {string} property - [description] - * @param {*} value - [description] + * @param {string} property - The property name to check on the elements of this Set. + * @param {*} value - The value to check for. * - * @return {*} [description] + * @return {*} The first element of this Set that meets the required condition, or `null` if this Set contains no elements that meet the condition. */ get: function (property, value) { @@ -18452,14 +18489,14 @@ var Set = new Class({ }, /** - * [description] + * Returns an array containing all the values in this Set. * * @method Phaser.Structs.Set#getArray * @since 3.0.0 * * @genericUse {T[]} - [$return] * - * @return {Array.<*>} [description] + * @return {Array.<*>} An array containing all the values in this Set. */ getArray: function () { @@ -18467,7 +18504,7 @@ var Set = new Class({ }, /** - * [description] + * Removes the given value from this Set if this Set contains that value. * * @method Phaser.Structs.Set#delete * @since 3.0.0 @@ -18475,7 +18512,7 @@ var Set = new Class({ * @genericUse {T} - [value] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {*} value - [description] + * @param {*} value - The value to remove from the Set. * * @return {Phaser.Structs.Set} This Set object. */ @@ -18492,7 +18529,7 @@ var Set = new Class({ }, /** - * [description] + * Dumps the contents of this Set to the console via `console.group`. * * @method Phaser.Structs.Set#dump * @since 3.0.0 @@ -18513,7 +18550,8 @@ var Set = new Class({ }, /** - * For when you know this Set will be modified during the iteration. + * Passes each value in this Set to the given callback. + * Use this function when you know this Set will be modified during the iteration, otherwise use `iterate`. * * @method Phaser.Structs.Set#each * @since 3.0.0 @@ -18521,8 +18559,8 @@ var Set = new Class({ * @genericUse {EachSetCallback.} - [callback] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {EachSetCallback} callback - [description] - * @param {*} callbackScope - [description] + * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains. + * @param {*} callbackScope - The scope of the callback. * * @return {Phaser.Structs.Set} This Set object. */ @@ -18557,6 +18595,7 @@ var Set = new Class({ }, /** + * Passes each value in this Set to the given callback. * For when you absolutely know this Set won't be modified during the iteration. * * @method Phaser.Structs.Set#iterate @@ -18565,8 +18604,8 @@ var Set = new Class({ * @genericUse {EachSetCallback.} - [callback] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {EachSetCallback} callback - [description] - * @param {*} [callbackScope] - [description] + * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains. + * @param {*} callbackScope - The scope of the callback. * * @return {Phaser.Structs.Set} This Set object. */ @@ -18600,14 +18639,14 @@ var Set = new Class({ }, /** - * [description] + * Goes through each entry in this Set and invokes the given function on them, passing in the arguments. * * @method Phaser.Structs.Set#iterateLocal * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {string} callbackKey - [description] + * @param {string} callbackKey - The key of the function to be invoked on each Set entry. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. * * @return {Phaser.Structs.Set} This Set object. @@ -18635,7 +18674,7 @@ var Set = new Class({ }, /** - * [description] + * Clears this Set so that it no longer contains any values. * * @method Phaser.Structs.Set#clear * @since 3.0.0 @@ -18652,16 +18691,16 @@ var Set = new Class({ }, /** - * [description] + * Returns `true` if this Set contains the given value, otherwise returns `false`. * * @method Phaser.Structs.Set#contains * @since 3.0.0 * * @genericUse {T} - [value] * - * @param {*} value - [description] + * @param {*} value - The value to check for in this Set. * - * @return {boolean} [description] + * @return {boolean} `true` if the given value was found in this Set, otherwise `false`. */ contains: function (value) { @@ -18669,16 +18708,16 @@ var Set = new Class({ }, /** - * [description] + * Returns a new Set containing all values that are either in this Set or in the Set provided as an argument. * * @method Phaser.Structs.Set#union * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [set,$return] * - * @param {Phaser.Structs.Set} set - [description] + * @param {Phaser.Structs.Set} set - The Set to perform the union with. * - * @return {Phaser.Structs.Set} [description] + * @return {Phaser.Structs.Set} A new Set containing all the values in this Set and the Set provided as an argument. */ union: function (set) { @@ -18698,16 +18737,16 @@ var Set = new Class({ }, /** - * [description] + * Returns a new Set that contains only the values which are in this Set and that are also in the given Set. * * @method Phaser.Structs.Set#intersect * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [set,$return] * - * @param {Phaser.Structs.Set} set - [description] + * @param {Phaser.Structs.Set} set - The Set to intersect this set with. * - * @return {Phaser.Structs.Set} [description] + * @return {Phaser.Structs.Set} The result of the intersection, as a new Set. */ intersect: function (set) { @@ -18725,16 +18764,16 @@ var Set = new Class({ }, /** - * [description] + * Returns a new Set containing all the values in this Set which are *not* also in the given Set. * * @method Phaser.Structs.Set#difference * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [set,$return] * - * @param {Phaser.Structs.Set} set - [description] + * @param {Phaser.Structs.Set} set - The Set to perform the difference with. * - * @return {Phaser.Structs.Set} [description] + * @return {Phaser.Structs.Set} A new Set containing all the values in this Set that are not also in the Set provided as an argument to this method. */ difference: function (set) { @@ -18752,7 +18791,9 @@ var Set = new Class({ }, /** - * [description] + * The size of this Set. This is the number of entries within it. + * Changing the size will truncate the Set if the given value is smaller than the current size. + * Increasing the size larger than the current size has no effect. * * @name Phaser.Structs.Set#size * @type {integer} @@ -18767,7 +18808,14 @@ var Set = new Class({ set: function (value) { - return this.entries.length = value; + if (value < this.entries.length) + { + return this.entries.length = value; + } + else + { + return this.entries.length; + } } } @@ -18794,7 +18842,7 @@ var GetValue = __webpack_require__(4); var IsPlainObject = __webpack_require__(8); var Range = __webpack_require__(341); var Set = __webpack_require__(96); -var Sprite = __webpack_require__(56); +var Sprite = __webpack_require__(57); /** * @callback GroupCallback @@ -18888,7 +18936,7 @@ var Sprite = __webpack_require__(56); * @constructor * @since 3.0.0 * @param {Phaser.Scene} scene - The scene this group belongs to. - * @param {(Phaser.GameObjects.GameObject[]|GroupConfig)} [children] - Game objects to add to this group; or the `config` argument. + * @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. * @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings. * * @see Phaser.Physics.Arcade.Group @@ -20595,7 +20643,7 @@ function init () OS.cordova = true; } - if (process && process.versions && process.versions.node) + if (typeof process !== 'undefined' && process.versions && process.versions.node) { OS.node = true; } @@ -21907,7 +21955,7 @@ var Tileset = new Class({ if (rowCount % 1 !== 0 || colCount % 1 !== 0) { - console.warn('Tileset ' + this.name + ' image tile area is not an even multiple of tile size'); + console.warn('Image tile area not tile size multiple in: ' + this.name); } // In Tiled a tileset image that is not an even multiple of the tile dimensions is truncated @@ -21964,8 +22012,8 @@ module.exports = Tileset; * @private * @since 3.0.0 * - * @param {integer} tileY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileY - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {number} @@ -22009,8 +22057,8 @@ module.exports = TileToWorldY; * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {number} @@ -22057,8 +22105,7 @@ var IsInLayerBounds = __webpack_require__(88); * * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates @@ -22148,9 +22195,9 @@ module.exports = { TileToWorldXY: __webpack_require__(490), TileToWorldY: __webpack_require__(108), WeightedRandomize: __webpack_require__(489), - WorldToTileX: __webpack_require__(53), + WorldToTileX: __webpack_require__(54), WorldToTileXY: __webpack_require__(488), - WorldToTileY: __webpack_require__(52) + WorldToTileY: __webpack_require__(53) }; @@ -22325,7 +22372,7 @@ module.exports = { var Class = __webpack_require__(0); var Components = __webpack_require__(265); -var Sprite = __webpack_require__(56); +var Sprite = __webpack_require__(57); /** * @classdesc @@ -22621,16 +22668,16 @@ var Point = __webpack_require__(6); // See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ /** - * [description] + * Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting. * * @function Phaser.Geom.Intersects.LineToLine * @since 3.0.0 * - * @param {Phaser.Geom.Line} line1 - [description] - * @param {Phaser.Geom.Line} line2 - [description] - * @param {Phaser.Geom.Point} [out] - [description] + * @param {Phaser.Geom.Line} line1 - The first Line to check. + * @param {Phaser.Geom.Line} line2 - The second Line to check. + * @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection. * - * @return {boolean} [description] + * @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`. */ var LineToLine = function (line1, line2, out) { @@ -23708,13 +23755,13 @@ var StableSort = __webpack_require__(120); * @callback EachListCallback * @generic I - [item] * - * @param {*} item - [description] + * @param {*} item - The item which is currently being processed. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. */ /** * @classdesc - * [description] + * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. * * @class List * @memberOf Phaser.Structs @@ -23723,7 +23770,7 @@ var StableSort = __webpack_require__(120); * * @generic T * - * @param {*} parent - [description] + * @param {*} parent - The parent of this list. */ var List = new Class({ @@ -23753,7 +23800,9 @@ var List = new Class({ this.list = []; /** - * [description] + * The index of the current element. + * + * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. * * @name Phaser.Structs.List#position * @type {integer} @@ -23791,17 +23840,17 @@ var List = new Class({ }, /** - * [description] + * Adds the given item to the end of the list. Each item must be unique. * * @method Phaser.Structs.List#add * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*|Array.<*>} child - [description] + * @param {*|Array.<*>} child - The item, or array of items, to add to the list. * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. * - * @return {*} [description] + * @return {*} The list's underlying array. */ add: function (child, skipCallback) { @@ -23816,18 +23865,18 @@ var List = new Class({ }, /** - * [description] + * Adds an item to list, starting at a specified index. Each item must be unique within the list. * * @method Phaser.Structs.List#addAt * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] - * @param {integer} [index=0] - [description] + * @param {*} child - The item, or array of items, to add to the list. + * @param {integer} [index=0] - The index in the list at which the element(s) will be inserted. * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. * - * @return {*} [description] + * @return {*} The List's underlying array. */ addAt: function (child, index, skipCallback) { @@ -23842,16 +23891,16 @@ var List = new Class({ }, /** - * [description] + * Retrieves the item at a given position inside the List. * * @method Phaser.Structs.List#getAt * @since 3.0.0 * * @genericUse {T} - [$return] * - * @param {integer} index - [description] + * @param {integer} index - The index of the item. * - * @return {*} [description] + * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds. */ getAt: function (index) { @@ -23859,16 +23908,16 @@ var List = new Class({ }, /** - * [description] + * Locates an item within the List and returns its index. * * @method Phaser.Structs.List#getIndex * @since 3.0.0 * * @genericUse {T} - [child] * - * @param {*} child - [description] + * @param {*} child - The item to locate. * - * @return {integer} [description] + * @return {integer} The index of the item within the List, or -1 if it's not in the List. */ getIndex: function (child) { @@ -23888,7 +23937,7 @@ var List = new Class({ * * @param {string} property - The property to lexically sort by. * - * @return {Array.<*>} [description] + * @return {Phaser.Structs.List} This List object. */ sort: function (property) { @@ -23903,7 +23952,7 @@ var List = new Class({ }, /** - * [description] + * Internal handler for the {@link #sort} method which compares two items. * * @method Phaser.Structs.List#sortHandler * @private @@ -23911,10 +23960,10 @@ var List = new Class({ * * @genericUse {T} - [childA,childB] * - * @param {*} childA - [description] - * @param {*} childB - [description] + * @param {*} childA - The first item to compare. + * @param {*} childB - The second item to compare. * - * @return {integer} [description] + * @return {integer} The result of the comparison, which will be negative if the first item is smaller then second, positive if the first item is larger than the second, or 0 if they're equal. */ sortHandler: function (childA, childB) { @@ -23959,7 +24008,7 @@ var List = new Class({ }, /** - * [description] + * Returns the first element in a given part of the List which matches a specific criterion. * * @method Phaser.Structs.List#getFirst * @since 3.0.0 @@ -23967,12 +24016,12 @@ var List = new Class({ * @genericUse {T} - [value] * @genericUse {T | null} - [$return] * - * @param {string} property - [description] - * @param {*} value - [description] - * @param {number} [startIndex=0] - [description] - * @param {number} [endIndex] - [description] + * @param {string} property - The name of the property to test or a falsey value to have no criterion. + * @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence. + * @param {number} [startIndex=0] - The position in the List to start the search at. + * @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked. * - * @return {?*} [description] + * @return {?*} The first item which matches the given criterion, or `null` if no such item exists. */ getFirst: function (property, value, startIndex, endIndex) { @@ -24005,7 +24054,7 @@ var List = new Class({ * @param {integer} [startIndex] - The first child index to start the search from. * @param {integer} [endIndex] - The last child index to search up until. * - * @return {Array.<*>} [description] + * @return {Array.<*>} All items of the List which match the given criterion, if any. */ getAll: function (property, value, startIndex, endIndex) { @@ -24013,17 +24062,17 @@ var List = new Class({ }, /** - * [description] + * Returns the total number of items in the List which have a property matching the given value. * * @method Phaser.Structs.List#count * @since 3.0.0 * * @genericUse {T} - [value] * - * @param {string} property - [description] - * @param {*} value - [description] + * @param {string} property - The property to test on each item. + * @param {*} value - The value to test the property against. * - * @return {integer} [description] + * @return {integer} The total number of matching elements. */ count: function (property, value) { @@ -24031,15 +24080,15 @@ var List = new Class({ }, /** - * [description] + * Swaps the positions of two items in the list. * * @method Phaser.Structs.List#swap * @since 3.0.0 * * @genericUse {T} - [child1,child2] * - * @param {*} child1 - [description] - * @param {*} child2 - [description] + * @param {*} child1 - The first item to swap. + * @param {*} child2 - The second item to swap. */ swap: function (child1, child2) { @@ -24047,17 +24096,17 @@ var List = new Class({ }, /** - * [description] + * Moves an item in the List to a new position. * * @method Phaser.Structs.List#moveTo * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] - * @param {integer} index - [description] + * @param {*} child - The item to move. + * @param {integer} index - Moves an item in the List to a new position. * - * @return {*} [description] + * @return {*} The item that was moved. */ moveTo: function (child, index) { @@ -24065,17 +24114,17 @@ var List = new Class({ }, /** - * [description] + * Removes one or many items from the List. * * @method Phaser.Structs.List#remove * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item, or array of items, to remove. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * - * @return {*} [description] + * @return {*} The item, or array of items, which were successfully removed from the List. */ remove: function (child, skipCallback) { @@ -24090,17 +24139,17 @@ var List = new Class({ }, /** - * [description] + * Removes the item at the given position in the List. * * @method Phaser.Structs.List#removeAt * @since 3.0.0 * * @genericUse {T} - [$return] * - * @param {integer} index - [description] + * @param {integer} index - The position to remove the item from. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * - * @return {*} [description] + * @return {*} The item that was removed. */ removeAt: function (index, skipCallback) { @@ -24115,18 +24164,18 @@ var List = new Class({ }, /** - * [description] + * Removes the items within the given range in the List. * * @method Phaser.Structs.List#removeBetween * @since 3.0.0 * * @genericUse {T[]} - [$return] * - * @param {integer} [startIndex=0] - [description] - * @param {integer} [endIndex] - [description] + * @param {integer} [startIndex=0] - The index to start removing from. + * @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * - * @return {Array.<*>} [description] + * @return {Array.<*>} An array of the items which were removed.[description] */ removeBetween: function (startIndex, endIndex, skipCallback) { @@ -24172,9 +24221,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to bring to the top of the List. * - * @return {*} [description] + * @return {*} The item which was moved. */ bringToTop: function (child) { @@ -24189,9 +24238,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to send to the back of the list. * - * @return {*} [description] + * @return {*} The item which was moved. */ sendToBack: function (child) { @@ -24206,9 +24255,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to move up. * - * @return {*} [description] + * @return {*} The item which was moved. */ moveUp: function (child) { @@ -24225,9 +24274,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to move down. * - * @return {*} [description] + * @return {*} The item which was moved. */ moveDown: function (child) { @@ -24254,7 +24303,7 @@ var List = new Class({ }, /** - * [description] + * Shuffles the items in the list. * * @method Phaser.Structs.List#shuffle * @since 3.0.0 @@ -24289,16 +24338,16 @@ var List = new Class({ }, /** - * [description] + * Checks if an item exists within the List. * * @method Phaser.Structs.List#exists * @since 3.0.0 * * @genericUse {T} - [child] * - * @param {*} child - [description] + * @param {*} child - The item to check for the existence of. * - * @return {boolean} True if the item is found in the list, otherwise false. + * @return {boolean} `true` if the item is found in the list, otherwise `false`. */ exists: function (child) { @@ -24313,8 +24362,8 @@ var List = new Class({ * * @genericUse {T} - [value] * - * @param {string} property - [description] - * @param {*} value - [description] + * @param {string} property - The name of the property to set. + * @param {*} value - The value to set the property to. * @param {integer} [startIndex] - The first child index to start the search from. * @param {integer} [endIndex] - The last child index to search up until. */ @@ -24355,7 +24404,7 @@ var List = new Class({ }, /** - * [description] + * Clears the List and recreates its internal array. * * @method Phaser.Structs.List#shutdown * @since 3.0.0 @@ -24368,7 +24417,7 @@ var List = new Class({ }, /** - * [description] + * Destroys this List. * * @method Phaser.Structs.List#destroy * @since 3.0.0 @@ -24383,7 +24432,7 @@ var List = new Class({ }, /** - * [description] + * The number of items inside the List. * * @name Phaser.Structs.List#length * @type {integer} @@ -24400,7 +24449,7 @@ var List = new Class({ }, /** - * [description] + * The first item in the List or `null` for an empty List. * * @name Phaser.Structs.List#first * @type {integer} @@ -24426,7 +24475,7 @@ var List = new Class({ }, /** - * [description] + * The last item in the List, or `null` for an empty List. * * @name Phaser.Structs.List#last * @type {integer} @@ -24452,7 +24501,9 @@ var List = new Class({ }, /** - * [description] + * The next item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. * * @name Phaser.Structs.List#next * @type {integer} @@ -24478,7 +24529,9 @@ var List = new Class({ }, /** - * [description] + * The previous item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. * * @name Phaser.Structs.List#previous * @type {integer} @@ -25016,6 +25069,9 @@ var Frame = new Class({ // Need to check for intersection between the cut area and the crop area // If there is none, we set UV to be empty, otherwise set it to be the intersection area + width = Clamp(width, 0, cw - x); + height = Clamp(height, 0, ch - y); + var cropRight = x + width; var cropBottom = y + height; @@ -26795,7 +26851,7 @@ var Components = __webpack_require__(16); var DegToRad = __webpack_require__(36); var EventEmitter = __webpack_require__(11); var Rectangle = __webpack_require__(10); -var TransformMatrix = __webpack_require__(59); +var TransformMatrix = __webpack_require__(42); var ValueToColor = __webpack_require__(197); var Vector2 = __webpack_require__(3); @@ -27588,8 +27644,8 @@ var BaseCamera = new Class({ var sy = y + ((scrollX * s + scrollY * c) * zoom); // Apply transform to point - output.x = (sx * ima + sy * imc + ime) * res; - output.y = (sx * imb + sy * imd + imf) * res; + output.x = (sx * ima + sy * imc) * res + ime; + output.y = (sx * imb + sy * imd) * res + imf; return output; }, @@ -28774,12 +28830,12 @@ module.exports = Perimeter; var BlendModes = __webpack_require__(72); var Circle = __webpack_require__(81); -var CircleContains = __webpack_require__(43); +var CircleContains = __webpack_require__(44); var Class = __webpack_require__(0); var Components = __webpack_require__(16); var GameObject = __webpack_require__(17); var Rectangle = __webpack_require__(10); -var RectangleContains = __webpack_require__(42); +var RectangleContains = __webpack_require__(43); /** * @classdesc @@ -29547,12 +29603,12 @@ var Tween = new Class({ }, /** - * [description] + * Checks if the Tween is currently active. * * @method Phaser.Tweens.Tween#isPlaying * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if the Tween is active, otherwise `false`. */ isPlaying: function () { @@ -29560,12 +29616,12 @@ var Tween = new Class({ }, /** - * [description] + * Checks if the Tween is currently paused. * * @method Phaser.Tweens.Tween#isPaused * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if the Tween is paused, otherwise `false`. */ isPaused: function () { @@ -29943,7 +29999,7 @@ var Tween = new Class({ }, /** - * [description] + * Resumes the playback of a previously paused Tween. * * @method Phaser.Tweens.Tween#resume * @since 3.0.0 @@ -30628,17 +30684,17 @@ module.exports = Tween; /** * @typedef {object} Phaser.Tweens.TweenConfigDefaults * - * @property {(object|object[])} targets - [description] - * @property {number} [delay=0] - [description] - * @property {number} [duration=1000] - [description] - * @property {string} [ease='Power0'] - [description] - * @property {array} [easeParams] - [description] - * @property {number} [hold=0] - [description] - * @property {number} [repeat=0] - [description] - * @property {number} [repeatDelay=0] - [description] - * @property {boolean} [yoyo=false] - [description] - * @property {boolean} [flipX=false] - [description] - * @property {boolean} [flipY=false] - [description] + * @property {(object|object[])} targets - The object, or an array of objects, to run the tween on. + * @property {number} [delay=0] - The number of milliseconds to delay before the tween will start. + * @property {number} [duration=1000] - The duration of the tween in milliseconds. + * @property {string} [ease='Power0'] - The easing equation to use for the tween. + * @property {array} [easeParams] - Optional easing parameters. + * @property {number} [hold=0] - The number of milliseconds to hold the tween for before yoyo'ing. + * @property {number} [repeat=0] - The number of times to repeat the tween. + * @property {number} [repeatDelay=0] - The number of milliseconds to pause before a tween will repeat. + * @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + * @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. + * @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. */ var TWEEN_DEFAULTS = { @@ -30888,7 +30944,7 @@ module.exports = GetTargets; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Formats = __webpack_require__(29); +var Formats = __webpack_require__(30); var MapData = __webpack_require__(86); var Parse = __webpack_require__(231); var Tilemap = __webpack_require__(223); @@ -30974,7 +31030,7 @@ module.exports = ParseToTilemap; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Formats = __webpack_require__(29); +var Formats = __webpack_require__(30); var LayerData = __webpack_require__(87); var MapData = __webpack_require__(86); var Tile = __webpack_require__(61); @@ -31074,8 +31130,8 @@ module.exports = Parse2DArray; * @private * @since 3.0.0 * - * @param {integer} tileIndex - [description] - * @param {boolean} [collides=true] - [description] + * @param {integer} tileIndex - The tile index to set the collision boolean for. + * @param {boolean} [collides=true] - Should the tile index collide or not? * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetLayerCollisionIndex = function (tileIndex, collides, layer) @@ -31121,9 +31177,9 @@ var SetTileCollision = __webpack_require__(62); * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. @@ -31786,14 +31842,14 @@ Matter.Events = __webpack_require__(74); Matter.Sleeping = __webpack_require__(89); Matter.Plugin = __webpack_require__(146); -Matter.Bodies = __webpack_require__(54); +Matter.Bodies = __webpack_require__(55); Matter.Composites = __webpack_require__(244); Matter.Axes = __webpack_require__(151); -Matter.Bounds = __webpack_require__(32); +Matter.Bounds = __webpack_require__(33); Matter.Svg = __webpack_require__(534); -Matter.Vector = __webpack_require__(33); -Matter.Vertices = __webpack_require__(34); +Matter.Vector = __webpack_require__(34); +Matter.Vertices = __webpack_require__(29); // aliases @@ -31823,8 +31879,8 @@ var SAT = {}; module.exports = SAT; -var Vertices = __webpack_require__(34); -var Vector = __webpack_require__(33); +var Vertices = __webpack_require__(29); +var Vector = __webpack_require__(34); (function() { @@ -32101,7 +32157,7 @@ module.exports = Detector; var SAT = __webpack_require__(148); var Pair = __webpack_require__(112); -var Bounds = __webpack_require__(32); +var Bounds = __webpack_require__(33); (function() { @@ -32206,13 +32262,13 @@ var Bounds = __webpack_require__(32); * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Bodies = __webpack_require__(54); +var Bodies = __webpack_require__(55); var Body = __webpack_require__(25); var Class = __webpack_require__(0); var Components = __webpack_require__(113); var GetFastValue = __webpack_require__(1); var HasValue = __webpack_require__(77); -var Vertices = __webpack_require__(34); +var Vertices = __webpack_require__(29); /** * @classdesc @@ -32536,7 +32592,7 @@ var Axes = {}; module.exports = Axes; -var Vector = __webpack_require__(33); +var Vector = __webpack_require__(34); var Common = __webpack_require__(12); (function() { @@ -32737,13 +32793,13 @@ var Vector3 = new Class({ }, /** - * [description] + * Calculate the cross (vector) product of two given Vectors. * * @method Phaser.Math.Vector3#crossVectors * @since 3.0.0 * - * @param {Phaser.Math.Vector3} a - [description] - * @param {Phaser.Math.Vector3} b - [description] + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. * * @return {Phaser.Math.Vector3} This Vector3. */ @@ -33063,7 +33119,7 @@ var Vector3 = new Class({ * * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. * - * @return {number} [description] + * @return {number} The dot product of this Vector and `v`. */ dot: function (v) { @@ -33071,12 +33127,12 @@ var Vector3 = new Class({ }, /** - * [description] + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. * * @method Phaser.Math.Vector3#cross * @since 3.0.0 * - * @param {Phaser.Math.Vector3} v - [description] + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. * * @return {Phaser.Math.Vector3} This Vector3. */ @@ -34361,17 +34417,18 @@ module.exports = RotateAroundXY; // if 'returnFirst' is true it will return after the first point within the triangle is found /** - * [description] + * Filters an array of point-like objects to only those contained within a triangle. + * If `returnFirst` is true, will return an array containing only the first point in the provided array that is within the triangle (or an empty array if there are no such points). * * @function Phaser.Geom.Triangle.ContainsArray * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Point[]} points - [description] - * @param {boolean} [returnFirst] - [description] - * @param {array} [out] - [description] + * @param {Phaser.Geom.Triangle} triangle - The triangle that the points are being checked in. + * @param {Phaser.Geom.Point[]} points - An array of point-like objects (objects that have an `x` and `y` property) + * @param {boolean} [returnFirst=false] - If `true`, return an array containing only the first point found that is within the triangle. + * @param {array} [out] - If provided, the points that are within the triangle will be appended to this array instead of being added to a new array. If `returnFirst` is true, only the first point found within the triangle will be appended. This array will also be returned by this function. * - * @return {Phaser.Geom.Point[]} [description] + * @return {Phaser.Geom.Point[]} An array containing all the points from `points` that are within the triangle, if an array was provided as `out`, points will be appended to that array and it will also be returned here. */ var ContainsArray = function (triangle, points, returnFirst, out) { @@ -35139,16 +35196,16 @@ module.exports = Quad; // Adapted from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html by Jonas Raoni Soares Silva /** - * [description] + * Checks if a point is within the bounds of a Polygon. * * @function Phaser.Geom.Polygon.Contains * @since 3.0.0 * - * @param {Phaser.Geom.Polygon} polygon - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Polygon} polygon - The Polygon to check against. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the point is within the bounds of the Polygon, otherwise `false`. */ var Contains = function (polygon, x, y) { @@ -35231,15 +35288,15 @@ var Polygon = new Class({ }, /** - * [description] + * Check to see if the Polygon contains the given x / y coordinates. * * @method Phaser.Geom.Polygon#contains * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate to check within the polygon. + * @param {number} y - The y coordinate to check within the polygon. * - * @return {boolean} [description] + * @return {boolean} `true` if the coordinates are within the polygon, otherwise `false`. */ contains: function (x, y) { @@ -35251,6 +35308,7 @@ var Polygon = new Class({ * * The points can be set from a variety of formats: * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` @@ -35270,6 +35328,11 @@ var Polygon = new Class({ this.area = 0; this.points = []; + if (typeof points === 'string') + { + points = points.split(' '); + } + if (!Array.isArray(points)) { return this; @@ -35283,10 +35346,10 @@ var Polygon = new Class({ { p = { x: 0, y: 0 }; - if (typeof points[i] === 'number') + if (typeof points[i] === 'number' || typeof points[i] === 'string') { - p.x = points[i]; - p.y = points[i + 1]; + p.x = parseFloat(points[i]); + p.y = parseFloat(points[i + 1]); i++; } else if (Array.isArray(points[i])) @@ -35321,7 +35384,7 @@ var Polygon = new Class({ * @method Phaser.Geom.Polygon#calculateArea * @since 3.0.0 * - * @return {number} [description] + * @return {number} The area of the polygon. */ calculateArea: function () { @@ -38368,7 +38431,16 @@ var ParticleEmitterManager = new Class({ { this.frame = this.texture.get(frame); - this.frameNames = this.texture.getFramesFromTextureSource(this.frame.sourceIndex); + var frames = this.texture.getFramesFromTextureSource(this.frame.sourceIndex); + + var names = []; + + frames.forEach(function (sourceFrame) + { + names.push(sourceFrame.name); + }); + + this.frameNames = names; this.defaultFrame = this.frame; @@ -40212,9 +40284,9 @@ var Graphics = new Class({ // var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip) this.renderCanvas(renderer, this, 0, Graphics.TargetCamera, null, ctx, false); - if (renderer.gl && texture) + if (texture) { - texture.source[0].glTexture = renderer.canvasToTexture(ctx.canvas, texture.source[0].glTexture); + texture.refresh(); } } @@ -40882,10 +40954,6 @@ var Container = new Class({ gameObject.parentContainer = this; } - - // Game Objects automatically listen to the Scene shutdown event, but - // we don't need this if they're in a Container - this._sysEvents.off('shutdown', gameObject.destroy, gameObject); }, /** @@ -40904,8 +40972,6 @@ var Container = new Class({ if (this.exclusive) { gameObject.parentContainer = null; - - this._sysEvents.once('shutdown', gameObject.destroy, gameObject); } }, @@ -42442,16 +42508,19 @@ var Texture = new Class({ * @since 3.0.0 * * @param {integer} sourceIndex - The index of the TextureSource to get the Frames from. + * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array? * * @return {Phaser.Textures.Frame[]} An array of Texture Frames. */ - getFramesFromTextureSource: function (sourceIndex) + getFramesFromTextureSource: function (sourceIndex, includeBase) { + if (includeBase === undefined) { includeBase = false; } + var out = []; for (var frameName in this.frames) { - if (frameName === '__BASE') + if (frameName === '__BASE' && !includeBase) { continue; } @@ -42460,7 +42529,7 @@ var Texture = new Class({ if (frame.sourceIndex === sourceIndex) { - out.push(frame.name); + out.push(frame); } } @@ -43426,7 +43495,7 @@ var GetFastValue = __webpack_require__(1); var ModelViewProjection = __webpack_require__(965); var ShaderSourceFS = __webpack_require__(964); var ShaderSourceVS = __webpack_require__(963); -var TransformMatrix = __webpack_require__(59); +var TransformMatrix = __webpack_require__(42); var Utils = __webpack_require__(9); var WebGLPipeline = __webpack_require__(184); @@ -43676,7 +43745,7 @@ var TextureTintPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#onBind * @since 3.0.0 * - * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + * @return {this} This WebGLPipeline instance. */ onBind: function () { @@ -43697,7 +43766,7 @@ var TextureTintPipeline = new Class({ * @param {number} height - The new height. * @param {number} resolution - The resolution. * - * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + * @return {this} This WebGLPipeline instance. */ resize: function (width, height, resolution) { @@ -43733,7 +43802,7 @@ var TextureTintPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#flush * @since 3.0.0 * - * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + * @return {this} This WebGLPipeline instance. */ flush: function () { @@ -43791,8 +43860,8 @@ var TextureTintPipeline = new Class({ var v1 = frame.v1; var frameX = frame.x; var frameY = frame.y; - var frameWidth = frame.width; - var frameHeight = frame.height; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; var x = -sprite.displayOriginX + frameX; var y = -sprite.displayOriginY + frameY; @@ -44116,6 +44185,7 @@ var TextureTintPipeline = new Class({ * @param {number} vOffset - Vertical offset on texture coordinate. * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera. * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container. + * @param {boolean} [skipFlip=false] - Skip the renderTexture check. */ batchTexture: function ( gameObject, @@ -44132,7 +44202,8 @@ var TextureTintPipeline = new Class({ tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, - parentTransformMatrix) + parentTransformMatrix, + skipFlip) { this.renderer.setPipeline(this, gameObject); @@ -44187,7 +44258,7 @@ var TextureTintPipeline = new Class({ } // Invert the flipY if this is a RenderTexture - flipY = flipY ^ (texture.isRenderTexture ? 1 : 0); + flipY = flipY ^ (!skipFlip && texture.isRenderTexture ? 1 : 0); if (flipX) { @@ -44812,7 +44883,7 @@ var ForwardDiffuseLightPipeline = new Class({ * * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. * - * @return {Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline} [description] + * @return {this} This WebGLPipeline instance. */ onBind: function (gameObject) { @@ -44843,7 +44914,7 @@ var ForwardDiffuseLightPipeline = new Class({ * @param {Phaser.Scene} scene - [description] * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] * - * @return {Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline} [description] + * @return {this} This WebGLPipeline instance. */ onRender: function (scene, camera) { @@ -46431,17 +46502,17 @@ var Rectangle = __webpack_require__(10); // ] /** - * [description] + * Constructs new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds. * * @function Phaser.Geom.Rectangle.FromPoints * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [out,$return] * - * @param {array} points - [description] - * @param {Phaser.Geom.Rectangle} [out] - [description] + * @param {array} points - An array of points (either arrays with two elements corresponding to the X and Y coordinate or an object with public `x` and `y` properties) which should be surrounded by the Rectangle. + * @param {Phaser.Geom.Rectangle} [out] - Optional Rectangle to adjust. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted `out` Rectangle, or a new Rectangle if none was provided. */ var FromPoints = function (points, out) { @@ -46589,18 +46660,18 @@ module.exports = { // Centers this Rectangle so that the center coordinates match the given x and y values. /** - * [description] + * Moves the top-left corner of a Rectangle so that its center is at the given coordinates. * * @function Phaser.Geom.Rectangle.CenterOn * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to be centered. + * @param {number} x - The X coordinate of the Rectangle's center. + * @param {number} y - The Y coordinate of the Rectangle's center. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The centered rectangle. */ var CenterOn = function (rect, x, y) { @@ -47033,11 +47104,14 @@ var Class = __webpack_require__(0); /** * @classdesc * The keys of a Map can be arbitrary values. + * + * ```javascript * var map = new Map([ * [ 1, 'one' ], * [ 2, 'two' ], * [ 3, 'three' ] * ]); + * ``` * * @class Map * @memberOf Phaser.Structs @@ -47048,7 +47122,7 @@ var Class = __webpack_require__(0); * @generic V * @genericUse {V[]} - [elements] * - * @param {Array.<*>} elements - [description] + * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with. */ var Map = new Class({ @@ -47057,7 +47131,7 @@ var Map = new Class({ function Map (elements) { /** - * [description] + * The entries in this Map. * * @genericUse {Object.} - [$type] * @@ -47069,7 +47143,7 @@ var Map = new Class({ this.entries = {}; /** - * [description] + * The number of key / value pairs in this Map. * * @name Phaser.Structs.Map#size * @type {number} @@ -47088,7 +47162,7 @@ var Map = new Class({ }, /** - * [description] + * Adds an element with a specified `key` and `value` to this Map. * * @method Phaser.Structs.Map#set * @since 3.0.0 @@ -47097,8 +47171,8 @@ var Map = new Class({ * @genericUse {V} - [value] * @genericUse {Phaser.Structs.Map.} - [$return] * - * @param {string} key - [description] - * @param {*} value - [description] + * @param {string} key - The key of the element to be added to this Map. + * @param {*} value - The value of the element to be added to this Map. * * @return {Phaser.Structs.Map} This Map object. */ @@ -47114,7 +47188,7 @@ var Map = new Class({ }, /** - * [description] + * Returns the value associated to the `key`, or `undefined` if there is none. * * @method Phaser.Structs.Map#get * @since 3.0.0 @@ -47122,9 +47196,9 @@ var Map = new Class({ * @genericUse {K} - [key] * @genericUse {V} - [$return] * - * @param {string} key - [description] + * @param {string} key - The key of the element to return from the `Map` object. * - * @return {*} [description] + * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object. */ get: function (key) { @@ -47135,14 +47209,14 @@ var Map = new Class({ }, /** - * [description] + * Returns an `Array` of all the values stored in this Map. * * @method Phaser.Structs.Map#getArray * @since 3.0.0 * * @genericUse {V[]} - [$return] * - * @return {Array.<*>} [description] + * @return {Array.<*>} An array of the values stored in this Map. */ getArray: function () { @@ -47158,16 +47232,16 @@ var Map = new Class({ }, /** - * [description] + * Returns a boolean indicating whether an element with the specified key exists or not. * * @method Phaser.Structs.Map#has * @since 3.0.0 * * @genericUse {K} - [key] * - * @param {string} key - [description] + * @param {string} key - The key of the element to test for presence of in this Map. * - * @return {boolean} [description] + * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`. */ has: function (key) { @@ -47175,7 +47249,7 @@ var Map = new Class({ }, /** - * [description] + * Delete the specified element from this Map. * * @method Phaser.Structs.Map#delete * @since 3.0.0 @@ -47183,7 +47257,7 @@ var Map = new Class({ * @genericUse {K} - [key] * @genericUse {Phaser.Structs.Map.} - [$return] * - * @param {string} key - [description] + * @param {string} key - The key of the element to delete from this Map. * * @return {Phaser.Structs.Map} This Map object. */ @@ -47199,7 +47273,7 @@ var Map = new Class({ }, /** - * [description] + * Delete all entries from this Map. * * @method Phaser.Structs.Map#clear * @since 3.0.0 @@ -47222,14 +47296,14 @@ var Map = new Class({ }, /** - * [description] + * Returns all entries keys in this Map. * * @method Phaser.Structs.Map#keys * @since 3.0.0 * * @genericUse {K[]} - [$return] * - * @return {string[]} [description] + * @return {string[]} Array containing entries' keys. */ keys: function () { @@ -47237,14 +47311,14 @@ var Map = new Class({ }, /** - * [description] + * Returns an `Array` of all entries. * * @method Phaser.Structs.Map#values * @since 3.0.0 * * @genericUse {V[]} - [$return] * - * @return {Array.<*>} [description] + * @return {Array.<*>} An `Array` of entries. */ values: function () { @@ -47260,7 +47334,7 @@ var Map = new Class({ }, /** - * [description] + * Dumps the contents of this Map to the console via `console.group`. * * @method Phaser.Structs.Map#dump * @since 3.0.0 @@ -47282,7 +47356,7 @@ var Map = new Class({ }, /** - * [description] + * Passes all entries in this Map to the given callback. * * @method Phaser.Structs.Map#each * @since 3.0.0 @@ -47290,7 +47364,7 @@ var Map = new Class({ * @genericUse {EachMapCallback.} - [callback] * @genericUse {Phaser.Structs.Map.} - [$return] * - * @param {EachMapCallback} callback - [description] + * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map. * * @return {Phaser.Structs.Map} This Map object. */ @@ -47310,16 +47384,16 @@ var Map = new Class({ }, /** - * [description] + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. * * @method Phaser.Structs.Map#contains * @since 3.0.0 * * @genericUse {V} - [value] * - * @param {*} value - [description] + * @param {*} value - The value to search for. * - * @return {boolean} [description] + * @return {boolean} `true` if the value is found, otherwise `false`. */ contains: function (value) { @@ -47337,17 +47411,16 @@ var Map = new Class({ }, /** - * Merges all new keys from the given Map into this one - * If it encounters a key that already exists it will be skipped - * unless override = true. + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. * * @method Phaser.Structs.Map#merge * @since 3.0.0 * * @genericUse {Phaser.Structs.Map.} - [map,$return] * - * @param {Phaser.Structs.Map} map - [description] - * @param {boolean} [override=false] - [description] + * @param {Phaser.Structs.Map} map - The Map to merge in to this Map. + * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. * * @return {Phaser.Structs.Map} This Map object. */ @@ -47608,7 +47681,7 @@ module.exports = Random; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Wrap = __webpack_require__(58); +var Wrap = __webpack_require__(59); /** * Wrap an angle in degrees. @@ -47640,7 +47713,7 @@ module.exports = WrapDegrees; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var MathWrap = __webpack_require__(58); +var MathWrap = __webpack_require__(59); /** * Wrap an angle. @@ -47675,17 +47748,17 @@ module.exports = Wrap; var Point = __webpack_require__(6); /** - * [description] + * Returns a random point within a Rectangle. * * @function Phaser.Geom.Rectangle.Random * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point} out - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to return a point from. + * @param {Phaser.Geom.Point} out - The object to update with the point's coordinates. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} The modified `out` object, or a new Point if none was provided. */ var Random = function (rect, out) { @@ -48374,12 +48447,13 @@ var Timeline = new Class({ }, /** - * [description] + * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. * * @method Phaser.Tweens.Timeline#setTimeScale * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - The time scale value to set. * * @return {Phaser.Tweens.Timeline} This Timeline object. */ @@ -48391,12 +48465,12 @@ var Timeline = new Class({ }, /** - * [description] + * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. * * @method Phaser.Tweens.Timeline#getTimeScale * @since 3.0.0 * - * @return {number} [description] + * @return {number} The value of the time scale applied to this Tween. */ getTimeScale: function () { @@ -48404,12 +48478,12 @@ var Timeline = new Class({ }, /** - * [description] + * Check whether or not the Timeline is playing. * * @method Phaser.Tweens.Timeline#isPlaying * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if this Timeline is active, otherwise `false`. */ isPlaying: function () { @@ -48654,7 +48728,7 @@ var Timeline = new Class({ }, /** - * [description] + * Sets a callback for the Tween Manager. * * @method Phaser.Tweens.Timeline#setCallback * @since 3.0.0 @@ -48974,7 +49048,7 @@ var Timeline = new Class({ }, /** - * [description] + * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags them for removal by the TweenManager. * * @method Phaser.Tweens.Timeline#destroy * @since 3.0.0 @@ -49338,9 +49412,9 @@ var RESERVED = __webpack_require__(464); * @function Phaser.Tweens.Builders.GetProps * @since 3.0.0 * - * @param {object} config - [description] + * @param {object} config - The configuration object of the tween to get the target(s) from. * - * @return {array} [description] + * @return {array} An array of all the targets the tween is operating on. */ var GetProps = function (config) { @@ -49711,16 +49785,18 @@ var CONST = __webpack_require__(28); var GameObject = __webpack_require__(17); var StaticTilemapLayerRender = __webpack_require__(473); var TilemapComponents = __webpack_require__(111); +var TransformMatrix = __webpack_require__(42); var Utils = __webpack_require__(9); /** * @classdesc - * A StaticTilemapLayer is a game object that renders LayerData from a Tilemap. A - * StaticTilemapLayer can only render tiles from a single tileset. + * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. * - * A StaticTilemapLayer is optimized for speed over flexibility. You cannot apply per-tile - * effects like tint or alpha. You cannot change the tiles in a StaticTilemapLayer. Use this - * over a DynamicTilemapLayer when you don't need either of those features. + * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile + * effects like tint or alpha, or change the tiles or tilesets the layer uses. + * + * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. * * @class StaticTilemapLayer * @extends Phaser.GameObjects.GameObject @@ -49741,10 +49817,10 @@ var Utils = __webpack_require__(9); * @extends Phaser.GameObjects.Components.Visible * @extends Phaser.GameObjects.Components.ScrollFactor * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. * @param {integer} layerIndex - The index of the LayerData associated with this layer. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset used to render the tiles in this layer. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. */ @@ -49812,16 +49888,19 @@ var StaticTilemapLayer = new Class({ */ this.layer = tilemap.layers[layerIndex]; - this.layer.tilemapLayer = this; // Link the LayerData with this static tilemap layer + // Link the LayerData with this static tilemap layer + this.layer.tilemapLayer = this; /** - * The Tileset associated with this layer. A tilemap layer can only render from one Tileset. + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. * * @name Phaser.Tilemaps.StaticTilemapLayer#tileset - * @type {Phaser.Tilemaps.Tileset} + * @type {Phaser.Tilemaps.Tileset[]} * @since 3.0.0 */ - this.tileset = tileset; + this.tileset = []; /** * Used internally by the Canvas renderer. @@ -49924,14 +50003,8 @@ var StaticTilemapLayer = new Class({ this.cullCallback = TilemapComponents.CullTiles; /** - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer - * @type {array} - * @private - * @since 3.0.0 - */ - this.vertexBuffer = null; - - /** + * A reference to the renderer. + * * @name Phaser.Tilemaps.StaticTilemapLayer#renderer * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @private @@ -49940,44 +50013,76 @@ var StaticTilemapLayer = new Class({ this.renderer = scene.sys.game.renderer; /** + * An array of vertex buffer objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer + * @type {WebGLBuffer[]} + * @private + * @since 3.0.0 + */ + this.vertexBuffer = []; + + /** + * An array of ArrayBuffer objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * * @name Phaser.Tilemaps.StaticTilemapLayer#bufferData - * @type {ArrayBuffer} + * @type {ArrayBuffer[]} * @private * @since 3.0.0 */ - this.bufferData = null; + this.bufferData = []; /** + * An array of Float32 Array objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewF32 - * @type {Float32Array} + * @type {Float32Array[]} * @private * @since 3.0.0 */ - this.vertexViewF32 = null; + this.vertexViewF32 = []; /** + * An array of Uint32 Array objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewU32 - * @type {Uint32Array} + * @type {Uint32Array[]} * @private * @since 3.0.0 */ - this.vertexViewU32 = null; + this.vertexViewU32 = []; /** + * An array of booleans, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single boolean. + * * @name Phaser.Tilemaps.StaticTilemapLayer#dirty - * @type {boolean} + * @type {boolean[]} * @private * @since 3.0.0 */ - this.dirty = true; + this.dirty = []; /** + * An array of integers, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single integer. + * * @name Phaser.Tilemaps.StaticTilemapLayer#vertexCount - * @type {integer} + * @type {integer[]} * @private * @since 3.0.0 */ - this.vertexCount = 0; + this.vertexCount = []; /** * The rendering (draw) order of the tiles in this layer. @@ -50002,61 +50107,109 @@ var StaticTilemapLayer = new Class({ */ this._renderOrder = 0; + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#_tempMatrix + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.14.0 + */ + this._tempMatrix = new TransformMatrix(); + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#gidMap + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.14.0 + */ + this.gidMap = []; + + this.setTilesets(tileset); this.setAlpha(this.layer.alpha); this.setPosition(x, y); this.setOrigin(); this.setSize(this.layer.tileWidth * this.layer.width, this.layer.tileHeight * this.layer.height); + this.updateVBOData(); + this.initPipeline('TextureTintPipeline'); if (scene.sys.game.config.renderType === CONST.WEBGL) { scene.sys.game.renderer.onContextRestored(function () { - this.dirty = true; - this.vertexBuffer = null; + this.updateVBOData(); }, this); } }, /** - * Sets the rendering (draw) order of the tiles in this layer. - * - * The default is 'right-down', meaning it will order the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * Setting the render order does not change the tiles or how they are stored in the layer, - * it purely impacts the order in which they are rendered. - * - * You can provide either an integer (0 to 3), or the string version of the order. + * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. * - * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder - * @since 3.12.0 + * @method Phaser.Tilemaps.StaticTilemapLayer#setTilesets + * @private + * @since 3.14.0 + * + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + */ + setTilesets: function (tilesets) + { + var gidMap = []; + var setList = []; + var map = this.tilemap; + + if (!Array.isArray(tilesets)) + { + tilesets = [ tilesets ]; + } + + for (var i = 0; i < tilesets.length; i++) + { + var tileset = tilesets[i]; + + if (typeof tileset === 'string') + { + tileset = map.getTileset(tileset); + } + + if (tileset) + { + setList.push(tileset); + + var s = tileset.firstgid; + + for (var t = 0; t < tileset.total; t++) + { + gidMap[s + t] = tileset; + } + } + } + + this.gidMap = gidMap; + this.tileset = setList; + }, + + /** + * Prepares the VBO data arrays for population by the `upload` method. * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * @method Phaser.Tilemaps.StaticTilemapLayer#updateVBOData + * @private + * @since 3.14.0 * * @return {this} This Tilemap Layer object. */ - setRenderOrder: function (renderOrder) + updateVBOData: function () { - var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; - - if (typeof renderOrder === 'string') + for (var i = 0; i < this.tileset.length; i++) { - renderOrder = orders.indexOf(renderOrder); - } - - if (renderOrder >= 0 && renderOrder < 4) - { - this._renderOrder = renderOrder; - this.dirty = true; + this.dirty[i] = true; + this.vertexCount[i] = 0; + this.vertexBuffer[i] = null; + this.bufferData[i] = null; + this.vertexViewF32[i] = null; + this.vertexViewU32[i] = null; } return this; @@ -50069,19 +50222,20 @@ var StaticTilemapLayer = new Class({ * @since 3.0.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to render to. + * @param {integer} tilesetIndex - The tileset index. * * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. */ - upload: function (camera) + upload: function (camera, tilesetIndex) { var renderer = this.renderer; var gl = renderer.gl; var pipeline = renderer.pipelines.TextureTintPipeline; - if (this.dirty) + if (this.dirty[tilesetIndex]) { - var tileset = this.tileset; + var tileset = this.tileset[tilesetIndex]; var mapWidth = this.layer.width; var mapHeight = this.layer.height; var width = tileset.image.source[0].width; @@ -50091,22 +50245,24 @@ var StaticTilemapLayer = new Class({ var row; var col; var renderOrder = this._renderOrder; + var minTileIndex = tileset.firstgid; + var maxTileIndex = tileset.firstgid + tileset.total; - var vertexBuffer = this.vertexBuffer; - var bufferData = this.bufferData; + var vertexBuffer = this.vertexBuffer[tilesetIndex]; + var bufferData = this.bufferData[tilesetIndex]; var vOffset = -1; var bufferSize = (mapWidth * mapHeight) * pipeline.vertexSize * 6; - this.vertexCount = 0; + this.vertexCount[tilesetIndex] = 0; if (bufferData === null) { bufferData = new ArrayBuffer(bufferSize); - this.bufferData = bufferData; + this.bufferData[tilesetIndex] = bufferData; - this.vertexViewF32 = new Float32Array(bufferData); - this.vertexViewU32 = new Uint32Array(bufferData); + this.vertexViewF32[tilesetIndex] = new Float32Array(bufferData); + this.vertexViewU32[tilesetIndex] = new Uint32Array(bufferData); } if (renderOrder === 0) @@ -50119,12 +50275,12 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } @@ -50138,12 +50294,12 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } @@ -50157,12 +50313,12 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } @@ -50176,23 +50332,23 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } - this.dirty = false; + this.dirty[tilesetIndex] = false; if (vertexBuffer === null) { vertexBuffer = renderer.createVertexBuffer(bufferData, gl.STATIC_DRAW); - this.vertexBuffer = vertexBuffer; + this.vertexBuffer[tilesetIndex] = vertexBuffer; } else { @@ -50202,11 +50358,6 @@ var StaticTilemapLayer = new Class({ } } - pipeline.modelIdentity(); - pipeline.modelTranslate(this.x - (camera.scrollX * this.scrollFactorX), this.y - (camera.scrollY * this.scrollFactorY), 0); - pipeline.modelScale(this.scaleX, this.scaleY, 1); - pipeline.viewLoad2D(camera.matrix.matrix); - return this; }, @@ -50223,21 +50374,17 @@ var StaticTilemapLayer = new Class({ * @param {integer} width - The width of the layer. * @param {integer} height - The height of the layer. * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the layer is being rendered with. + * @param {integer} tilesetIndex - The tileset index. * * @return {integer} The new vOffset value. */ - batchTile: function (vOffset, tile, tileset, width, height, camera) + batchTile: function (vOffset, tile, tileset, width, height, camera, tilesetIndex) { - var tx = tile.pixelX; - var ty = tile.pixelY; - var txw = tx + tile.width; - var tyh = ty + tile.height; - var texCoords = tileset.getTileTextureCoordinates(tile.index); if (!texCoords) { - return; + return vOffset; } var u0 = texCoords.x / width; @@ -50245,16 +50392,47 @@ var StaticTilemapLayer = new Class({ var u1 = (texCoords.x + tile.width) / width; var v1 = (texCoords.y + tile.height) / height; + var matrix = this._tempMatrix; + + var tileWidth = tile.width; + var tileHeight = tile.height; + + var halfTileWidth = tileWidth / 2; + var halfTileHeight = tileHeight / 2; + + var x = -halfTileWidth; + var y = -halfTileHeight; + + if (tile.flipX) + { + tileWidth *= -1; + x += tile.width; + } + + if (tile.flipY) + { + tileHeight *= -1; + y += tile.height; + } + + var xw = x + tileWidth; + var yh = y + tileHeight; + + matrix.applyITRS(halfTileWidth + tile.pixelX, halfTileHeight + tile.pixelY, tile.rotation, 1, 1); + var tint = Utils.getTintAppendFloatAlpha(0xffffff, camera.alpha * this.alpha * tile.alpha); - var tx0 = tx; - var ty0 = ty; - var tx1 = tx; - var ty1 = tyh; - var tx2 = txw; - var ty2 = tyh; - var tx3 = txw; - var ty3 = ty; + var tx0 = matrix.getX(x, y); + var ty0 = matrix.getY(x, y); + + var tx1 = matrix.getX(x, yh); + var ty1 = matrix.getY(x, yh); + + var tx2 = matrix.getX(xw, yh); + var ty2 = matrix.getY(xw, yh); + + var tx3 = matrix.getX(xw, y); + var ty3 = matrix.getY(xw, y); if (camera.roundPixels) { @@ -50271,8 +50449,8 @@ var StaticTilemapLayer = new Class({ ty3 |= 0; } - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; + var vertexViewF32 = this.vertexViewF32[tilesetIndex]; + var vertexViewU32 = this.vertexViewU32[tilesetIndex]; vertexViewF32[++vOffset] = tx0; vertexViewF32[++vOffset] = ty0; @@ -50316,11 +50494,58 @@ var StaticTilemapLayer = new Class({ vertexViewF32[++vOffset] = 0; vertexViewU32[++vOffset] = tint; - this.vertexCount += 6; + this.vertexCount[tilesetIndex] += 6; return vOffset; }, + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder + * @since 3.12.0 + * + * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * + * @return {this} This Tilemap Layer object. + */ + setRenderOrder: function (renderOrder) + { + var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; + + if (typeof renderOrder === 'string') + { + renderOrder = orders.indexOf(renderOrder); + } + + if (renderOrder >= 0 && renderOrder < 4) + { + this._renderOrder = renderOrder; + + for (var i = 0; i < this.tileset.length; i++) + { + this.dirty[i] = true; + } + } + + return this; + }, + /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting * faces are used internally for optimizing collisions against tiles. This method is mostly used @@ -51044,10 +51269,22 @@ var StaticTilemapLayer = new Class({ this.tilemap = undefined; this.layer = undefined; - this.tileset = undefined; this.culledTiles.length = 0; this.cullCallback = null; + for (var i = 0; i < this.tileset.length; i++) + { + this.dirty[i] = true; + this.vertexCount[i] = 0; + this.vertexBuffer[i] = null; + this.bufferData[i] = null; + this.vertexViewF32[i] = null; + this.vertexViewU32[i] = null; + } + + this.gidMap = []; + this.tileset = []; + GameObject.prototype.destroy.call(this); } @@ -51074,13 +51311,14 @@ var TilemapComponents = __webpack_require__(111); /** * @classdesc - * A DynamicTilemapLayer is a game object that renders LayerData from a Tilemap. A - * DynamicTilemapLayer can only render tiles from a single tileset. + * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. * - * A DynamicTilemapLayer trades some speed for being able to apply powerful effects. Unlike a - * StaticTilemapLayer, you can apply per-tile effects like tint or alpha, and you can change the - * tiles in a DynamicTilemapLayer. Use this over a StaticTilemapLayer when you need those - * features. + * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a + * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the + * tiles in a DynamicTilemapLayer. + * + * Use this over a Static Tilemap Layer when you need those features. * * @class DynamicTilemapLayer * @extends Phaser.GameObjects.GameObject @@ -51101,10 +51339,10 @@ var TilemapComponents = __webpack_require__(111); * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. * @param {integer} layerIndex - The index of the LayerData associated with this layer. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset used to render the tiles in this layer. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. */ @@ -51172,16 +51410,19 @@ var DynamicTilemapLayer = new Class({ */ this.layer = tilemap.layers[layerIndex]; - this.layer.tilemapLayer = this; // Link the LayerData with this static tilemap layer + // Link the LayerData with this static tilemap layer + this.layer.tilemapLayer = this; /** - * The Tileset associated with this layer. A tilemap layer can only render from one Tileset. + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. * * @name Phaser.Tilemaps.DynamicTilemapLayer#tileset - * @type {Phaser.Tilemaps.Tileset} + * @type {Phaser.Tilemaps.Tileset[]} * @since 3.0.0 */ - this.tileset = tileset; + this.tileset = []; /** * Used internally with the canvas render. This holds the tiles that are visible within the @@ -51292,6 +51533,16 @@ var DynamicTilemapLayer = new Class({ */ this._renderOrder = 0; + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#gidMap + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.14.0 + */ + this.gidMap = []; + + this.setTilesets(tileset); this.setAlpha(this.layer.alpha); this.setPosition(x, y); this.setOrigin(); @@ -51300,6 +51551,52 @@ var DynamicTilemapLayer = new Class({ this.initPipeline('TextureTintPipeline'); }, + /** + * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setTilesets + * @private + * @since 3.14.0 + * + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + */ + setTilesets: function (tilesets) + { + var gidMap = []; + var setList = []; + var map = this.tilemap; + + if (!Array.isArray(tilesets)) + { + tilesets = [ tilesets ]; + } + + for (var i = 0; i < tilesets.length; i++) + { + var tileset = tilesets[i]; + + if (typeof tileset === 'string') + { + tileset = map.getTileset(tileset); + } + + if (tileset) + { + setList.push(tileset); + + var s = tileset.firstgid; + + for (var t = 0; t < tileset.total; t++) + { + gidMap[s + t] = tileset; + } + } + } + + this.gidMap = gidMap; + this.tileset = setList; + }, + /** * Sets the rendering (draw) order of the tiles in this layer. * @@ -51370,10 +51667,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -51433,13 +51730,13 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#copy * @since 3.0.0 * - * @param {integer} srcTileX - [description] - * @param {integer} srcTileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] - * @param {integer} destTileX - [description] - * @param {integer} destTileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -51466,10 +51763,12 @@ var DynamicTilemapLayer = new Class({ this.tilemap = undefined; this.layer = undefined; - this.tileset = undefined; this.culledTiles.length = 0; this.cullCallback = null; + this.gidMap = []; + this.tileset = []; + GameObject.prototype.destroy.call(this); }, @@ -51481,12 +51780,12 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#fill * @since 3.0.0 * - * @param {integer} index - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} index - The tile index to fill the area with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -51509,17 +51808,14 @@ var DynamicTilemapLayer = new Class({ * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -51558,20 +51854,16 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#findTile * @since 3.0.0 * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {?Phaser.Tilemaps.Tile} */ @@ -51587,20 +51879,16 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#forEachTile * @since 3.0.0 * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -51619,8 +51907,7 @@ var DynamicTilemapLayer = new Class({ * * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ @@ -51637,9 +51924,8 @@ var DynamicTilemapLayer = new Class({ * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates * were invalid. @@ -51655,17 +51941,14 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -51683,13 +51966,10 @@ var DynamicTilemapLayer = new Class({ * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -51704,18 +51984,15 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -51731,10 +52008,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. * - * @return {boolean} + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ hasTileAt: function (tileX, tileY) { @@ -51748,11 +52025,11 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * - * @return {boolean} + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ hasTileAtWorldXY: function (worldX, worldY, camera) { @@ -51769,9 +52046,9 @@ var DynamicTilemapLayer = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -51790,10 +52067,10 @@ var DynamicTilemapLayer = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} worldX - [description] - * @param {integer} worldY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -51812,11 +52089,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#putTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles - * or tile indexes to place. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -51837,10 +52113,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. @@ -51859,11 +52135,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -51879,12 +52154,11 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -51928,12 +52202,12 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#replaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - [description] - * @param {integer} newIndex - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -52145,10 +52419,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileLocationCallback * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} [callbackContext] - The context under which the callback is called. * @@ -52170,10 +52444,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -52194,10 +52468,10 @@ var DynamicTilemapLayer = new Class({ * * @param {integer} tileA - First tile index. * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -52215,8 +52489,8 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldX * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -52232,8 +52506,8 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldY * @since 3.0.0 * - * @param {integer} tileY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -52250,10 +52524,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Math.Vector2} */ @@ -52280,10 +52554,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#weightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. @@ -52304,10 +52578,9 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileX * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -52323,10 +52596,9 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileY * @since 3.0.0 * - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -52343,12 +52615,11 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Math.Vector2} */ @@ -52376,7 +52647,7 @@ var Class = __webpack_require__(0); var DegToRad = __webpack_require__(36); var DynamicTilemapLayer = __webpack_require__(222); var Extend = __webpack_require__(21); -var Formats = __webpack_require__(29); +var Formats = __webpack_require__(30); var LayerData = __webpack_require__(87); var Rotate = __webpack_require__(271); var StaticTilemapLayer = __webpack_require__(221); @@ -52387,21 +52658,21 @@ var Tileset = __webpack_require__(107); /** * @callback TilemapFilterCallback * - * @param {Phaser.GameObjects.GameObject} value - [description] - * @param {number} index - [description] - * @param {Phaser.GameObjects.GameObject[]} array - [description] + * @param {Phaser.GameObjects.GameObject} value - An object found in the filtered area. + * @param {number} index - The index of the object within the array. + * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. * - * @return {Phaser.GameObjects.GameObject} [description] + * @return {Phaser.GameObjects.GameObject} The object. */ /** * @callback TilemapFindCallback * - * @param {Phaser.GameObjects.GameObject} value - [description] - * @param {number} index - [description] - * @param {Phaser.GameObjects.GameObject[]} array - [description] + * @param {Phaser.GameObjects.GameObject} value - An object found. + * @param {number} index - The index of the object within the array. + * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. * - * @return {boolean} [description] + * @return {boolean} `true` if the callback should be invoked, otherwise `false`. */ /** @@ -52687,7 +52958,7 @@ var Tilemap = new Class({ if (!this.scene.sys.textures.exists(key)) { - console.warn('Invalid image key given for tileset: "' + key + '"'); + console.warn('Invalid Tileset Image: ' + key); return null; } @@ -52697,16 +52968,19 @@ var Tilemap = new Class({ if (index === null && this.format === Formats.TILED_JSON) { - console.warn('No data found in the JSON tilemap from Tiled matching the tileset name: "' + tilesetName + '"'); + console.warn('No data found for Tileset: ' + tilesetName); return null; } - if (this.tilesets[index]) + var tileset = this.tilesets[index]; + + if (tileset) { - this.tilesets[index].setTileSize(tileWidth, tileHeight); - this.tilesets[index].setSpacing(tileMargin, tileSpacing); - this.tilesets[index].setImage(texture); - return this.tilesets[index]; + tileset.setTileSize(tileWidth, tileHeight); + tileset.setSpacing(tileMargin, tileSpacing); + tileset.setImage(texture); + + return tileset; } if (tileWidth === undefined) { tileWidth = this.tileWidth; } @@ -52715,8 +52989,10 @@ var Tilemap = new Class({ if (tileSpacing === undefined) { tileSpacing = 0; } if (gid === undefined) { gid = 0; } - var tileset = new Tileset(tilesetName, gid, tileWidth, tileHeight, tileMargin, tileSpacing); + tileset = new Tileset(tilesetName, gid, tileWidth, tileHeight, tileMargin, tileSpacing); + tileset.setImage(texture); + this.tilesets.push(tileset); return tileset; @@ -52768,11 +53044,23 @@ var Tilemap = new Class({ }, /** - * See component documentation. If no layer specified, the map's current layer is used. This - * cannot be applied to StaticTilemapLayers. + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * + * If no layer specified, the map's current layer is used. This cannot be applied to StaticTilemapLayers. * * @method Phaser.Tilemaps.Tilemap#copy * @since 3.0.0 + * + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -52796,24 +53084,20 @@ var Tilemap = new Class({ }, /** - * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set - * to this new layer. + * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. * * @method Phaser.Tilemaps.Tilemap#createBlankDynamicLayer * @since 3.0.0 * * @param {string} name - The name of this layer. Must be unique within the map. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. - * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default - * to the map's width. - * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default - * to the map's height. - * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not - * specified, it will default to the map's tileWidth. - * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not - * specified, it will default to the map's tileHeight. + * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. + * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. + * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. + * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. + * * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. */ createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) @@ -52829,7 +53113,7 @@ var Tilemap = new Class({ if (index !== null) { - console.warn('Cannot create blank layer: layer with matching name already exists ' + name); + console.warn('Invalid Tilemap Layer ID: ' + name); return null; } @@ -52856,6 +53140,7 @@ var Tilemap = new Class({ } this.layers.push(layerData); + this.currentLayerIndex = this.layers.length - 1; var dynamicLayer = new DynamicTilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); @@ -52881,13 +53166,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createDynamicLayer * @since 3.0.0 * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the - * layer name from Tiled. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. - * @param {number} x - The x position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. - * @param {number} y - The y position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} x - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * @param {number} y - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. */ @@ -52897,7 +53179,7 @@ var Tilemap = new Class({ if (index === null) { - console.warn('Cannot create Tilemap Layer, invalid ID: ' + layerID); + console.warn('Invalid Tilemap Layer ID: ' + layerID); return null; } @@ -52906,21 +53188,13 @@ var Tilemap = new Class({ // Check for an associated static or dynamic tilemap layer if (layerData.tilemapLayer) { - console.warn('Cannot create Tilemap Layer. ID: ' + layerID + ' already in use'); + console.warn('Tilemap Layer ID already exists:' + layerID); return null; } this.currentLayerIndex = index; - // Make sure that all the LayerData & the tiles have the correct tile size. They usually - // are, but wouldn't match if you try to load a 2x or 4x res tileset when the map was made - // with a 1x res tileset. - if (layerData.tileWidth !== tileset.tileWidth || layerData.tileHeight !== tileset.tileHeight) - { - this.setLayerTileSize(tileset.tileWidth, tileset.tileHeight, index); - } - - // Default the x/y position to match Tiled layer offset, if it exists. + // Default the x/y position to match Tiled layer offset, if it exists. if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } @@ -53050,11 +53324,10 @@ var Tilemap = new Class({ * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. - * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). + * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.GameObjects.Sprite[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -53081,13 +53354,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createStaticLayer * @since 3.0.0 * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the - * layer name from Tiled. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. - * @param {number} x - The x position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. - * @param {number} y - The y position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} x - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * @param {number} y - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer was created, or null if it failed. */ @@ -53097,30 +53367,22 @@ var Tilemap = new Class({ if (index === null) { - console.warn('Cannot create tilemap layer, invalid layer ID given: ' + layerID); + console.warn('Invalid Tilemap Layer ID: ' + layerID); return null; } var layerData = this.layers[index]; - // Check for an associated static or dynamic tilemap layer + // Check for an associated static or dynamic tilemap layer if (layerData.tilemapLayer) { - console.warn('Cannot create static tilemap layer since a static or dynamic tilemap layer exists for layer ID:' + layerID); + console.warn('Tilemap Layer ID already exists:' + layerID); return null; } this.currentLayerIndex = index; - // Make sure that all the LayerData & the tiles have the correct tile size. They usually - // are, but wouldn't match if you try to load a 2x or 4x res tileset when the map was made - // with a 1x res tileset. - if (layerData.tileWidth !== tileset.tileWidth || layerData.tileHeight !== tileset.tileHeight) - { - this.setLayerTileSize(tileset.tileWidth, tileset.tileHeight, index); - } - - // Default the x/y position to match Tiled layer offset, if it exists. + // Default the x/y position to match Tiled layer offset, if it exists. if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } @@ -53159,13 +53421,13 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#fill * @since 3.0.0 * - * @param {integer} index - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} index - The tile index to fill the area with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -53228,18 +53490,15 @@ var Tilemap = new Class({ * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to apply the filter on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -53265,9 +53524,8 @@ var Tilemap = new Class({ * * @param {integer} index - The tile index value to search for. * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -53321,21 +53579,17 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#findTile * @since 3.0.0 * - * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -53357,21 +53611,17 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#forEachTile * @since 3.0.0 * - * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -53527,9 +53777,8 @@ var Tilemap = new Class({ * * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -53551,10 +53800,9 @@ var Tilemap = new Class({ * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -53579,18 +53827,15 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getTilesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -53613,14 +53858,11 @@ var Tilemap = new Class({ * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -53640,19 +53882,16 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getTilesWithinWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -53665,6 +53904,23 @@ var Tilemap = new Class({ return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, layer); }, + /** + * Gets the Tileset that has the given `name`, or null if an invalid `name` is given. + * + * @method Phaser.Tilemaps.Tilemap#getTileset + * @since 3.14.0 + * + * @param {string} name - The name of the Tileset to get. + * + * @return {?Phaser.Tilemaps.Tileset} The Tileset, or `null` if no matching named tileset was found. + */ + getTileset: function (name) + { + var index = this.getIndex(this.tilesets, name); + + return (index !== null) ? this.tilesets[index] : null; + }, + /** * Gets the index of the Tileset within this.tilesets that has the given `name`, or null if an * invalid `name` is given. @@ -53690,9 +53946,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#hasTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -53714,10 +53970,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#hasTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -53764,12 +54020,12 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * - * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. + * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid or the coordinates were out of bounds. */ putTileAt: function (tile, tileX, tileY, recalculateFaces, layer) { @@ -53795,11 +54051,11 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} worldX - [description] - * @param {integer} worldY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -53827,12 +54083,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#putTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles - * or tile indexes to place. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -53863,12 +54118,12 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -53896,9 +54151,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#calculateFacesAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -53923,11 +54178,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#calculateFacesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -53978,12 +54233,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#removeTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -54008,13 +54262,12 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -54042,13 +54295,10 @@ var Tilemap = new Class({ * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. * @param {object} styleConfig - An object specifying the colors to use for the debug drawing. - * @param {?Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at - * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. - * @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled - * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. - * @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting - * tile faces. If set to null, interesting tile faces will not be drawn. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {?Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. + * @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. + * @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54074,13 +54324,13 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#replaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - [description] - * @param {integer} newIndex - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54109,11 +54359,9 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54141,11 +54389,9 @@ var Tilemap = new Class({ * * @param {integer} start - The first index of the tile to be set for collision. * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54174,13 +54420,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setCollisionByProperty * @since 3.0.0 * - * @param {object} properties - An object with tile properties and corresponding values that should - * be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54206,11 +54449,9 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54236,11 +54477,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setCollisionFromCollisionGroup * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54266,11 +54505,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setTileIndexCallback * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a - * collision callback set for. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54295,13 +54533,13 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setTileLocationCallback * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} [callbackContext] - The context under which the callback is called. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54362,8 +54600,8 @@ var Tilemap = new Class({ // Update the base tile size on all layers & tiles for (var i = 0; i < this.layers.length; i++) { - this.layers[i].baseWidth = tileWidth; - this.layers[i].baseHeight = tileHeight; + this.layers[i].baseTileWidth = tileWidth; + this.layers[i].baseTileHeight = tileHeight; var mapData = this.layers[i].data; var mapWidth = this.layers[i].width; @@ -54440,11 +54678,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54475,11 +54713,11 @@ var Tilemap = new Class({ * * @param {integer} tileA - First tile index. * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54506,9 +54744,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#tileToWorldX * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -54530,9 +54768,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#tileToWorldY * @since 3.0.0 * - * @param {integer} tileY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -54555,11 +54793,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#tileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. */ @@ -54593,14 +54831,14 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#weightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -54627,11 +54865,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#worldToTileX * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -54653,11 +54890,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#worldToTileY * @since 3.0.0 * - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -54680,13 +54916,12 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#worldToTileXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. */ @@ -54736,7 +54971,7 @@ module.exports = Tilemap; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Formats = __webpack_require__(29); +var Formats = __webpack_require__(30); var MapData = __webpack_require__(86); var ParseTileLayers = __webpack_require__(478); var ParseTilesets = __webpack_require__(477); @@ -55257,7 +55492,7 @@ module.exports = ParseGID; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Formats = __webpack_require__(29); +var Formats = __webpack_require__(30); var MapData = __webpack_require__(86); var ParseTileLayers = __webpack_require__(486); var ParseImageLayers = __webpack_require__(484); @@ -55285,7 +55520,7 @@ var AssignTileProperties = __webpack_require__(479); * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. * - * @return {?Phaser.Tilemaps.MapData} [description] + * @return {?Phaser.Tilemaps.MapData} The created MapData object, or `null` if the data can't be parsed. */ var ParseJSONTiled = function (name, json, insertNull) { @@ -55338,7 +55573,7 @@ module.exports = ParseJSONTiled; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Formats = __webpack_require__(29); +var Formats = __webpack_require__(30); var Parse2DArray = __webpack_require__(141); /** @@ -55358,7 +55593,7 @@ var Parse2DArray = __webpack_require__(141); * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. * - * @return {Phaser.Tilemaps.MapData} [description] + * @return {Phaser.Tilemaps.MapData} The resulting MapData object. */ var ParseCSV = function (name, data, tileWidth, tileHeight, insertNull) { @@ -55386,7 +55621,7 @@ module.exports = ParseCSV; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Formats = __webpack_require__(29); +var Formats = __webpack_require__(30); var Parse2DArray = __webpack_require__(141); var ParseCSV = __webpack_require__(230); var ParseJSONTiled = __webpack_require__(229); @@ -55415,7 +55650,7 @@ var ParseWeltmeister = __webpack_require__(224); * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. * - * @return {Phaser.Tilemaps.MapData} [description] + * @return {Phaser.Tilemaps.MapData} The created `MapData` object. */ var Parse = function (name, mapFormat, data, tileWidth, tileHeight, insertNull) { @@ -55470,9 +55705,8 @@ var CalculateFacesAt = __webpack_require__(144); * * @param {integer} tileX - The x coordinate. * @param {integer} tileY - The y coordinate. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. @@ -55527,11 +55761,11 @@ var IsInLayerBounds = __webpack_require__(88); * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] + * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {boolean} + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ var HasTileAt = function (tileX, tileY, layer) { @@ -55571,17 +55805,18 @@ var GetTilesWithin = __webpack_require__(19); * @private * @since 3.0.0 * - * @param {integer} findIndex - [description] - * @param {integer} newIndex - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ReplaceByIndex = function (findIndex, newIndex, tileX, tileY, width, height, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + for (var i = 0; i < tiles.length; i++) { if (tiles[i] && tiles[i].index === findIndex) @@ -55785,7 +56020,7 @@ module.exports = BasePlugin; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Bodies = __webpack_require__(54); +var Bodies = __webpack_require__(55); var Class = __webpack_require__(0); var Common = __webpack_require__(12); var Composite = __webpack_require__(63); @@ -55797,7 +56032,7 @@ var MatterBody = __webpack_require__(25); var MatterEvents = __webpack_require__(74); var MatterTileBody = __webpack_require__(150); var MatterWorld = __webpack_require__(145); -var Vector = __webpack_require__(33); +var Vector = __webpack_require__(34); /** * @classdesc @@ -55809,7 +56044,7 @@ var Vector = __webpack_require__(33); * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene to which this Matter World instance belongs. * @param {object} config - [description] */ var World = new Class({ @@ -55823,7 +56058,7 @@ var World = new Class({ EventEmitter.call(this); /** - * [description] + * The Scene to which this Matter World instance belongs. * * @name Phaser.Physics.Matter.World#scene * @type {Phaser.Scene} @@ -55832,7 +56067,7 @@ var World = new Class({ this.scene = scene; /** - * [description] + * An instance of the MatterJS Engine. * * @name Phaser.Physics.Matter.World#engine * @type {MatterJS.Engine} @@ -55890,7 +56125,7 @@ var World = new Class({ } /** - * [description] + * A flag that toggles if the world is enabled or not. * * @name Phaser.Physics.Matter.World#enabled * @type {boolean} @@ -55956,7 +56191,7 @@ var World = new Class({ this.autoUpdate = GetValue(config, 'autoUpdate', true); /** - * [description] + * A flag that controls if the debug graphics will be drawn to or not. * * @name Phaser.Physics.Matter.World#drawDebug * @type {boolean} @@ -55966,7 +56201,7 @@ var World = new Class({ this.drawDebug = GetValue(config, 'debug', false); /** - * [description] + * An instance of the Graphics object the debug bodies are drawn to, if enabled. * * @name Phaser.Physics.Matter.World#debugGraphic * @type {Phaser.GameObjects.Graphics} @@ -55975,21 +56210,27 @@ var World = new Class({ this.debugGraphic; /** - * [description] + * The default configuration values. * * @name Phaser.Physics.Matter.World#defaults * @type {object} * @since 3.0.0 */ this.defaults = { - debugShowBody: GetValue(config, 'debugShowBody', true), - debugShowStaticBody: GetValue(config, 'debugShowStaticBody', true), - debugShowVelocity: GetValue(config, 'debugShowVelocity', true), - bodyDebugColor: GetValue(config, 'debugBodyColor', 0xff00ff), - staticBodyDebugColor: GetValue(config, 'debugBodyColor', 0x0000ff), - velocityDebugColor: GetValue(config, 'debugVelocityColor', 0x00ff00), - debugShowJoint: GetValue(config, 'debugShowJoint', true), - jointDebugColor: GetValue(config, 'debugJointColor', 0x000000) + debugShowBody: GetFastValue(config, 'debugShowBody', true), + debugShowStaticBody: GetFastValue(config, 'debugShowStaticBody', true), + debugShowVelocity: GetFastValue(config, 'debugShowVelocity', true), + bodyDebugColor: GetFastValue(config, 'debugBodyColor', 0xff00ff), + bodyDebugFillColor: GetFastValue(config, 'bodyDebugFillColor', 0xe3a7e3), + staticBodyDebugColor: GetFastValue(config, 'debugBodyColor', 0x0000ff), + velocityDebugColor: GetFastValue(config, 'debugVelocityColor', 0x00ff00), + debugShowJoint: GetFastValue(config, 'debugShowJoint', true), + jointDebugColor: GetFastValue(config, 'debugJointColor', 0x000000), + debugWireframes: GetFastValue(config, 'debugWireframes', true), + debugShowInternalEdges: GetFastValue(config, 'debugShowInternalEdges', false), + debugShowConvexHulls: GetFastValue(config, 'debugShowConvexHulls', false), + debugConvexHullColor: GetFastValue(config, 'debugConvexHullColor', 0xaaaaaa), + debugShowSleeping: GetFastValue(config, 'debugShowSleeping', false) }; if (this.drawDebug) @@ -56219,18 +56460,18 @@ var World = new Class({ }, /** - * [description] + * Creates a rectangle Matter body and adds it to the world. * * @method Phaser.Physics.Matter.World#create * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] - * @param {object} options - [description] + * @param {number} x - The horizontal position of the body in the world. + * @param {number} y - The vertical position of the body in the world. + * @param {number} width - The width of the body. + * @param {number} height - The height of the body. + * @param {object} options - Optional Matter configuration object. * - * @return {MatterJS.Body} [description] + * @return {MatterJS.Body} The Matter.js body that was created. */ create: function (x, y, width, height, options) { @@ -56484,9 +56725,10 @@ var World = new Class({ }, /** - * [description] + * Handles the rendering of bodies and debug information to the debug Graphics object, if enabled. * * @method Phaser.Physics.Matter.World#postUpdate + * @private * @since 3.0.0 */ postUpdate: function () @@ -56496,135 +56738,325 @@ var World = new Class({ return; } - var graphics = this.debugGraphic; + this.debugGraphic.clear(); + var bodies = Composite.allBodies(this.localWorld); - graphics.clear(); - graphics.lineStyle(1, this.defaults.bodyDebugColor); + if (this.defaults.debugWireframes) + { + if (this.defaults.debugShowConvexHulls) + { + this.renderConvexHulls(bodies); + } + + this.renderWireframes(bodies); + } + else + { + this.renderBodies(bodies); + } + + if (this.defaults.debugShowJoint) + { + this.renderJoints(); + } + }, + + /** + * Renders the debug convex hulls from the given array of bodies. + * + * @method Phaser.Physics.Matter.World#renderConvexHulls + * @private + * @since 3.14.0 + * + * @param {array} bodies - An array of bodies from the localWorld. + */ + renderConvexHulls: function (bodies) + { + var graphics = this.debugGraphic; + + graphics.lineStyle(1, this.defaults.debugConvexHullColor); + graphics.beginPath(); - var i,j; - - for (i = 0; i < bodies.length; i++) + for (var i = 0; i < bodies.length; i++) { - if (!bodies[i].render.visible) + var body = bodies[i]; + + if (!body.render.visible || body.parts.length === 1) { continue; } - // Handle drawing both single bodies and compound bodies. If compound, draw both the - // convex hull (first part) and the rest of the bodies. - for (j = 0; j < bodies[i].parts.length; j++) + graphics.moveTo(body.vertices[0].x, body.vertices[0].y); + + for (var j = 1; j < body.vertices.length; j++) { - var body = bodies[i].parts[j]; + graphics.lineTo(body.vertices[j].x, body.vertices[j].y); + } + + graphics.lineTo(body.vertices[0].x, body.vertices[0].y); + } - var vertices = body.vertices; + graphics.strokePath(); + }, - graphics.moveTo(vertices[0].x, vertices[0].y); + /** + * Renders the wireframes of the given array of bodies. + * + * @method Phaser.Physics.Matter.World#renderWireframes + * @private + * @since 3.14.0 + * + * @param {array} bodies - An array of bodies from the localWorld. + */ + renderWireframes: function (bodies) + { + var graphics = this.debugGraphic; + var showInternalEdges = this.defaults.debugShowInternalEdges; - for (var k = 1; k < vertices.length; k++) + graphics.lineStyle(1, this.defaults.bodyDebugColor); + + graphics.beginPath(); + + for (var i = 0; i < bodies.length; i++) + { + var body = bodies[i]; + + if (!body.render.visible) + { + continue; + } + + for (var k = (body.parts.length > 1) ? 1 : 0; k < body.parts.length; k++) + { + var part = body.parts[k]; + + var vertLength = part.vertices.length; + + graphics.moveTo(part.vertices[0].x, part.vertices[0].y); + + for (var j = 1; j < vertLength; j++) { - graphics.lineTo(vertices[k].x, vertices[k].y); + if (!part.vertices[j - 1].isInternal || showInternalEdges) + { + graphics.lineTo(part.vertices[j].x, part.vertices[j].y); + } + else + { + graphics.moveTo(part.vertices[j].x, part.vertices[j].y); + } + + if (part.vertices[j].isInternal && !showInternalEdges) + { + graphics.moveTo(part.vertices[(j + 1) % vertLength].x, part.vertices[(j + 1) % vertLength].y); + } } - - graphics.lineTo(vertices[0].x, vertices[0].y); - - graphics.strokePath(); + + graphics.lineTo(part.vertices[0].x, part.vertices[0].y); } } - graphics.closePath(); + graphics.strokePath(); + }, - if (this.defaults.debugShowJoint) + /** + * Renders the array of bodies. + * + * @method Phaser.Physics.Matter.World#renderBodies + * @private + * @since 3.14.0 + * + * @param {array} bodies - An array of bodies from the localWorld. + */ + renderBodies: function (bodies) + { + var graphics = this.debugGraphic; + + var showInternalEdges = this.defaults.debugShowInternalEdges || !this.defaults.debugWireframes; + var showSleeping = this.defaults.debugShowSleeping; + var wireframes = this.defaults.debugWireframes; + + var body; + var part; + var i; + var k; + + for (i = 0; i < bodies.length; i++) { - graphics.lineStyle(2, this.defaults.jointDebugColor); + body = bodies[i]; - // Render constraints - var constraints = Composite.allConstraints(this.localWorld); - - for (i = 0; i < constraints.length; i++) + if (!body.render.visible) { - var constraint = constraints[i]; + continue; + } - if (!constraint.render.visible || !constraint.pointA || !constraint.pointB) + // Handle compound parts + for (k = body.parts.length > 1 ? 1 : 0; k < body.parts.length; k++) + { + part = body.parts[k]; + + if (!part.render.visible) { continue; } - if (constraint.render.lineWidth) + if (showSleeping && body.isSleeping) { - graphics.lineStyle(constraint.render.lineWidth, Common.colorToNumber(constraint.render.strokeStyle)); - } - - var bodyA = constraint.bodyA; - var bodyB = constraint.bodyB; - var start; - var end; - - if (bodyA) - { - start = Vector.add(bodyA.position, constraint.pointA); + graphics.lineStyle(1, this.defaults.bodyDebugColor, 0.5 * part.render.opacity); + graphics.fillStyle(this.defaults.bodyDebugColor, 0.5 * part.render.opacity); } else { - start = constraint.pointA; + graphics.lineStyle(1, this.defaults.bodyDebugColor, part.render.opacity); + graphics.fillStyle(this.defaults.bodyDebugColor, part.render.opacity); } - if (constraint.render.type === 'pin') + // Part polygon + if (part.circleRadius) { graphics.beginPath(); - graphics.arc(start.x, start.y, 3, 0, 2 * Math.PI); - graphics.closePath(); + graphics.arc(part.position.x, part.position.y, part.circleRadius, 0, 2 * Math.PI); } else { - if (bodyB) - { - end = Vector.add(bodyB.position, constraint.pointB); - } - else - { - end = constraint.pointB; - } - graphics.beginPath(); - graphics.moveTo(start.x, start.y); + graphics.moveTo(part.vertices[0].x, part.vertices[0].y); - if (constraint.render.type === 'spring') + var vertLength = part.vertices.length; + + for (var j = 1; j < vertLength; j++) { - var delta = Vector.sub(end, start); - var normal = Vector.perp(Vector.normalise(delta)); - var coils = Math.ceil(Common.clamp(constraint.length / 5, 12, 20)); - var offset; - - for (j = 1; j < coils; j += 1) + if (!part.vertices[j - 1].isInternal || showInternalEdges) { - offset = (j % 2 === 0) ? 1 : -1; + graphics.lineTo(part.vertices[j].x, part.vertices[j].y); + } + else + { + graphics.moveTo(part.vertices[j].x, part.vertices[j].y); + } - graphics.lineTo( - start.x + delta.x * (j / coils) + normal.x * offset * 4, - start.y + delta.y * (j / coils) + normal.y * offset * 4 - ); + if (part.vertices[j].isInternal && !showInternalEdges) + { + graphics.moveTo(part.vertices[(j + 1) % part.vertices.length].x, part.vertices[(j + 1) % part.vertices.length].y); } } + + graphics.lineTo(part.vertices[0].x, part.vertices[0].y); - graphics.lineTo(end.x, end.y); + graphics.closePath(); } - if (constraint.render.lineWidth) + if (!wireframes) + { + graphics.fillPath(); + } + else { graphics.strokePath(); } + } + } + }, - if (constraint.render.anchors) + /** + * Renders world constraints. + * + * @method Phaser.Physics.Matter.World#renderJoints + * @private + * @since 3.14.0 + */ + renderJoints: function () + { + var graphics = this.debugGraphic; + + graphics.lineStyle(2, this.defaults.jointDebugColor); + + // Render constraints + var constraints = Composite.allConstraints(this.localWorld); + + for (var i = 0; i < constraints.length; i++) + { + var constraint = constraints[i]; + + if (!constraint.render.visible || !constraint.pointA || !constraint.pointB) + { + continue; + } + + if (constraint.render.lineWidth) + { + graphics.lineStyle(constraint.render.lineWidth, Common.colorToNumber(constraint.render.strokeStyle)); + } + + var bodyA = constraint.bodyA; + var bodyB = constraint.bodyB; + var start; + var end; + + if (bodyA) + { + start = Vector.add(bodyA.position, constraint.pointA); + } + else + { + start = constraint.pointA; + } + + if (constraint.render.type === 'pin') + { + graphics.beginPath(); + graphics.arc(start.x, start.y, 3, 0, 2 * Math.PI); + graphics.closePath(); + } + else + { + if (bodyB) { - graphics.fillStyle(Common.colorToNumber(constraint.render.strokeStyle)); - graphics.beginPath(); - graphics.arc(start.x, start.y, 6, 0, 2 * Math.PI); - graphics.arc(end.x, end.y, 6, 0, 2 * Math.PI); - graphics.closePath(); - graphics.fillPath(); + end = Vector.add(bodyB.position, constraint.pointB); } + else + { + end = constraint.pointB; + } + + graphics.beginPath(); + graphics.moveTo(start.x, start.y); + + if (constraint.render.type === 'spring') + { + var delta = Vector.sub(end, start); + var normal = Vector.perp(Vector.normalise(delta)); + var coils = Math.ceil(Common.clamp(constraint.length / 5, 12, 20)); + var offset; + + for (var j = 1; j < coils; j += 1) + { + offset = (j % 2 === 0) ? 1 : -1; + + graphics.lineTo( + start.x + delta.x * (j / coils) + normal.x * offset * 4, + start.y + delta.y * (j / coils) + normal.y * offset * 4 + ); + } + } + + graphics.lineTo(end.x, end.y); + } + + if (constraint.render.lineWidth) + { + graphics.strokePath(); + } + + if (constraint.render.anchors) + { + graphics.fillStyle(Common.colorToNumber(constraint.render.strokeStyle)); + graphics.beginPath(); + graphics.arc(start.x, start.y, 6, 0, 2 * Math.PI); + graphics.arc(end.x, end.y, 6, 0, 2 * Math.PI); + graphics.closePath(); + graphics.fillPath(); } } }, @@ -56672,6 +57104,11 @@ var World = new Class({ MatterWorld.clear(this.localWorld, false); Engine.clear(this.engine); + + if (this.drawDebug) + { + this.debugGraphic.destroy(); + } }, /** @@ -57217,10 +57654,10 @@ var Resolver = {}; module.exports = Resolver; -var Vertices = __webpack_require__(34); -var Vector = __webpack_require__(33); +var Vertices = __webpack_require__(29); +var Vector = __webpack_require__(34); var Common = __webpack_require__(12); -var Bounds = __webpack_require__(32); +var Bounds = __webpack_require__(33); (function() { @@ -58159,7 +58596,7 @@ var Components = __webpack_require__(113); var GameObject = __webpack_require__(17); var GetFastValue = __webpack_require__(1); var Pipeline = __webpack_require__(132); -var Sprite = __webpack_require__(56); +var Sprite = __webpack_require__(57); var Vector2 = __webpack_require__(3); /** @@ -58444,7 +58881,7 @@ var Composite = __webpack_require__(63); var Constraint = __webpack_require__(73); var Common = __webpack_require__(12); var Body = __webpack_require__(25); -var Bodies = __webpack_require__(54); +var Bodies = __webpack_require__(55); (function() { @@ -58761,16 +59198,18 @@ var Bodies = __webpack_require__(54); /***/ (function(module, exports) { /** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. + * @author Stefan Hedman (http://steffe.se) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ +// v0.3.0 + module.exports = { decomp: polygonDecomp, quickDecomp: polygonQuickDecomp, isSimple: polygonIsSimple, removeCollinearPoints: polygonRemoveCollinearPoints, + removeDuplicatePoints: polygonRemoveDuplicatePoints, makeCCW: polygonMakeCCW }; @@ -58946,6 +59385,9 @@ function polygonMakeCCW(polygon){ // reverse poly if clockwise if (!isLeft(polygonAt(polygon, br - 1), polygonAt(polygon, br), polygonAt(polygon, br + 1))) { polygonReverse(polygon); + return true; + } else { + return false; } } @@ -59010,6 +59452,27 @@ function polygonCanSee(polygon, a,b) { return true; } +/** + * Check if two vertices in the polygon can see each other + * @method canSee2 + * @param {Number} a Vertex index 1 + * @param {Number} b Vertex index 2 + * @return {Boolean} + */ +function polygonCanSee2(polygon, a,b) { + // for each edge + for (var i = 0; i !== polygon.length; ++i) { + // ignore incident edges + if (i === a || i === b || (i + 1) % polygon.length === a || (i + 1) % polygon.length === b){ + continue; + } + if( lineSegmentsIntersect(polygonAt(polygon, a), polygonAt(polygon, b), polygonAt(polygon, i), polygonAt(polygon, i+1)) ){ + return false; + } + } + return true; +} + /** * Copy the polygon from vertex i to vertex j. * @method copy @@ -59293,9 +59756,12 @@ function polygonQuickDecomp(polygon, result,reflexVertices,steinerPoints,delta,m } for (var j = lowerIndex; j <= upperIndex; ++j) { - if (isLeftOn(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j)) && isRightOn(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j))) { + if ( + isLeftOn(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j)) && + isRightOn(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j)) + ) { d = sqdist(polygonAt(poly, i), polygonAt(poly, j)); - if (d < closestDist) { + if (d < closestDist && polygonCanSee2(poly, i, j)) { closestDist = d; closestIndex = j % polygon.length; } @@ -59352,6 +59818,23 @@ function polygonRemoveCollinearPoints(polygon, precision){ return num; } +/** + * Remove duplicate points in the polygon. + * @method removeDuplicatePoints + * @param {Number} [precision] The threshold to use when determining whether two points are the same. Use zero for best precision. + */ +function polygonRemoveDuplicatePoints(polygon, precision){ + for(var i=polygon.length-1; i>=1; --i){ + var pi = polygon[i]; + for(var j=i-1; j>=0; --j){ + if(points_eq(pi, polygon[j], precision)){ + polygon.splice(i,1); + continue; + } + } + } +} + /** * Check if two scalars are equal * @static @@ -59363,7 +59846,20 @@ function polygonRemoveCollinearPoints(polygon, precision){ */ function scalar_eq(a,b,precision){ precision = precision || 0; - return Math.abs(a-b) < precision; + return Math.abs(a-b) <= precision; +} + +/** + * Check if two points are equal + * @static + * @method points_eq + * @param {Array} a + * @param {Array} b + * @param {Number} [precision] + * @return {Boolean} + */ +function points_eq(a,b,precision){ + return scalar_eq(a[0],b[0],precision) && scalar_eq(a[1],b[1],precision); } @@ -59377,7 +59873,7 @@ function scalar_eq(a,b,precision){ * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Bodies = __webpack_require__(54); +var Bodies = __webpack_require__(55); var Class = __webpack_require__(0); var Composites = __webpack_require__(244); var Constraint = __webpack_require__(73); @@ -60016,37 +60512,37 @@ var GetFastValue = __webpack_require__(1); var HasValue = __webpack_require__(77); var Set = __webpack_require__(96); var Solver = __webpack_require__(555); -var TILEMAP_FORMATS = __webpack_require__(29); +var TILEMAP_FORMATS = __webpack_require__(30); var TYPE = __webpack_require__(90); /** * @typedef {object} Phaser.Physics.Impact.WorldConfig * - * @property {number} [gravity=0] - [description] - * @property {number} [cellSize=64] - [description] - * @property {number} [timeScale=1] - [description] + * @property {number} [gravity=0] - Sets {@link Phaser.Physics.Impact.World#gravity} + * @property {number} [cellSize=64] - The size of the cells used for the broadphase pass. Increase this value if you have lots of large objects in the world. + * @property {number} [timeScale=1] - A `Number` that allows per-body time scaling, e.g. a force-field where bodies inside are in slow-motion, while others are at full speed. * @property {number} [maxStep=0.05] - [description] - * @property {boolean} [debug=false] - [description] - * @property {number} [maxVelocity=100] - [description] - * @property {boolean} [debugShowBody=true] - [description] - * @property {boolean} [debugShowVelocity=true] - [description] - * @property {number} [debugBodyColor=0xff00ff] - [description] - * @property {number} [debugVelocityColor=0x00ff00] - [description] - * @property {number} [maxVelocityX=maxVelocity] - [description] - * @property {number} [maxVelocityY=maxVelocity] - [description] - * @property {number} [minBounceVelocity=40] - [description] - * @property {number} [gravityFactor=1] - [description] - * @property {number} [bounciness=0] - [description] - * @property {(object|boolean)} [setBounds] - [description] - * @property {number} [setBounds.x=0] - [description] - * @property {number} [setBounds.y=0] - [description] - * @property {number} [setBounds.width] - [description] - * @property {number} [setBounds.height] - [description] - * @property {number} [setBounds.thickness=64] - [description] - * @property {boolean} [setBounds.left=true] - [description] - * @property {boolean} [setBounds.right=true] - [description] - * @property {boolean} [setBounds.top=true] - [description] - * @property {boolean} [setBounds.bottom=true] - [description] + * @property {boolean} [debug=false] - Sets {@link Phaser.Physics.Impact.World#debug}. + * @property {number} [maxVelocity=100] - The maximum velocity a body can move. + * @property {boolean} [debugShowBody=true] - Whether the Body's boundary is drawn to the debug display. + * @property {boolean} [debugShowVelocity=true] - Whether the Body's velocity is drawn to the debug display. + * @property {number} [debugBodyColor=0xff00ff] - The color of this Body on the debug display. + * @property {number} [debugVelocityColor=0x00ff00] - The color of the Body's velocity on the debug display. + * @property {number} [maxVelocityX=maxVelocity] - Maximum X velocity objects can move. + * @property {number} [maxVelocityY=maxVelocity] - Maximum Y velocity objects can move. + * @property {number} [minBounceVelocity=40] - The minimum velocity an object can be moving at to be considered for bounce. + * @property {number} [gravityFactor=1] - Gravity multiplier. Set to 0 for no gravity. + * @property {number} [bounciness=0] - The default bounce, or restitution, of bodies in the world. + * @property {(object|boolean)} [setBounds] - Should the world have bounds enabled by default? + * @property {number} [setBounds.x=0] - The x coordinate of the world bounds. + * @property {number} [setBounds.y=0] - The y coordinate of the world bounds. + * @property {number} [setBounds.width] - The width of the world bounds. + * @property {number} [setBounds.height] - The height of the world bounds. + * @property {number} [setBounds.thickness=64] - The thickness of the walls of the world bounds. + * @property {boolean} [setBounds.left=true] - Should the left-side world bounds wall be created? + * @property {boolean} [setBounds.right=true] - Should the right-side world bounds wall be created? + * @property {boolean} [setBounds.top=true] - Should the top world bounds wall be created? + * @property {boolean} [setBounds.bottom=true] - Should the bottom world bounds wall be created? */ /** @@ -60054,24 +60550,24 @@ var TYPE = __webpack_require__(90); * * @typedef {object} Phaser.Physics.Impact.WorldDefaults * - * @property {boolean} debugShowBody - [description] - * @property {boolean} debugShowVelocity - [description] - * @property {number} bodyDebugColor - [description] - * @property {number} velocityDebugColor - [description] - * @property {number} maxVelocityX - [description] - * @property {number} maxVelocityY - [description] - * @property {number} minBounceVelocity - [description] - * @property {number} gravityFactor - [description] - * @property {number} bounciness - [description] + * @property {boolean} debugShowBody - Whether the Body's boundary is drawn to the debug display. + * @property {boolean} debugShowVelocity - Whether the Body's velocity is drawn to the debug display. + * @property {number} bodyDebugColor - The color of this Body on the debug display. + * @property {number} velocityDebugColor - The color of the Body's velocity on the debug display. + * @property {number} maxVelocityX - Maximum X velocity objects can move. + * @property {number} maxVelocityY - Maximum Y velocity objects can move. + * @property {number} minBounceVelocity - The minimum velocity an object can be moving at to be considered for bounce. + * @property {number} gravityFactor - Gravity multiplier. Set to 0 for no gravity. + * @property {number} bounciness - The default bounce, or restitution, of bodies in the world. */ /** * @typedef {object} Phaser.Physics.Impact.WorldWalls * - * @property {?Phaser.Physics.Impact.Body} left - [description] - * @property {?Phaser.Physics.Impact.Body} right - [description] - * @property {?Phaser.Physics.Impact.Body} top - [description] - * @property {?Phaser.Physics.Impact.Body} bottom - [description] + * @property {?Phaser.Physics.Impact.Body} left - The left-side wall of the world bounds. + * @property {?Phaser.Physics.Impact.Body} right - The right-side wall of the world bounds. + * @property {?Phaser.Physics.Impact.Body} top - The top wall of the world bounds. + * @property {?Phaser.Physics.Impact.Body} bottom - The bottom wall of the world bounds. */ /** @@ -60487,12 +60983,12 @@ var World = new Class({ }, /** - * [description] + * Creates a Graphics Game Object used for debug display and enables the world for debug drawing. * * @method Phaser.Physics.Impact.World#createDebugGraphic * @since 3.0.0 * - * @return {Phaser.GameObjects.Graphics} [description] + * @return {Phaser.GameObjects.Graphics} The Graphics object created that will have the debug visuals drawn to it. */ createDebugGraphic: function () { @@ -61055,7 +61551,7 @@ module.exports = World; var Class = __webpack_require__(0); var Components = __webpack_require__(152); -var Sprite = __webpack_require__(56); +var Sprite = __webpack_require__(57); /** * @classdesc @@ -61522,7 +62018,7 @@ var ImpactSprite = __webpack_require__(248); * @constructor * @since 3.0.0 * - * @param {Phaser.Physics.Impact.World} world - [description] + * @param {Phaser.Physics.Impact.World} world - A reference to the Impact Physics world. */ var Factory = new Class({ @@ -61531,7 +62027,7 @@ var Factory = new Class({ function Factory (world) { /** - * [description] + * A reference to the Impact Physics world. * * @name Phaser.Physics.Impact.Factory#world * @type {Phaser.Physics.Impact.World} @@ -61550,15 +62046,15 @@ var Factory = new Class({ }, /** - * [description] + * Creates a new ImpactBody object and adds it to the physics simulation. * * @method Phaser.Physics.Impact.Factory#body * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} x - The horizontal position of the body in the physics world. + * @param {number} y - The vertical position of the body in the physics world. + * @param {number} width - The width of the body. + * @param {number} height - The height of the body. * * @return {Phaser.Physics.Impact.ImpactBody} The ImpactBody object that was created. */ @@ -61573,7 +62069,7 @@ var Factory = new Class({ * @method Phaser.Physics.Impact.Factory#existing * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} gameObject - [description] + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to receive the physics body. * * @return {Phaser.GameObjects.GameObject} The Game Object. */ @@ -61593,7 +62089,7 @@ var Factory = new Class({ }, /** - * [description] + * Creates a new ImpactImage object and adds it to the physics world. * * @method Phaser.Physics.Impact.Factory#image * @since 3.0.0 @@ -61615,7 +62111,7 @@ var Factory = new Class({ }, /** - * [description] + * Creates a new ImpactSprite object and adds it to the physics world. * * @method Phaser.Physics.Impact.Factory#sprite * @since 3.0.0 @@ -62505,15 +63001,15 @@ var Body = new Class({ }, /** - * [description] + * Reset the size and position of the physics body. * * @method Phaser.Physics.Impact.Body#resetSize * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} x - The x coordinate to position the body. + * @param {number} y - The y coordinate to position the body. + * @param {number} width - The width of the body. + * @param {number} height - The height of the body. * * @return {Phaser.Physics.Impact.Body} This Body object. */ @@ -62647,15 +63143,22 @@ module.exports = Body; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CircleContains = __webpack_require__(43); +var CircleContains = __webpack_require__(44); var Class = __webpack_require__(0); var CONST = __webpack_require__(39); -var RectangleContains = __webpack_require__(42); +var RectangleContains = __webpack_require__(43); var Vector2 = __webpack_require__(3); /** * @classdesc - * [description] + * A Static Arcade Physics Body. + * + * A Static Body never moves, and isn't automatically synchronized with its parent Game Object. + * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Body manually. + * + * A Static Body can collide with other Bodies, but is never moved by collisions. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Body}. * * @class StaticBody * @memberOf Phaser.Physics.Arcade @@ -62808,6 +63311,7 @@ var StaticBody = new Class({ * * @name Phaser.Physics.Arcade.StaticBody#velocity * @type {Phaser.Math.Vector2} + * @readOnly * @since 3.0.0 */ this.velocity = Vector2.ZERO; @@ -62817,25 +63321,28 @@ var StaticBody = new Class({ * * @name Phaser.Physics.Arcade.StaticBody#allowGravity * @type {boolean} + * @readOnly * @default false * @since 3.0.0 */ this.allowGravity = false; /** - * [description] + * Gravitational force applied specifically to this Body. Values are in pixels per second squared. Always zero for a Static Body. * * @name Phaser.Physics.Arcade.StaticBody#gravity * @type {Phaser.Math.Vector2} + * @readOnly * @since 3.0.0 */ this.gravity = Vector2.ZERO; /** - * [description] + * Rebound, or restitution, following a collision, relative to 1. Always zero for a Static Body. * * @name Phaser.Physics.Arcade.StaticBody#bounce * @type {Phaser.Math.Vector2} + * @readOnly * @since 3.0.0 */ this.bounce = Vector2.ZERO; @@ -62843,7 +63350,7 @@ var StaticBody = new Class({ // If true this Body will dispatch events /** - * [description] + * Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary (and `collideWorldBounds` is also true). * * @name Phaser.Physics.Arcade.StaticBody#onWorldBounds * @type {boolean} @@ -62853,7 +63360,7 @@ var StaticBody = new Class({ this.onWorldBounds = false; /** - * [description] + * Whether the simulation emits a `collide` event when this StaticBody collides with another. * * @name Phaser.Physics.Arcade.StaticBody#onCollide * @type {boolean} @@ -62863,7 +63370,7 @@ var StaticBody = new Class({ this.onCollide = false; /** - * [description] + * Whether the simulation emits an `overlap` event when this StaticBody overlaps with another. * * @name Phaser.Physics.Arcade.StaticBody#onOverlap * @type {boolean} @@ -62873,7 +63380,7 @@ var StaticBody = new Class({ this.onOverlap = false; /** - * [description] + * The StaticBody's inertia, relative to a default unit (1). With `bounce`, this affects the exchange of momentum (velocities) during collisions. * * @name Phaser.Physics.Arcade.StaticBody#mass * @type {number} @@ -62883,7 +63390,7 @@ var StaticBody = new Class({ this.mass = 1; /** - * [description] + * Whether this object can be moved by collisions with another body. * * @name Phaser.Physics.Arcade.StaticBody#immovable * @type {boolean} @@ -62893,7 +63400,7 @@ var StaticBody = new Class({ this.immovable = true; /** - * [description] + * A flag disabling the default horizontal separation of colliding bodies. Pass your own `processHandler` to the collider. * * @name Phaser.Physics.Arcade.StaticBody#customSeparateX * @type {boolean} @@ -62903,7 +63410,7 @@ var StaticBody = new Class({ this.customSeparateX = false; /** - * [description] + * A flag disabling the default vertical separation of colliding bodies. Pass your own `processHandler` to the collider. * * @name Phaser.Physics.Arcade.StaticBody#customSeparateY * @type {boolean} @@ -62913,7 +63420,7 @@ var StaticBody = new Class({ this.customSeparateY = false; /** - * [description] + * The amount of horizontal overlap (before separation), if this Body is colliding with another. * * @name Phaser.Physics.Arcade.StaticBody#overlapX * @type {number} @@ -62923,7 +63430,7 @@ var StaticBody = new Class({ this.overlapX = 0; /** - * [description] + * The amount of vertical overlap (before separation), if this Body is colliding with another. * * @name Phaser.Physics.Arcade.StaticBody#overlapY * @type {number} @@ -62933,7 +63440,7 @@ var StaticBody = new Class({ this.overlapY = 0; /** - * [description] + * The amount of overlap (before separation), if this StaticBody is circular and colliding with another circular body. * * @name Phaser.Physics.Arcade.StaticBody#overlapR * @type {number} @@ -62943,7 +63450,7 @@ var StaticBody = new Class({ this.overlapR = 0; /** - * [description] + * Whether this StaticBody is overlapped with another and both have zero velocity. * * @name Phaser.Physics.Arcade.StaticBody#embedded * @type {boolean} @@ -62953,7 +63460,7 @@ var StaticBody = new Class({ this.embedded = false; /** - * [description] + * Whether this StaticBody interacts with the world boundary. * * @name Phaser.Physics.Arcade.StaticBody#collideWorldBounds * @type {boolean} @@ -62963,7 +63470,7 @@ var StaticBody = new Class({ this.collideWorldBounds = false; /** - * [description] + * Whether this StaticBody is checked for collisions and for which directions. You can set `checkCollision.none = false` to disable collision checks. * * @name Phaser.Physics.Arcade.StaticBody#checkCollision * @type {ArcadeBodyCollision} @@ -62972,7 +63479,7 @@ var StaticBody = new Class({ this.checkCollision = { none: false, up: true, down: true, left: true, right: true }; /** - * [description] + * Whether this StaticBody is colliding with another and in which direction. * * @name Phaser.Physics.Arcade.StaticBody#touching * @type {ArcadeBodyCollision} @@ -62981,7 +63488,7 @@ var StaticBody = new Class({ this.touching = { none: true, up: false, down: false, left: false, right: false }; /** - * [description] + * Whether this StaticBody was colliding with another during the last step, and in which direction. * * @name Phaser.Physics.Arcade.StaticBody#wasTouching * @type {ArcadeBodyCollision} @@ -62990,7 +63497,7 @@ var StaticBody = new Class({ this.wasTouching = { none: true, up: false, down: false, left: false, right: false }; /** - * [description] + * Whether this StaticBody is colliding with a tile or the world boundary. * * @name Phaser.Physics.Arcade.StaticBody#blocked * @type {ArcadeBodyCollision} @@ -62999,7 +63506,7 @@ var StaticBody = new Class({ this.blocked = { none: true, up: false, down: false, left: false, right: false }; /** - * [description] + * The StaticBody's physics type (static by default). * * @name Phaser.Physics.Arcade.StaticBody#physicsType * @type {integer} @@ -63044,6 +63551,8 @@ var StaticBody = new Class({ * @param {boolean} [update=true] - Reposition and resize this Body to match the new Game Object? * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + * + * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject */ setGameObject: function (gameObject, update) { @@ -63097,13 +63606,13 @@ var StaticBody = new Class({ }, /** - * [description] + * Sets the offset of the body. * * @method Phaser.Physics.Arcade.StaticBody#setOffset * @since 3.4.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The horizontal offset of the Body from the Game Object's center. + * @param {number} y - The vertical offset of the Body from the Game Object's center. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. */ @@ -63180,14 +63689,14 @@ var StaticBody = new Class({ }, /** - * [description] + * Sets this Static Body to have a circular body and sets its sizes and position. * * @method Phaser.Physics.Arcade.StaticBody#setCircle * @since 3.0.0 * - * @param {number} radius - [description] - * @param {number} [offsetX] - [description] - * @param {number} [offsetY] - [description] + * @param {number} radius - The radius of the StaticBody, in pixels. + * @param {number} [offsetX] - The horizontal offset of the StaticBody from its Game Object, in pixels. + * @param {number} [offsetY] - The vertical offset of the StaticBody from its Game Object, in pixels. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. */ @@ -63225,7 +63734,7 @@ var StaticBody = new Class({ }, /** - * [description] + * Updates the StaticBody's `center` from its `position` and dimensions. * * @method Phaser.Physics.Arcade.StaticBody#updateCenter * @since 3.0.0 @@ -63236,13 +63745,14 @@ var StaticBody = new Class({ }, /** - * [description] + * Updates this Static Body's position based on the current Game Object it is bound to. + * Similar to `updateFromGameObject`, but doesn't modify the Body's dimensions. * * @method Phaser.Physics.Arcade.StaticBody#reset * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate to reset the body to. + * @param {number} y - The y coordinate to reset the body to. */ reset: function (x, y) { @@ -63261,7 +63771,7 @@ var StaticBody = new Class({ }, /** - * [description] + * NOOP function. A Static Body cannot be stopped. * * @method Phaser.Physics.Arcade.StaticBody#stop * @since 3.0.0 @@ -63274,14 +63784,14 @@ var StaticBody = new Class({ }, /** - * [description] + * Returns the x and y coordinates of the top left and bottom right points of the StaticBody. * * @method Phaser.Physics.Arcade.StaticBody#getBounds * @since 3.0.0 * - * @param {ArcadeBodyBounds} obj - [description] + * @param {ArcadeBodyBounds} obj - The object which will hold the coordinates of the bounds. * - * @return {ArcadeBodyBounds} [description] + * @return {ArcadeBodyBounds} The same object that was passed with `x`, `y`, `right` and `bottom` values matching the respective values of the StaticBody. */ getBounds: function (obj) { @@ -63294,15 +63804,15 @@ var StaticBody = new Class({ }, /** - * [description] + * Checks to see if a given x,y coordinate is colliding with this Static Body. * * @method Phaser.Physics.Arcade.StaticBody#hitTest * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate to check against this body. + * @param {number} y - The y coordinate to check against this body. * - * @return {boolean} [description] + * @return {boolean} `true` if the given coordinate lies within this body, otherwise `false`. */ hitTest: function (x, y) { @@ -63320,12 +63830,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The absolute (non-negative) change in this StaticBody's horizontal position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaAbsX * @since 3.0.0 * - * @return {number} [description] + * @return {number} Always zero for a Static Body. */ deltaAbsX: function () { @@ -63333,12 +63843,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The absolute (non-negative) change in this StaticBody's vertical position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaAbsY * @since 3.0.0 * - * @return {number} [description] + * @return {number} Always zero for a Static Body. */ deltaAbsY: function () { @@ -63346,12 +63856,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The change in this StaticBody's horizontal position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaX * @since 3.0.0 * - * @return {number} [description] + * @return {number} Always zero for a Static Body. */ deltaX: function () { @@ -63359,12 +63869,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The change in this StaticBody's vertical position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaY * @since 3.0.0 * - * @return {number} [description] + * @return {number} 0 */ deltaY: function () { @@ -63377,7 +63887,7 @@ var StaticBody = new Class({ * @method Phaser.Physics.Arcade.StaticBody#deltaZ * @since 3.0.0 * - * @return {number} [description] + * @return {number} 0 */ deltaZ: function () { @@ -63385,7 +63895,7 @@ var StaticBody = new Class({ }, /** - * [description] + * Disables this Body and marks it for destruction during the next step. * * @method Phaser.Physics.Arcade.StaticBody#destroy * @since 3.0.0 @@ -63398,12 +63908,12 @@ var StaticBody = new Class({ }, /** - * [description] + * Draws a graphical representation of the StaticBody for visual debugging purposes. * * @method Phaser.Physics.Arcade.StaticBody#drawDebug * @since 3.0.0 * - * @param {Phaser.GameObjects.Graphics} graphic - [description] + * @param {Phaser.GameObjects.Graphics} graphic - The Graphics object to use for the debug drawing of the StaticBody. */ drawDebug: function (graphic) { @@ -63417,12 +63927,12 @@ var StaticBody = new Class({ }, /** - * [description] + * Indicates whether the StaticBody is going to be showing a debug visualization during postUpdate. * * @method Phaser.Physics.Arcade.StaticBody#willDrawDebug * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} Whether or not the StaticBody is going to show the debug visualization during postUpdate. */ willDrawDebug: function () { @@ -63430,12 +63940,12 @@ var StaticBody = new Class({ }, /** - * [description] + * Sets the Mass of the StaticBody. Will set the Mass to 0.1 if the value passed is less than or equal to zero. * * @method Phaser.Physics.Arcade.StaticBody#setMass * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - The value to set the Mass to. Values of zero or less are changed to 0.1. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. */ @@ -63453,7 +63963,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The x coordinate of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#x * @type {number} @@ -63478,7 +63988,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The y coordinate of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#y * @type {number} @@ -63503,7 +64013,7 @@ var StaticBody = new Class({ }, /** - * [description] + * Returns the left-most x coordinate of the area of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#left * @type {number} @@ -63520,7 +64030,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The right-most x coordinate of the area of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#right * @type {number} @@ -63537,7 +64047,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The highest y coordinate of the area of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#top * @type {number} @@ -63554,7 +64064,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The lowest y coordinate of the area of the StaticBody. (y + height) * * @name Phaser.Physics.Arcade.StaticBody#bottom * @type {number} @@ -64840,12 +65350,12 @@ module.exports = Collider; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CircleContains = __webpack_require__(43); +var CircleContains = __webpack_require__(44); var Class = __webpack_require__(0); var CONST = __webpack_require__(39); var RadToDeg = __webpack_require__(190); var Rectangle = __webpack_require__(10); -var RectangleContains = __webpack_require__(42); +var RectangleContains = __webpack_require__(43); var Vector2 = __webpack_require__(3); /** @@ -64871,6 +65381,8 @@ var Vector2 = __webpack_require__(3); * @classdesc * A Dynamic Arcade Body. * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticBody}. + * * @class Body * @memberOf Phaser.Physics.Arcade * @constructor @@ -64972,8 +65484,8 @@ var Body = new Class({ this.isCircle = false; /** - * The unscaled radius of this Body's boundary (if circular), as set by setCircle, in source pixels. - * The true radius (if circular) is equal to halfWidth. + * If this Body is circular, this is the unscaled radius of the Body's boundary, as set by setCircle(), in source pixels. + * The true radius is equal to `halfWidth`. * * @name Phaser.Physics.Arcade.Body#radius * @type {number} @@ -65012,7 +65524,7 @@ var Body = new Class({ this.prev = new Vector2(gameObject.x, gameObject.y); /** - * Whether this Body's rotation is affected by its angular acceleration and velocity. + * Whether this Body's `rotation` is affected by its angular acceleration and angular velocity. * * @name Phaser.Physics.Arcade.Body#allowRotation * @type {boolean} @@ -65022,7 +65534,7 @@ var Body = new Class({ this.allowRotation = true; /** - * This body's rotation, in degrees, based on its angular acceleration and velocity. + * This body's rotation, in degrees, based on its angular acceleration and angular velocity. * The Body's rotation controls the `angle` of its Game Object. * It doesn't rotate the Body's boundary, which is always an axis-aligned rectangle or a circle. * @@ -65042,7 +65554,8 @@ var Body = new Class({ this.preRotation = gameObject.angle; /** - * The width of the Body's boundary. If circular, this is also the Body's diameter. + * The width of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. * * @name Phaser.Physics.Arcade.Body#width * @type {number} @@ -65052,7 +65565,8 @@ var Body = new Class({ this.width = width; /** - * The height of the Body's boundary. If circular, this is also the Body's diameter. + * The height of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. * * @name Phaser.Physics.Arcade.Body#height * @type {number} @@ -65062,7 +65576,8 @@ var Body = new Class({ this.height = height; /** - * The unscaled width of the Body, in source pixels. The default is the width of the Body's Game Object's texture frame. + * The unscaled width of the Body, in source pixels, as set by setSize(). + * The default is the width of the Body's Game Object's texture frame. * * @name Phaser.Physics.Arcade.Body#sourceWidth * @type {number} @@ -65072,7 +65587,8 @@ var Body = new Class({ this.sourceWidth = width; /** - * The unscaled height of the Body, in source pixels. The default is the height of the Body's Game Object's texture frame. + * The unscaled height of the Body, in source pixels, as set by setSize(). + * The default is the height of the Body's Game Object's texture frame. * * @name Phaser.Physics.Arcade.Body#sourceHeight * @type {number} @@ -65088,7 +65604,7 @@ var Body = new Class({ } /** - * Half the Body's width. + * Half the Body's width, in pixels. * * @name Phaser.Physics.Arcade.Body#halfWidth * @type {number} @@ -65097,7 +65613,7 @@ var Body = new Class({ this.halfWidth = Math.abs(width / 2); /** - * Half the Body's height. + * Half the Body's height, in pixels. * * @name Phaser.Physics.Arcade.Body#halfHeight * @type {number} @@ -65106,7 +65622,8 @@ var Body = new Class({ this.halfHeight = Math.abs(height / 2); /** - * The center of the Body's boundary. The midpoint of its `position` (top-left corner) and its bottom-right corner. + * The center of the Body's boundary. + * The midpoint of its `position` (top-left corner) and its bottom-right corner. * * @name Phaser.Physics.Arcade.Body#center * @type {Phaser.Math.Vector2} @@ -65115,7 +65632,7 @@ var Body = new Class({ this.center = new Vector2(gameObject.x + this.halfWidth, gameObject.y + this.halfHeight); /** - * The Body's change in position, in pixels per second. + * The Body's velocity, in pixels per second. * * @name Phaser.Physics.Arcade.Body#velocity * @type {Phaser.Math.Vector2} @@ -65124,7 +65641,7 @@ var Body = new Class({ this.velocity = new Vector2(); /** - * The Body's calculated change in position, in pixels, at the last step. + * The Body's calculated velocity, in pixels per second, at the last step. * * @name Phaser.Physics.Arcade.Body#newVelocity * @type {Phaser.Math.Vector2} @@ -65152,7 +65669,7 @@ var Body = new Class({ this.acceleration = new Vector2(); /** - * Whether this Body's velocity is affected by its drag vector. + * Whether this Body's velocity is affected by its `drag`. * * @name Phaser.Physics.Arcade.Body#allowDrag * @type {boolean} @@ -65163,20 +65680,30 @@ var Body = new Class({ /** * Absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. * * @name Phaser.Physics.Arcade.Body#drag - * @type {Phaser.Math.Vector2} + * @type {(Phaser.Math.Vector2|number)} * @since 3.0.0 */ this.drag = new Vector2(); /** - * Whether this Body's position is affected by its gravity vector. + * Whether this Body's position is affected by gravity (local or world). * * @name Phaser.Physics.Arcade.Body#allowGravity * @type {boolean} * @default true * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#gravity + * @see Phaser.Physics.Arcade.World#gravity */ this.allowGravity = true; @@ -65187,6 +65714,7 @@ var Body = new Class({ * @name Phaser.Physics.Arcade.Body#gravity * @type {Phaser.Math.Vector2} * @since 3.0.0 + * @see Phaser.Physics.Arcade.World#gravity */ this.gravity = new Vector2(); @@ -65201,7 +65729,7 @@ var Body = new Class({ /** * Rebound following a collision with the world boundary, relative to 1. - * If empty, `bounce` is used instead. + * If null, `bounce` is used instead. * * @name Phaser.Physics.Arcade.Body#worldBounce * @type {?Phaser.Math.Vector2} @@ -65246,9 +65774,8 @@ var Body = new Class({ this.onOverlap = false; /** - * The Body's absolute maximum velocity. - * - * This limits the Body's rate of movement but not its `velocity` values (which can still exceed `maxVelocity`). + * The Body's absolute maximum velocity, in pixels per second. + * The horizontal and vertical components are applied separately. * * @name Phaser.Physics.Arcade.Body#maxVelocity * @type {Phaser.Math.Vector2} @@ -65257,8 +65784,10 @@ var Body = new Class({ this.maxVelocity = new Vector2(10000, 10000); /** - * If this Body is `immovable` and in motion, this the proportion of this Body's movement received by the riding body on each axis, relative to 1. - * The default value (1, 0) moves the riding body horizontally in equal proportion and vertically not at all. + * If this Body is `immovable` and in motion, `friction` is the proportion of this Body's motion received by the riding Body on each axis, relative to 1. + * The default value (1, 0) moves the riding Body horizontally in equal proportion to this Body and vertically not at all. + * The horizontal component (x) is applied only when two colliding Bodies are separated vertically. + * The vertical component (y) is applied only when two colliding Bodies are separated horizontally. * * @name Phaser.Physics.Arcade.Body#friction * @type {Phaser.Math.Vector2} @@ -65285,7 +65814,7 @@ var Body = new Class({ this.useDamping = false; /** - * The rate of change of this Body's rotation, in degrees per second. + * The rate of change of this Body's `rotation`, in degrees per second. * * @name Phaser.Physics.Arcade.Body#angularVelocity * @type {number} @@ -65295,7 +65824,7 @@ var Body = new Class({ this.angularVelocity = 0; /** - * The rate of change of this Body's angular velocity, in degrees per second squared. + * The Body's angular acceleration (change in angular velocity), in degrees per second squared. * * @name Phaser.Physics.Arcade.Body#angularAcceleration * @type {number} @@ -65307,6 +65836,8 @@ var Body = new Class({ /** * Loss of angular velocity due to angular movement, in degrees per second. * + * Angular drag is applied only when angular acceleration is zero. + * * @name Phaser.Physics.Arcade.Body#angularDrag * @type {number} * @default 0 @@ -65336,7 +65867,7 @@ var Body = new Class({ this.mass = 1; /** - * The angle of this Body's velocity vector, in degrees. + * The calculated angle of this Body's velocity vector, in degrees, during the last step. * * @name Phaser.Physics.Arcade.Body#angle * @type {number} @@ -65346,7 +65877,7 @@ var Body = new Class({ this.angle = 0; /** - * The magnitude of the Body's velocity, as calculated during the last update. + * The calculated magnitude of the Body's velocity, in pixels per second, during the last step. * * @name Phaser.Physics.Arcade.Body#speed * @type {number} @@ -65356,7 +65887,8 @@ var Body = new Class({ this.speed = 0; /** - * The calculated direction of the Body's velocity. + * The direction of the Body's velocity, as calculated during the last step. + * If the Body is moving on both axes (diagonally), this describes motion on the vertical axis only. * * @name Phaser.Physics.Arcade.Body#facing * @type {integer} @@ -65365,7 +65897,7 @@ var Body = new Class({ this.facing = CONST.FACING_NONE; /** - * Whether this object can be moved by collisions with another body. + * Whether this Body can be moved by collisions with another Body. * * @name Phaser.Physics.Arcade.Body#immovable * @type {boolean} @@ -65385,7 +65917,8 @@ var Body = new Class({ this.moves = true; /** - * A flag disabling the default horizontal separation of colliding bodies. Pass your own `processHandler` to the collider. + * A flag disabling the default horizontal separation of colliding bodies. + * Pass your own `collideCallback` to the collider. * * @name Phaser.Physics.Arcade.Body#customSeparateX * @type {boolean} @@ -65395,7 +65928,8 @@ var Body = new Class({ this.customSeparateX = false; /** - * A flag disabling the default vertical separation of colliding bodies. Pass your own `processHandler` to the collider. + * A flag disabling the default vertical separation of colliding bodies. + * Pass your own `collideCallback` to the collider. * * @name Phaser.Physics.Arcade.Body#customSeparateY * @type {boolean} @@ -65566,7 +66100,7 @@ var Body = new Class({ this._sy = gameObject.scaleY; /** - * The calculated change in the Body's horizontal position during the current step. + * The calculated change in the Body's horizontal position during the last step. * * @name Phaser.Physics.Arcade.Body#_dx * @type {number} @@ -65577,7 +66111,7 @@ var Body = new Class({ this._dx = 0; /** - * The calculated change in the Body's vertical position during the current step. + * The calculated change in the Body's vertical position during the last step. * * @name Phaser.Physics.Arcade.Body#_dy * @type {number} @@ -65621,6 +66155,8 @@ var Body = new Class({ transform.rotation = RadToDeg(matrix.rotation); transform.scaleX = matrix.scaleX; transform.scaleY = matrix.scaleY; + transform.displayOriginX = sprite.displayOriginX; + transform.displayOriginY = sprite.displayOriginY; } else { @@ -65629,6 +66165,8 @@ var Body = new Class({ transform.rotation = sprite.angle; transform.scaleX = sprite.scaleX; transform.scaleY = sprite.scaleY; + transform.displayOriginX = sprite.displayOriginX; + transform.displayOriginY = sprite.displayOriginY; } var recalc = false; @@ -65665,7 +66203,7 @@ var Body = new Class({ }, /** - * Updates the Body's `center` from its `position` and dimensions. + * Updates the Body's `center` from its `position`, `width`, and `height`. * * @method Phaser.Physics.Arcade.Body#updateCenter * @since 3.0.0 @@ -65931,7 +66469,7 @@ var Body = new Class({ { height = gameObject.frame.realHeight; } - + this.sourceWidth = width; this.sourceHeight = height; @@ -66217,6 +66755,7 @@ var Body = new Class({ drawDebug: function (graphic) { var pos = this.position; + var x = pos.x + this.halfWidth; var y = pos.y + this.halfHeight; @@ -66892,7 +67431,7 @@ var Clamp = __webpack_require__(24); var Class = __webpack_require__(0); var Collider = __webpack_require__(260); var CONST = __webpack_require__(39); -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); var EventEmitter = __webpack_require__(11); var FuzzyEqual = __webpack_require__(277); var FuzzyGreaterThan = __webpack_require__(276); @@ -66910,9 +67449,9 @@ var SeparateY = __webpack_require__(573); var Set = __webpack_require__(96); var StaticBody = __webpack_require__(254); var TileIntersectsBody = __webpack_require__(255); -var TransformMatrix = __webpack_require__(59); +var TransformMatrix = __webpack_require__(42); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(58); +var Wrap = __webpack_require__(59); /** * @event Phaser.Physics.Arcade.World#pause @@ -67010,7 +67549,7 @@ var Wrap = __webpack_require__(58); /** * An Arcade Physics Collider Type. - * + * * @typedef {( * Phaser.GameObjects.GameObject| * Phaser.GameObjects.Group| @@ -67141,7 +67680,7 @@ var World = new Class({ /** * The number of physics steps to be taken per second. - * + * * This property is read-only. Use the `setFPS` method to modify it at run-time. * * @name Phaser.Physics.Arcade.World#fps @@ -67200,7 +67739,7 @@ var World = new Class({ * - 0.5 = double speed * * @name Phaser.Physics.Arcade.World#timeScale - * @property {number} + * @property {number} * @default 1 * @since 3.10.0 */ @@ -67300,7 +67839,7 @@ var World = new Class({ /** * The maximum number of items per node on the RTree. - * + * * This is ignored if `useTree` is `false`. If you have a large number of bodies in * your world then you may find search performance improves by increasing this value, * to allow more items per node and less node division. @@ -67314,7 +67853,7 @@ var World = new Class({ /** * Should this Arcade Physics World use an RTree for Dynamic Physics bodies or not? - * + * * An RTree is a fast way of spatially sorting of all the moving bodies in the world. * However, at certain limits, the cost of clearing and inserting the bodies into the * tree every frame becomes more expensive than the search speed gains it provides. @@ -67390,7 +67929,7 @@ var World = new Class({ /** * Adds an Arcade Physics Body to a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `enableBody` method is that you can pass arrays or Groups * to this method. * @@ -67516,7 +68055,7 @@ var World = new Class({ * @since 3.10.0 * * @param {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body - The Body to be added to the simulation. - * + * * @return {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} The Body that was added to the simulation. */ add: function (body) @@ -67539,10 +68078,10 @@ var World = new Class({ /** * Disables the Arcade Physics Body of a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `disableBody` method is that you can pass arrays or Groups * to this method. - * + * * The body itself is not deleted, it just has its `enable` property set to false, which * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`. * @@ -68631,11 +69170,11 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#overlap * @since 3.0.0 * - * @param {ArcadeColliderType} object1 - [description] - * @param {ArcadeColliderType} [object2] - [description] - * @param {ArcadePhysicsCallback} [overlapCallback] - [description] - * @param {ArcadePhysicsCallback} [processCallback] - [description] - * @param {*} [callbackContext] - [description] + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if at least one Game Object overlaps another. */ @@ -68653,7 +69192,7 @@ var World = new Class({ * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. * * If you don't require separation then use {@link #overlap} instead. - * + * * If two Groups or arrays are passed, each member of one will be tested against each member of the other. * * If one Group **only** is passed (as `object1`), each member of the Group will be collided against the other members. @@ -68669,13 +69208,13 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#collide * @since 3.0.0 * - * @param {ArcadeColliderType} object1 - [description] - * @param {ArcadeColliderType} [object2] - [description] - * @param {ArcadePhysicsCallback} [collideCallback] - [description] - * @param {ArcadePhysicsCallback} [processCallback] - [description] - * @param {*} [callbackContext] - [description] + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {*} [callbackContext] - The context in which to run the callbacks. * - * @return {boolean} True if any overlapping Game Objects were separated. + * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -68697,9 +69236,9 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * - * @return {boolean} True if any overlapping objects were separated. + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ collideObjects: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly) { @@ -68767,9 +69306,9 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * - * @return {boolean} [description] + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ collideHandler: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly) { @@ -68845,7 +69384,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -68880,7 +69419,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -68973,7 +69512,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -69015,7 +69554,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -69117,7 +69656,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -69255,7 +69794,11 @@ var IsPlainObject = __webpack_require__(8); /** * @classdesc - * [description] + * An Arcade Physics Static Group object. + * + * All Game Objects created by this Group will automatically be given static Arcade Physics bodies. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Group}. * * @class StaticGroup * @extends Phaser.GameObjects.Group @@ -69263,10 +69806,10 @@ var IsPlainObject = __webpack_require__(8); * @constructor * @since 3.0.0 * - * @param {Phaser.Physics.Arcade.World} world - [description] - * @param {Phaser.Scene} scene - [description] - * @param {array} children - [description] - * @param {GroupConfig} config - [description] + * @param {Phaser.Physics.Arcade.World} world - The physics simulation. + * @param {Phaser.Scene} scene - The scene this group belongs to. + * @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. */ var StaticPhysicsGroup = new Class({ @@ -69312,7 +69855,7 @@ var StaticPhysicsGroup = new Class({ } /** - * [description] + * The physics simulation. * * @name Phaser.Physics.Arcade.StaticGroup#world * @type {Phaser.Physics.Arcade.World} @@ -69321,10 +69864,11 @@ var StaticPhysicsGroup = new Class({ this.world = world; /** - * [description] + * The scene this group belongs to. * * @name Phaser.Physics.Arcade.StaticGroup#physicsType * @type {integer} + * @default STATIC_BODY * @since 3.0.0 */ this.physicsType = CONST.STATIC_BODY; @@ -69333,12 +69877,14 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Adds a static physics body to the new group member (if it lacks one) and adds it to the simulation. * * @method Phaser.Physics.Arcade.StaticGroup#createCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The new group member. + * + * @see Phaser.Physics.Arcade.World#enableBody */ createCallbackHandler: function (child) { @@ -69349,12 +69895,14 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Disables the group member's physics body, removing it from the simulation. * * @method Phaser.Physics.Arcade.StaticGroup#removeCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The group member being removed. + * + * @see Phaser.Physics.Arcade.World#disableBody */ removeCallbackHandler: function (child) { @@ -69365,12 +69913,14 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Refreshes the group. * * @method Phaser.Physics.Arcade.StaticGroup#createMultipleCallbackHandler * @since 3.0.0 * - * @param {object} entries - [description] + * @param {Phaser.GameObjects.GameObject[]} entries - The newly created group members. + * + * @see Phaser.Physics.Arcade.StaticGroup#refresh */ createMultipleCallbackHandler: function () { @@ -69378,12 +69928,15 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Resets each Body to the position of its parent Game Object. + * Body sizes aren't changed (use {@link Phaser.Physics.Arcade.Components.Enable#refreshBody} for that). * * @method Phaser.Physics.Arcade.StaticGroup#refresh * @since 3.0.0 * - * @return {Phaser.Physics.Arcade.StaticGroup} [description] + * @return {Phaser.Physics.Arcade.StaticGroup} This group. + * + * @see Phaser.Physics.Arcade.StaticBody#reset */ refresh: function () { @@ -69449,34 +70002,36 @@ var IsPlainObject = __webpack_require__(8); /** * @typedef {object} PhysicsGroupDefaults * - * @property {boolean} setCollideWorldBounds - [description] - * @property {number} setAccelerationX - [description] - * @property {number} setAccelerationY - [description] - * @property {boolean} setAllowDrag - [description] - * @property {boolean} setAllowGravity - [description] - * @property {boolean} setAllowRotation - [description] - * @property {number} setBounceX - [description] - * @property {number} setBounceY - [description] - * @property {number} setDragX - [description] - * @property {number} setDragY - [description] - * @property {number} setGravityX - [description] - * @property {number} setGravityY - [description] - * @property {number} setFrictionX - [description] - * @property {number} setFrictionY - [description] - * @property {number} setVelocityX - [description] - * @property {number} setVelocityY - [description] - * @property {number} setAngularVelocity - [description] - * @property {number} setAngularAcceleration - [description] - * @property {number} setAngularDrag - [description] - * @property {number} setMass - [description] - * @property {boolean} setImmovable - [description] + * @property {boolean} setCollideWorldBounds - As {@link Phaser.Physics.Arcade.Body#setCollideWorldBounds}. + * @property {number} setAccelerationX - As {@link Phaser.Physics.Arcade.Body#setAccelerationX}. + * @property {number} setAccelerationY - As {@link Phaser.Physics.Arcade.Body#setAccelerationY}. + * @property {boolean} setAllowDrag - As {@link Phaser.Physics.Arcade.Body#setAllowDrag}. + * @property {boolean} setAllowGravity - As {@link Phaser.Physics.Arcade.Body#setAllowGravity}. + * @property {boolean} setAllowRotation - As {@link Phaser.Physics.Arcade.Body#setAllowRotation}. + * @property {number} setBounceX - As {@link Phaser.Physics.Arcade.Body#setBounceX}. + * @property {number} setBounceY - As {@link Phaser.Physics.Arcade.Body#setBounceY}. + * @property {number} setDragX - As {@link Phaser.Physics.Arcade.Body#setDragX}. + * @property {number} setDragY - As {@link Phaser.Physics.Arcade.Body#setDragY}. + * @property {number} setGravityX - As {@link Phaser.Physics.Arcade.Body#setGravityX}. + * @property {number} setGravityY - As {@link Phaser.Physics.Arcade.Body#setGravityY}. + * @property {number} setFrictionX - As {@link Phaser.Physics.Arcade.Body#setFrictionX}. + * @property {number} setFrictionY - As {@link Phaser.Physics.Arcade.Body#setFrictionY}. + * @property {number} setVelocityX - As {@link Phaser.Physics.Arcade.Body#setVelocityX}. + * @property {number} setVelocityY - As {@link Phaser.Physics.Arcade.Body#setVelocityY}. + * @property {number} setAngularVelocity - As {@link Phaser.Physics.Arcade.Body#setAngularVelocity}. + * @property {number} setAngularAcceleration - As {@link Phaser.Physics.Arcade.Body#setAngularAcceleration}. + * @property {number} setAngularDrag - As {@link Phaser.Physics.Arcade.Body#setAngularDrag}. + * @property {number} setMass - As {@link Phaser.Physics.Arcade.Body#setMass}. + * @property {boolean} setImmovable - As {@link Phaser.Physics.Arcade.Body#setImmovable}. */ /** * @classdesc * An Arcade Physics Group object. * - * All Game Objects created by this Group will automatically be dynamic Arcade Physics objects. + * All Game Objects created by this Group will automatically be given dynamic Arcade Physics bodies. + * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}. * * @class Group * @extends Phaser.GameObjects.Group @@ -69484,10 +70039,10 @@ var IsPlainObject = __webpack_require__(8); * @constructor * @since 3.0.0 * - * @param {Phaser.Physics.Arcade.World} world - [description] - * @param {Phaser.Scene} scene - [description] - * @param {array} children - [description] - * @param {PhysicsGroupConfig} [config] - [description] + * @param {Phaser.Physics.Arcade.World} world - The physics simulation. + * @param {Phaser.Scene} scene - The scene this group belongs to. + * @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group. */ var PhysicsGroup = new Class({ @@ -69527,7 +70082,7 @@ var PhysicsGroup = new Class({ } /** - * [description] + * The physics simulation. * * @name Phaser.Physics.Arcade.Group#world * @type {Phaser.Physics.Arcade.World} @@ -69537,24 +70092,26 @@ var PhysicsGroup = new Class({ /** * The class to create new group members from. + * This should be ArcadeImage, ArcadeSprite, or a class extending one of those. * * @name Phaser.Physics.Arcade.Group#classType - * @type {Phaser.Physics.Arcade.Sprite} + * @type {(Phaser.Physics.Arcade.Image|Phaser.Physics.Arcade.Sprite)} * @default ArcadeSprite */ config.classType = GetFastValue(config, 'classType', ArcadeSprite); /** - * [description] + * The physics type of the Group's members. * * @name Phaser.Physics.Arcade.Group#physicsType * @type {integer} + * @default DYNAMIC_BODY * @since 3.0.0 */ this.physicsType = CONST.DYNAMIC_BODY; /** - * [description] + * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument. * * @name Phaser.Physics.Arcade.Group#defaults * @type {PhysicsGroupDefaults} @@ -69588,12 +70145,12 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Enables a Game Object's Body and assigns `defaults`. Called when a Group member is added or created. * * @method Phaser.Physics.Arcade.Group#createCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The Game Object being added. */ createCallbackHandler: function (child) { @@ -69611,12 +70168,12 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Disables a Game Object's Body. Called when a Group member is removed. * * @method Phaser.Physics.Arcade.Group#removeCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The Game Object being removed. */ removeCallbackHandler: function (child) { @@ -69627,14 +70184,14 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Sets the velocity of each Group member. * * @method Phaser.Physics.Arcade.Group#setVelocity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} step - [description] + * @param {number} x - The horizontal velocity. + * @param {number} y - The vertical velocity. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x, y), the second (x + step, y + step), and so on. * * @return {Phaser.Physics.Arcade.Group} This Physics Group object. */ @@ -69653,13 +70210,13 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Sets the horizontal velocity of each Group member. * * @method Phaser.Physics.Arcade.Group#setVelocityX * @since 3.0.0 * - * @param {number} value - [description] - * @param {number} step - [description] + * @param {number} value - The velocity value. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x), the second (x + step), and so on. * * @return {Phaser.Physics.Arcade.Group} This Physics Group object. */ @@ -69678,13 +70235,13 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Sets the vertical velocity of each Group member. * * @method Phaser.Physics.Arcade.Group#setVelocityY * @since 3.0.0 * - * @param {number} value - [description] - * @param {number} step - [description] + * @param {number} value - The velocity value. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (y), the second (y + step), and so on. * * @return {Phaser.Physics.Arcade.Group} This Physics Group object. */ @@ -69949,8 +70506,8 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#existing * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} gameObject - [description] - * @param {boolean} [isStatic=false] - Set to true to create a Static body, otherwise it will create a Dynamic body. + * @param {Phaser.GameObjects.GameObject} gameObject - A Game Object. + * @param {boolean} [isStatic=false] - Create a Static body (true) or Dynamic body (false). * * @return {Phaser.GameObjects.GameObject} The Game Object. */ @@ -70068,8 +70625,8 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#staticGroup * @since 3.0.0 * - * @param {object|object[]} [children] - [description] - * @param {GroupConfig} [config] - [description] + * @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. * * @return {Phaser.Physics.Arcade.StaticGroup} The Static Group object that was created. */ @@ -70085,8 +70642,8 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#group * @since 3.0.0 * - * @param {object|object[]} [children] - [description] - * @param {PhysicsGroupConfig} [config] - [description] + * @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group. * * @return {Phaser.Physics.Arcade.Group} The Group object that was created. */ @@ -75799,7 +76356,7 @@ Rectangle.Ceil = __webpack_require__(721); Rectangle.CeilAll = __webpack_require__(720); Rectangle.CenterOn = __webpack_require__(193); Rectangle.Clone = __webpack_require__(719); -Rectangle.Contains = __webpack_require__(42); +Rectangle.Contains = __webpack_require__(43); Rectangle.ContainsPoint = __webpack_require__(718); Rectangle.ContainsRect = __webpack_require__(293); Rectangle.CopyFrom = __webpack_require__(717); @@ -75901,7 +76458,7 @@ module.exports = GetMagnitude; */ var MATH_CONST = __webpack_require__(18); -var Wrap = __webpack_require__(58); +var Wrap = __webpack_require__(59); var Angle = __webpack_require__(75); /** @@ -75970,15 +76527,16 @@ module.exports = Decompose; */ /** - * [description] + * Create an array of points for each corner of a Rectangle + * If an array is specified, each point object will be added to the end of the array, otherwise a new array will be created. * * @function Phaser.Geom.Rectangle.Decompose * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {array} [out] - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle object to be decomposed. + * @param {array} [out] - If provided, each point will be added to this array. * - * @return {array} [description] + * @return {array} Will return the array you specified or a new array containing the points of the Rectangle. */ var Decompose = function (rect, out) { @@ -76037,7 +76595,7 @@ module.exports = PointToLine; // Based on code by Matt DesLauriers // https://github.com/mattdesl/line-circle-collision/blob/master/LICENSE.md -var Contains = __webpack_require__(43); +var Contains = __webpack_require__(44); var Point = __webpack_require__(6); var tmp = new Point(); @@ -76797,19 +77355,19 @@ var Length = __webpack_require__(71); var Point = __webpack_require__(6); /** - * [description] + * Returns an array of evenly spaced points on the perimeter of a Triangle. * * @function Phaser.Geom.Triangle.GetPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [out,$return] * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {integer} quantity - [description] - * @param {number} stepRate - [description] - * @param {(array|Phaser.Geom.Point[])} [out] - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the points from. + * @param {integer} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param {number} stepRate - If `quantity` is 0, the distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [out] - An array to which the points should be appended. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} The modified `out` array, or a new array if none was provided. */ var GetPoints = function (triangle, quantity, stepRate, out) { @@ -76975,7 +77533,7 @@ module.exports = GetPoint; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); var GeomTriangle = __webpack_require__(66); var TriangleRender = __webpack_require__(838); @@ -77120,7 +77678,7 @@ module.exports = Triangle; var StarRender = __webpack_require__(841); var Class = __webpack_require__(0); var Earcut = __webpack_require__(70); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); /** * @classdesc @@ -77407,7 +77965,7 @@ module.exports = Star; var Class = __webpack_require__(0); var GeomRectangle = __webpack_require__(10); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); var RectangleRender = __webpack_require__(844); /** @@ -77776,7 +78334,7 @@ var Class = __webpack_require__(0); var Earcut = __webpack_require__(70); var GetAABB = __webpack_require__(314); var GeomPolygon = __webpack_require__(166); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); var Smooth = __webpack_require__(311); /** @@ -77791,6 +78349,7 @@ var Smooth = __webpack_require__(311); * The Polygon Shape is created by providing a list of points, which are then used to create an * internal Polygon geometry object. The points can be set from a variety of formats: * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point or Vector2 objects: `[new Phaser.Math.Vec2(x1, y1), ...]` * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` @@ -77910,7 +78469,7 @@ module.exports = Polygon; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); var GeomLine = __webpack_require__(60); var LineRender = __webpack_require__(850); @@ -77969,6 +78528,16 @@ var Line = new Class({ var width = this.geom.right - this.geom.left; var height = this.geom.bottom - this.geom.top; + /** + * The width (or thickness) of the line. + * See the setLineWidth method for extra details on changing this on WebGL. + * + * @name Phaser.GameObjects.Line#lineWidth + * @type {number} + * @since 3.13.0 + */ + this.lineWidth = 1; + /** * Private internal value. Holds the start width of the line. * @@ -78065,7 +78634,7 @@ module.exports = Line; var Class = __webpack_require__(0); var IsoTriangleRender = __webpack_require__(853); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); /** * @classdesc @@ -78311,7 +78880,7 @@ module.exports = IsoTriangle; var IsoBoxRender = __webpack_require__(856); var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); /** * @classdesc @@ -78525,7 +79094,7 @@ module.exports = IsoBox; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); var GridRender = __webpack_require__(859); /** @@ -78810,7 +79379,7 @@ var Class = __webpack_require__(0); var Earcut = __webpack_require__(70); var EllipseRender = __webpack_require__(862); var GeomEllipse = __webpack_require__(99); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); /** * @classdesc @@ -78997,7 +79566,7 @@ var Class = __webpack_require__(0); var CurveRender = __webpack_require__(865); var Earcut = __webpack_require__(70); var Rectangle = __webpack_require__(10); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); /** * @classdesc @@ -79181,7 +79750,7 @@ var DegToRad = __webpack_require__(36); var Earcut = __webpack_require__(70); var GeomCircle = __webpack_require__(81); var MATH_CONST = __webpack_require__(18); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(31); /** * @classdesc @@ -79648,7 +80217,7 @@ var Class = __webpack_require__(0); var DegToRad = __webpack_require__(36); var GetBoolean = __webpack_require__(94); var GetValue = __webpack_require__(4); -var Sprite = __webpack_require__(56); +var Sprite = __webpack_require__(57); var TWEEN_CONST = __webpack_require__(93); var Vector2 = __webpack_require__(3); @@ -80625,7 +81194,7 @@ var RandomZone = __webpack_require__(326); var Rectangle = __webpack_require__(10); var StableSort = __webpack_require__(120); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(58); +var Wrap = __webpack_require__(59); /** * @callback ParticleEmitterCallback @@ -82794,7 +83363,7 @@ module.exports = ParticleEmitter; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(36); -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); /** * @classdesc @@ -83969,18 +84538,18 @@ module.exports = GetPoint; var Rectangle = __webpack_require__(10); /** - * [description] + * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. * * @function Phaser.Geom.Rectangle.Union * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rectA - [description] - * @param {Phaser.Geom.Rectangle} rectB - [description] - * @param {Phaser.Geom.Rectangle} [out] - [description] + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. + * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. */ var Union = function (rectA, rectB, out) { @@ -84846,7 +85415,7 @@ var FacebookInstantGamesPlugin = new Class({ * Contains all of the leaderboard data, as populated by the `getLeaderboard()` method. * * @name Phaser.FacebookInstantGamesPlugin#leaderboards - * @type {Leaderboard[]} + * @type {Phaser.FacebookInstantGamesPlugin.Leaderboard[]} * @since 3.13.0 */ this.leaderboards = {}; @@ -87031,6 +87600,17 @@ var TextureSource = new Class({ if (this.renderer.gl && this.isCanvas) { this.glTexture = this.renderer.canvasToTexture(this.image, this.glTexture); + + // Update all the Frames using this TextureSource + + var index = this.texture.getTextureSourceIndex(this); + + var frames = this.texture.getFramesFromTextureSource(index, true); + + for (var i = 0; i < frames.length; i++) + { + frames[i].glTexture = this.glTexture; + } } }, @@ -94522,7 +95102,7 @@ module.exports = SmoothStepInterpolation; */ var Class = __webpack_require__(0); -var Distance = __webpack_require__(57); +var Distance = __webpack_require__(58); var SmoothStepInterpolation = __webpack_require__(364); var Vector2 = __webpack_require__(3); @@ -95486,6 +96066,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native event from the browser. */ + + /* pointerLockChange: function (event) { var element = this.target; @@ -95494,6 +96076,7 @@ var MouseManager = new Class({ this.manager.queue.push(event); }, + */ /** * If the browser supports pointer lock, this will request that the pointer lock is released. If @@ -95520,6 +96103,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native DOM Mouse Move Event. */ + + /* onMouseMove: function (event) { if (event.defaultPrevented || !this.enabled || !this.manager) @@ -95535,6 +96120,7 @@ var MouseManager = new Class({ event.preventDefault(); } }, + */ /** * The Mouse Down Event Handler. @@ -95544,6 +96130,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native DOM Mouse Down Event. */ + + /* onMouseDown: function (event) { if (event.defaultPrevented || !this.enabled) @@ -95559,6 +96147,7 @@ var MouseManager = new Class({ event.preventDefault(); } }, + */ /** * The Mouse Up Event Handler. @@ -95568,6 +96157,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native DOM Mouse Up Event. */ + + /* onMouseUp: function (event) { if (event.defaultPrevented || !this.enabled) @@ -95583,6 +96174,7 @@ var MouseManager = new Class({ event.preventDefault(); } }, + */ /** * Starts the Mouse Event listeners running. @@ -95593,31 +96185,84 @@ var MouseManager = new Class({ */ startListeners: function () { - var target = this.target; + var _this = this; + var onMouseMove = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.manager.queueMouseMove(event); + + if (_this.capture) + { + event.preventDefault(); + } + }; + + var onMouseDown = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.manager.queueMouseDown(event); + + if (_this.capture) + { + event.preventDefault(); + } + }; + + var onMouseUp = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.manager.queueMouseUp(event); + + if (_this.capture) + { + event.preventDefault(); + } + }; + + this.onMouseMove = onMouseMove; + this.onMouseDown = onMouseDown; + this.onMouseUp = onMouseUp; + + var target = this.target; var passive = { passive: true }; var nonPassive = { passive: false }; - if (this.capture) - { - target.addEventListener('mousemove', this.onMouseMove.bind(this), nonPassive); - target.addEventListener('mousedown', this.onMouseDown.bind(this), nonPassive); - target.addEventListener('mouseup', this.onMouseUp.bind(this), nonPassive); - } - else - { - target.addEventListener('mousemove', this.onMouseMove.bind(this), passive); - target.addEventListener('mousedown', this.onMouseDown.bind(this), passive); - target.addEventListener('mouseup', this.onMouseUp.bind(this), passive); - } + target.addEventListener('mousemove', onMouseMove, (this.capture) ? nonPassive : passive); + target.addEventListener('mousedown', onMouseDown, (this.capture) ? nonPassive : passive); + target.addEventListener('mouseup', onMouseUp, (this.capture) ? nonPassive : passive); if (Features.pointerLock) { - this.pointerLockChange = this.pointerLockChange.bind(this); + var onPointerLockChange = function (event) + { + var element = _this.target; - document.addEventListener('pointerlockchange', this.pointerLockChange, true); - document.addEventListener('mozpointerlockchange', this.pointerLockChange, true); - document.addEventListener('webkitpointerlockchange', this.pointerLockChange, true); + _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false; + + _this.manager.queue.push(event); + }; + + this.pointerLockChange = onPointerLockChange; + + document.addEventListener('pointerlockchange', onPointerLockChange, true); + document.addEventListener('mozpointerlockchange', onPointerLockChange, true); + document.addEventListener('webkitpointerlockchange', onPointerLockChange, true); } }, @@ -95760,7 +96405,7 @@ var Mouse = __webpack_require__(366); var Pointer = __webpack_require__(365); var Rectangle = __webpack_require__(10); var Touch = __webpack_require__(363); -var TransformMatrix = __webpack_require__(59); +var TransformMatrix = __webpack_require__(42); var TransformXY = __webpack_require__(362); /** @@ -97252,7 +97897,7 @@ var BitmapMaskPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#onBind * @since 3.0.0 * - * @return {Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline} [description] + * @return {this} This WebGLPipeline instance. */ onBind: function () { @@ -97282,7 +97927,7 @@ var BitmapMaskPipeline = new Class({ * @param {number} height - [description] * @param {number} resolution - [description] * - * @return {Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline} [description] + * @return {this} This WebGLPipeline instance. */ resize: function (width, height, resolution) { @@ -97383,16 +98028,16 @@ module.exports = BitmapMaskPipeline; */ /** - * [description] + * Takes a snapshot of the current frame displayed by a WebGL canvas. * * @function Phaser.Renderer.Snapshot.WebGL * @since 3.0.0 * - * @param {HTMLCanvasElement} sourceCanvas - [description] - * @param {string} [type='image/png'] - [description] - * @param {number} [encoderOptions=0.92] - [description] + * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of. + * @param {string} [type='image/png'] - The format of the returned image. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1, for image formats which use lossy compression (such as `image/jpeg`). * - * @return {HTMLImageElement} [description] + * @return {HTMLImageElement} A new image which contains a snapshot of the canvas's contents. */ var WebGLSnapshot = function (sourceCanvas, type, encoderOptions) { @@ -97457,7 +98102,7 @@ var Class = __webpack_require__(0); var CONST = __webpack_require__(28); var IsSizePowerOfTwo = __webpack_require__(127); var SpliceOne = __webpack_require__(100); -var TransformMatrix = __webpack_require__(59); +var TransformMatrix = __webpack_require__(42); var Utils = __webpack_require__(9); var WebGLSnapshot = __webpack_require__(370); @@ -97469,15 +98114,15 @@ var TextureTintPipeline = __webpack_require__(182); /** * @callback WebGLContextCallback * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer which owns the context. */ /** * @typedef {object} SnapshotState * - * @property {SnapshotCallback} callback - [description] - * @property {string} type - [description] - * @property {number} encoder - [description] + * @property {SnapshotCallback} callback - The function to call after the snapshot is taken. + * @property {string} type - The type of the image to create. + * @property {number} encoder - The image quality, between 0 and 1, for image formats which use lossy compression (such as `image/jpeg`). */ /** @@ -97495,7 +98140,7 @@ var TextureTintPipeline = __webpack_require__(182); * @constructor * @since 3.0.0 * - * @param {Phaser.Game} game - [description] + * @param {Phaser.Game} game - The Game instance which owns this WebGL Renderer. */ var WebGLRenderer = new Class({ @@ -97520,7 +98165,7 @@ var WebGLRenderer = new Class({ }; /** - * [description] + * The local configuration settings of this WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#config * @type {RendererConfig} @@ -97540,7 +98185,7 @@ var WebGLRenderer = new Class({ }; /** - * [description] + * The Game instance which owns this WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#game * @type {Phaser.Game} @@ -97549,7 +98194,7 @@ var WebGLRenderer = new Class({ this.game = game; /** - * [description] + * A constant which allows the renderer to be easily identified as a WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#type * @type {integer} @@ -97558,7 +98203,7 @@ var WebGLRenderer = new Class({ this.type = CONST.WEBGL; /** - * [description] + * The width of a rendered frame. * * @name Phaser.Renderer.WebGL.WebGLRenderer#width * @type {number} @@ -97567,7 +98212,7 @@ var WebGLRenderer = new Class({ this.width = game.config.width; /** - * [description] + * The height of a rendered frame. * * @name Phaser.Renderer.WebGL.WebGLRenderer#height * @type {number} @@ -97576,7 +98221,7 @@ var WebGLRenderer = new Class({ this.height = game.config.height; /** - * [description] + * The canvas which this WebGL Renderer draws to. * * @name Phaser.Renderer.WebGL.WebGLRenderer#canvas * @type {HTMLCanvasElement} @@ -97585,7 +98230,7 @@ var WebGLRenderer = new Class({ this.canvas = game.canvas; /** - * [description] + * An array of functions to invoke if the WebGL context is lost. * * @name Phaser.Renderer.WebGL.WebGLRenderer#lostContextCallbacks * @type {WebGLContextCallback[]} @@ -97594,7 +98239,7 @@ var WebGLRenderer = new Class({ this.lostContextCallbacks = []; /** - * [description] + * An array of functions to invoke if the WebGL context is restored. * * @name Phaser.Renderer.WebGL.WebGLRenderer#restoredContextCallbacks * @type {WebGLContextCallback[]} @@ -97603,7 +98248,9 @@ var WebGLRenderer = new Class({ this.restoredContextCallbacks = []; /** - * [description] + * An array of blend modes supported by the WebGL Renderer. + * + * This array includes the default blend modes as well as any custom blend modes added through {@link #addBlendMode}. * * @name Phaser.Renderer.WebGL.WebGLRenderer#blendModes * @type {array} @@ -97623,7 +98270,7 @@ var WebGLRenderer = new Class({ this.nativeTextures = []; /** - * [description] + * Set to `true` if the WebGL context of the renderer is lost. * * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLost * @type {boolean} @@ -97643,7 +98290,9 @@ var WebGLRenderer = new Class({ this.pipelines = null; /** - * [description] + * Details about the currently scheduled snapshot. + * + * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. * * @name Phaser.Renderer.WebGL.WebGLRenderer#snapshotState * @type {SnapshotState} @@ -97791,7 +98440,7 @@ var WebGLRenderer = new Class({ // These are initialized post context creation /** - * [description] + * The underlying WebGL context of the renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#gl * @type {WebGLRenderingContext} @@ -97916,9 +98565,9 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#init * @since 3.0.0 * - * @param {object} config - [description] + * @param {object} config - The configuration object for the renderer. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ init: function (config) { @@ -98038,15 +98687,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Resizes the internal canvas and drawing buffer. * * @method Phaser.Renderer.WebGL.WebGLRenderer#resize * @since 3.0.0 * - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} width - The width of the renderer. + * @param {number} height - The height of the renderer. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ resize: function (width, height) { @@ -98078,19 +98727,21 @@ var WebGLRenderer = new Class({ this.defaultCamera.setSize(width, height); + gl.scissor(0, (this.drawingBufferHeight - this.height), this.width, this.height); + return this; }, /** - * [description] + * Adds a callback to be invoked when the WebGL context has been restored by the browser. * * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextRestored * @since 3.0.0 * - * @param {WebGLContextCallback} callback - [description] - * @param {object} target - [description] + * @param {WebGLContextCallback} callback - The callback to be invoked on context restoration. + * @param {object} target - The context of the callback. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ onContextRestored: function (callback, target) { @@ -98100,15 +98751,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Adds a callback to be invoked when the WebGL context has been lost by the browser. * * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextLost * @since 3.0.0 * - * @param {WebGLContextCallback} callback - [description] - * @param {object} target - [description] + * @param {WebGLContextCallback} callback - The callback to be invoked on context loss. + * @param {object} target - The context of the callback. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ onContextLost: function (callback, target) { @@ -98125,7 +98776,7 @@ var WebGLRenderer = new Class({ * * @param {string} extensionName - Name of the WebGL extension * - * @return {boolean} [description] + * @return {boolean} `true` if the extension is supported, otherwise `false`. */ hasExtension: function (extensionName) { @@ -98138,7 +98789,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#getExtension * @since 3.0.0 * - * @param {string} extensionName - [description] + * @param {string} extensionName - The name of the extension to load. * * @return {object} WebGL extension if the extension is supported */ @@ -98168,17 +98819,15 @@ var WebGLRenderer = new Class({ } }, - /* Renderer State Manipulation Functions */ - /** * Checks if a pipeline is present in the current WebGLRenderer * * @method Phaser.Renderer.WebGL.WebGLRenderer#hasPipeline * @since 3.0.0 * - * @param {string} pipelineName - Name of the pipeline + * @param {string} pipelineName - The name of the pipeline. * - * @return {boolean} [description] + * @return {boolean} `true` if the given pipeline is loaded, otherwise `false`. */ hasPipeline: function (pipelineName) { @@ -98191,9 +98840,9 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#getPipeline * @since 3.0.0 * - * @param {string} pipelineName - [description] + * @param {string} pipelineName - The name of the pipeline. * - * @return {Phaser.Renderer.WebGL.WebGLPipeline} [description] + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance, or `null` if not found. */ getPipeline: function (pipelineName) { @@ -98201,14 +98850,14 @@ var WebGLRenderer = new Class({ }, /** - * Removes a pipeline by name + * Removes a pipeline by name. * * @method Phaser.Renderer.WebGL.WebGLRenderer#removePipeline * @since 3.0.0 * - * @param {string} pipelineName - [description] + * @param {string} pipelineName - The name of the pipeline to be removed. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ removePipeline: function (pipelineName) { @@ -98223,10 +98872,10 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#addPipeline * @since 3.0.0 * - * @param {string} pipelineName - [description] - * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - Pipeline instance must extend WebGLPipeline + * @param {string} pipelineName - A unique string-based key for the pipeline. + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - A pipeline instance which must extend WebGLPipeline. * - * @return {Phaser.Renderer.WebGL.WebGLPipeline} The instance that was passed. + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipline instance that was passed. */ addPipeline: function (pipelineName, pipelineInstance) { @@ -98236,7 +98885,7 @@ var WebGLRenderer = new Class({ } else { - console.warn('Pipeline', pipelineName, ' already exists.'); + console.warn('Pipeline exists: ' + pipelineName); } pipelineInstance.name = pipelineName; @@ -98252,22 +98901,22 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#pushScissor * @since 3.0.0 * - * @param {integer} x - [description] - * @param {integer} y - [description] - * @param {integer} w - [description] - * @param {integer} h - [description] + * @param {integer} x - The x position of the scissor. + * @param {integer} y - The y position of the scissor. + * @param {integer} width - The width of the scissor. + * @param {integer} height - The height of the scissor. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {integer[]} An array containing the scissor values. */ - pushScissor: function (x, y, w, h) + pushScissor: function (x, y, width, height) { var scissorStack = this.scissorStack; - var scissor = [ x, y, w, h ]; + var scissor = [ x, y, width, height ]; scissorStack.push(scissor); - this.setScissor(x, y, w, h); + this.setScissor(x, y, width, height); this.currentScissor = scissor; @@ -98275,12 +98924,17 @@ var WebGLRenderer = new Class({ }, /** - * Sets the current scissor state + * Sets the current scissor state. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setScissor * @since 3.0.0 + * + * @param {integer} x - The x position of the scissor. + * @param {integer} y - The y position of the scissor. + * @param {integer} width - The width of the scissor. + * @param {integer} height - The height of the scissor. */ - setScissor: function (x, y, w, h) + setScissor: function (x, y, width, height) { var gl = this.gl; @@ -98291,15 +98945,16 @@ var WebGLRenderer = new Class({ var cw = current[2]; var ch = current[3]; - if (cx !== x || cy !== y || cw !== w || ch !== h) + if (cx !== x || cy !== y || cw !== width || ch !== height) { this.flush(); // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/scissor - if (w > 0 && h > 0) + if (width > 0 && height > 0) { - gl.scissor(x, (this.drawingBufferHeight - y - h), w, h); + gl.scissor(x, (this.drawingBufferHeight - y - height), width, height); + } } }, @@ -98398,15 +99053,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Creates a new custom blend mode for the renderer. * * @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode * @since 3.0.0 * - * @param {function} func - [description] - * @param {function} equation - [description] + * @param {function} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. + * @param {function} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. * - * @return {integer} [description] + * @return {integer} The index of the new blend mode, used for referencing it in the future. */ addBlendMode: function (func, equation) { @@ -98416,16 +99071,16 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Updates the function bound to a given custom blend mode. * * @method Phaser.Renderer.WebGL.WebGLRenderer#updateBlendMode * @since 3.0.0 * - * @param {integer} index - [description] - * @param {function} func - [description] - * @param {function} equation - [description] + * @param {integer} index - The index of the custom blend mode. + * @param {function} func - The function to use for the blend mode. + * @param {function} equation - The equation to use for the blend mode. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ updateBlendMode: function (index, func, equation) { @@ -98443,14 +99098,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Removes a custom blend mode from the renderer. + * Any Game Objects still using this blend mode will error, so be sure to clear them first. * * @method Phaser.Renderer.WebGL.WebGLRenderer#removeBlendMode * @since 3.0.0 * - * @param {integer} index - [description] + * @param {integer} index - The index of the custom blend mode to be removed. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ removeBlendMode: function (index) { @@ -98471,8 +99127,6 @@ var WebGLRenderer = new Class({ * @since 3.12.0 * * @param {boolean} [force=false] - Force a blank texture set, regardless of what's already bound? - * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. */ setBlankTexture: function (force) { @@ -98491,10 +99145,10 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setTexture2D * @since 3.0.0 * - * @param {WebGLTexture} texture - The WebGL texture that needs to be bound - * @param {integer} textureUnit - The texture unit to which the texture will be bound + * @param {WebGLTexture} texture - The WebGL texture that needs to be bound. + * @param {integer} textureUnit - The texture unit to which the texture will be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setTexture2D: function (texture, textureUnit) { @@ -98520,15 +99174,14 @@ var WebGLRenderer = new Class({ }, /** - * Binds a framebuffer. If there was another framebuffer already bound - * it will force a pipeline flush. + * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setFramebuffer * @since 3.0.0 * * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setFramebuffer: function (framebuffer) { @@ -98560,15 +99213,14 @@ var WebGLRenderer = new Class({ }, /** - * Binds a program. If there was another program already bound - * it will force a pipeline flush + * Binds a program. If there was another program already bound it will force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setProgram * @since 3.0.0 * - * @param {WebGLProgram} program - The program that needs to be bound + * @param {WebGLProgram} program - The program that needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setProgram: function (program) { @@ -98587,15 +99239,14 @@ var WebGLRenderer = new Class({ }, /** - * Bounds a vertex buffer. If there is a vertex buffer already bound - * it'll force a pipeline flush. + * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setVertexBuffer * @since 3.0.0 * - * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound + * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setVertexBuffer: function (vertexBuffer) { @@ -98614,15 +99265,14 @@ var WebGLRenderer = new Class({ }, /** - * Bounds a index buffer. If there is a index buffer already bound - * it'll force a pipeline flush. + * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setIndexBuffer * @since 3.0.0 * - * @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound + * @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setIndexBuffer: function (indexBuffer) { @@ -98640,21 +99290,18 @@ var WebGLRenderer = new Class({ return this; }, - /* Renderer Resource Creation Functions */ - /** - * Creates a texture from an image source. If the source is not valid - * it creates an empty texture + * Creates a texture from an image source. If the source is not valid it creates an empty texture. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createTextureFromSource * @since 3.0.0 * - * @param {object} source - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] - * @param {integer} scaleMode - [description] + * @param {object} source - The source of the texture. + * @param {integer} width - The width of the texture. + * @param {integer} height - The height of the texture. + * @param {integer} scaleMode - The scale mode to be used by the texture. * - * @return {WebGLTexture} [description] + * @return {?WebGLTexture} The WebGL Texture that was created, or `null` if it couldn't be created. */ createTextureFromSource: function (source, width, height, scaleMode) { @@ -98689,24 +99336,23 @@ var WebGLRenderer = new Class({ }, /** - * A wrapper for creating a WebGLTexture. If not pixel data is passed - * it will create an empty texture. + * A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createTexture2D * @since 3.0.0 * - * @param {integer} mipLevel - Mip level of the texture - * @param {integer} minFilter - Filtering of the texture - * @param {integer} magFilter - Filtering of the texture - * @param {integer} wrapT - Wrapping mode of the texture - * @param {integer} wrapS - Wrapping mode of the texture - * @param {integer} format - Which format does the texture use - * @param {object} pixels - pixel data - * @param {integer} width - Width of the texture in pixels - * @param {integer} height - Height of the texture in pixels + * @param {integer} mipLevel - Mip level of the texture. + * @param {integer} minFilter - Filtering of the texture. + * @param {integer} magFilter - Filtering of the texture. + * @param {integer} wrapT - Wrapping mode of the texture. + * @param {integer} wrapS - Wrapping mode of the texture. + * @param {integer} format - Which format does the texture use. + * @param {object} pixels - pixel data. + * @param {integer} width - Width of the texture in pixels. + * @param {integer} height - Height of the texture in pixels. * @param {boolean} pma - Does the texture have premultiplied alpha? * - * @return {WebGLTexture} Raw WebGLTexture + * @return {WebGLTexture} The WebGLTexture that was created. */ createTexture2D: function (mipLevel, minFilter, magFilter, wrapT, wrapS, format, pixels, width, height, pma) { @@ -98876,8 +99522,8 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#createIndexBuffer * @since 3.0.0 * - * @param {ArrayBuffer} initialDataOrSize - It's either ArrayBuffer or an integer indicating the size of the vbo - * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW + * @param {ArrayBuffer} initialDataOrSize - Either ArrayBuffer or an integer indicating the size of the vbo. + * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. * * @return {WebGLBuffer} Raw index buffer */ @@ -98896,14 +99542,14 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Removes the given texture from the nativeTextures array and then deletes it from the GPU. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteTexture * @since 3.0.0 * - * @param {WebGLTexture} texture - [description] + * @param {WebGLTexture} texture - The WebGL Texture to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteTexture: function (texture) { @@ -98920,14 +99566,14 @@ var WebGLRenderer = new Class({ }, /** - * Wrapper for deleting a raw WebGLFramebuffer + * Deletes a WebGLFramebuffer from the GL instance. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteFramebuffer * @since 3.0.0 * - * @param {WebGLFramebuffer} framebuffer - [description] + * @param {WebGLFramebuffer} framebuffer - The Framebuffer to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteFramebuffer: function (framebuffer) { @@ -98937,14 +99583,14 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Deletes a WebGLProgram from the GL instance. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteProgram * @since 3.0.0 * - * @param {WebGLProgram} program - [description] + * @param {WebGLProgram} program - The shader program to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteProgram: function (program) { @@ -98954,14 +99600,14 @@ var WebGLRenderer = new Class({ }, /** - * Wrapper for deleting a vertex or index buffer + * Deletes a WebGLBuffer from the GL instance. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteBuffer * @since 3.0.0 * - * @param {WebGLBuffer} vertexBuffer - [description] + * @param {WebGLBuffer} vertexBuffer - The WebGLBuffer to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteBuffer: function (buffer) { @@ -98970,16 +99616,14 @@ var WebGLRenderer = new Class({ return this; }, - /* Rendering Functions */ - /** - * Handles any clipping needed by the camera and renders the background - * color if a color is visible. + * Controls the pre-render operations for the given camera. + * Handles any clipping needed by the camera and renders the background color if a color is visible. * * @method Phaser.Renderer.WebGL.WebGLRenderer#preRenderCamera * @since 3.0.0 * - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to pre-render. */ preRenderCamera: function (camera) { @@ -99019,30 +99663,29 @@ var WebGLRenderer = new Class({ camera.emit('prerender', camera); } - else if (color.alphaGL > 0) - { - this.pushScissor(cx, cy, cw, ch); - - TextureTintPipeline.drawFillRect( - cx, cy, cw , ch, - Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), - color.alphaGL - ); - } else { this.pushScissor(cx, cy, cw, ch); + + if (color.alphaGL > 0) + { + TextureTintPipeline.drawFillRect( + cx, cy, cw , ch, + Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), + color.alphaGL + ); + } } }, /** - * Renders the foreground camera effects like flash and fading. - * It resets the current scissor state. + * Controls the post-render operations for the given camera. + * Renders the foreground camera effects like flash and fading. It resets the current scissor state. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera * @since 3.0.0 * - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to post-render. */ postRenderCamera: function (camera) { @@ -99138,15 +99781,16 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * The core render step for a Scene. + * Iterates through the given Game Object's array and renders them with the given Camera. * * @method Phaser.Renderer.WebGL.WebGLRenderer#render * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] - * @param {Phaser.GameObjects.GameObject} children - [description] - * @param {number} interpolationPercentage - [description] - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Scene} scene - The Scene to render. + * @param {Phaser.GameObjects.GameObject} children - The Game Object's within the Scene to be rendered. + * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently un-used. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. */ render: function (scene, children, interpolationPercentage, camera) { @@ -99201,7 +99845,7 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * The post-render step happens after all Cameras in all Scenes have been rendered. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRender * @since 3.0.0 @@ -99229,16 +99873,16 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Schedules a snapshot to be taken after the current frame is rendered. * * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshot * @since 3.0.0 * - * @param {SnapshotCallback} callback - [description] - * @param {string} type - [description] - * @param {number} encoderOptions - [description] + * @param {SnapshotCallback} callback - Function to invoke after the snapshot is created. + * @param {string} type - The format of the image to create, usually `image/png`. + * @param {number} encoderOptions - The image quality, between 0 and 1, to use for image formats with lossy compression (such as `image/jpeg`). * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. */ snapshot: function (callback, type, encoderOptions) { @@ -99264,11 +99908,6 @@ var WebGLRenderer = new Class({ { var gl = this.gl; - if (dstTexture) - { - this.deleteTexture(dstTexture); - } - var wrapping = gl.CLAMP_TO_EDGE; if (IsSizePowerOfTwo(srcCanvas.width, srcCanvas.height)) @@ -99276,17 +99915,24 @@ var WebGLRenderer = new Class({ wrapping = gl.REPEAT; } - return this.createTexture2D(0, gl.NEAREST, gl.NEAREST, wrapping, wrapping, gl.RGBA, srcCanvas, srcCanvas.width, srcCanvas.height, true); + var newTexture = this.createTexture2D(0, gl.NEAREST, gl.NEAREST, wrapping, wrapping, gl.RGBA, srcCanvas, srcCanvas.width, srcCanvas.height, true); + + if (newTexture && dstTexture) + { + this.deleteTexture(dstTexture); + } + + return newTexture; }, /** - * [description] + * Sets the minification and magnification filter for a texture. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureFilter * @since 3.0.0 * - * @param {integer} texture - [description] - * @param {integer} filter - [description] + * @param {integer} texture - The texture to set the filter for. + * @param {integer} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. * * @return {this} This WebGL Renderer instance. */ @@ -99807,7 +100453,7 @@ var CONST = __webpack_require__(28); var GetBlendModes = __webpack_require__(372); var ScaleModes = __webpack_require__(104); var Smoothing = __webpack_require__(194); -var TransformMatrix = __webpack_require__(59); +var TransformMatrix = __webpack_require__(42); /** * @classdesc @@ -100345,8 +100991,8 @@ var CanvasRenderer = new Class({ var frameX = cd.x; var frameY = cd.y; - var frameWidth = frame.width; - var frameHeight = frame.height; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; var res = frame.source.resolution; var x = -sprite.displayOriginX + frame.x; @@ -101586,10 +102232,10 @@ var QuadraticBezier = new Class({ * * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * - * @param {Phaser.GameObjects.Graphics} graphics - [description] - * @param {integer} [pointsTotal=32] - [description] + * @param {Phaser.GameObjects.Graphics} graphics - `Graphics` object to draw onto. + * @param {integer} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. * - * @return {Phaser.GameObjects.Graphics} [description] + * @return {Phaser.GameObjects.Graphics} `Graphics` object that was drawn to. */ draw: function (graphics, pointsTotal) { @@ -101612,7 +102258,7 @@ var QuadraticBezier = new Class({ }, /** - * [description] + * Converts the curve into a JSON compatible object. * * @method Phaser.Curves.QuadraticBezier#toJSON * @since 3.2.0 @@ -101634,14 +102280,14 @@ var QuadraticBezier = new Class({ }); /** - * [description] + * Creates a curve from a JSON object, e. g. created by `toJSON`. * * @function Phaser.Curves.QuadraticBezier.fromJSON * @since 3.2.0 * * @param {JSONCurve} data - The JSON object containing this curve data. * - * @return {Phaser.Curves.QuadraticBezier} [description] + * @return {Phaser.Curves.QuadraticBezier} The created curve instance. */ QuadraticBezier.fromJSON = function (data) { @@ -101937,32 +102583,34 @@ var Vector2 = __webpack_require__(3); * @typedef {object} JSONEllipseCurve * * @property {string} type - The of the curve. - * @property {number} x - [description] - * @property {number} y - [description] + * @property {number} x - The x coordinate of the ellipse. + * @property {number} y - The y coordinate of the ellipse. * @property {number} xRadius - The horizontal radius of ellipse. * @property {number} yRadius - The vertical radius of ellipse. - * @property {integer} startAngle - The start angle of ellipse. - * @property {integer} endAngle - The end angle of ellipse. - * @property {boolean} clockwise - The clockwise of ellipse. - * @property {integer} rotation - The rotation of ellipse. + * @property {integer} startAngle - The start angle of the ellipse, in degrees. + * @property {integer} endAngle - The end angle of the ellipse, in degrees. + * @property {boolean} clockwise - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @property {integer} rotation - The rotation of ellipse, in degrees. */ /** * @typedef {object} EllipseCurveConfig * - * @property {number} [x=0] - [description] - * @property {number} [y=0] - [description] - * @property {number} [xRadius=0] - [description] - * @property {number} [yRadius=0] - [description] - * @property {integer} [startAngle=0] - [description] - * @property {integer} [endAngle=360] - [description] - * @property {boolean} [clockwise=false] - [description] - * @property {integer} [rotation=0] - [description] + * @property {number} [x=0] - The x coordinate of the ellipse. + * @property {number} [y=0] - The y coordinate of the ellipse. + * @property {number} [xRadius=0] - The horizontal radius of the ellipse. + * @property {number} [yRadius=0] - The vertical radius of the ellipse. + * @property {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @property {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @property {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @property {integer} [rotation=0] - The rotation of the ellipse, in degrees. */ /** * @classdesc - * [description] + * An Elliptical Curve derived from the Base Curve class. + * + * See https://en.wikipedia.org/wiki/Elliptic_curve for more details. * * @class Ellipse * @extends Phaser.Curves.Curve @@ -101970,14 +102618,14 @@ var Vector2 = __webpack_require__(3); * @constructor * @since 3.0.0 * - * @param {(number|EllipseCurveConfig)} [x=0] - [description] - * @param {number} [y=0] - [description] - * @param {number} [xRadius=0] - [description] - * @param {number} [yRadius=0] - [description] - * @param {integer} [startAngle=0] - [description] - * @param {integer} [endAngle=360] - [description] - * @param {boolean} [clockwise=false] - [description] - * @param {integer} [rotation=0] - [description] + * @param {(number|EllipseCurveConfig)} [x=0] - The x coordinate of the ellipse, or an Ellipse Curve configuration object. + * @param {number} [y=0] - The y coordinate of the ellipse. + * @param {number} [xRadius=0] - The horizontal radius of ellipse. + * @param {number} [yRadius=0] - The vertical radius of ellipse. + * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. */ var EllipseCurve = new Class({ @@ -102014,7 +102662,7 @@ var EllipseCurve = new Class({ // Center point /** - * [description] + * The center point of the ellipse. Used for calculating rotation. * * @name Phaser.Curves.Ellipse#p0 * @type {Phaser.Math.Vector2} @@ -102023,7 +102671,7 @@ var EllipseCurve = new Class({ this.p0 = new Vector2(x, y); /** - * [description] + * The horizontal radius of the ellipse. * * @name Phaser.Curves.Ellipse#_xRadius * @type {number} @@ -102033,7 +102681,7 @@ var EllipseCurve = new Class({ this._xRadius = xRadius; /** - * [description] + * The vertical radius of the ellipse. * * @name Phaser.Curves.Ellipse#_yRadius * @type {number} @@ -102045,7 +102693,7 @@ var EllipseCurve = new Class({ // Radians /** - * [description] + * The starting angle of the ellipse in radians. * * @name Phaser.Curves.Ellipse#_startAngle * @type {number} @@ -102055,7 +102703,7 @@ var EllipseCurve = new Class({ this._startAngle = DegToRad(startAngle); /** - * [description] + * The end angle of the ellipse in radians. * * @name Phaser.Curves.Ellipse#_endAngle * @type {number} @@ -102332,7 +102980,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The x coordinate of the center of the ellipse. * * @name Phaser.Curves.Ellipse#x * @type {number} @@ -102353,7 +103001,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The y coordinate of the center of the ellipse. * * @name Phaser.Curves.Ellipse#y * @type {number} @@ -102374,7 +103022,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The horizontal radius of the ellipse. * * @name Phaser.Curves.Ellipse#xRadius * @type {number} @@ -102395,7 +103043,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The vertical radius of the ellipse. * * @name Phaser.Curves.Ellipse#yRadius * @type {number} @@ -102416,7 +103064,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The start angle of the ellipse in degrees. * * @name Phaser.Curves.Ellipse#startAngle * @type {number} @@ -102437,7 +103085,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The end angle of the ellipse in degrees. * * @name Phaser.Curves.Ellipse#endAngle * @type {number} @@ -102458,7 +103106,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * `true` if the ellipse rotation is clockwise or `false` if anti-clockwise. * * @name Phaser.Curves.Ellipse#clockwise * @type {boolean} @@ -102479,7 +103127,28 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The rotation of the ellipse, relative to the center, in degrees. + * + * @name Phaser.Curves.Ellipse#angle + * @type {number} + * @since 3.14.0 + */ + angle: { + + get: function () + { + return RadToDeg(this._rotation); + }, + + set: function (value) + { + this._rotation = DegToRad(value); + } + + }, + + /** + * The rotation of the ellipse, relative to the center, in radians. * * @name Phaser.Curves.Ellipse#rotation * @type {number} @@ -102494,13 +103163,13 @@ var EllipseCurve = new Class({ set: function (value) { - this._rotation = DegToRad(value); + this._rotation = value; } }, /** - * [description] + * JSON serialization of the curve. * * @method Phaser.Curves.Ellipse#toJSON * @since 3.0.0 @@ -102525,14 +103194,14 @@ var EllipseCurve = new Class({ }); /** - * [description] + * Creates a curve from the provided Ellipse Curve Configuration object. * * @function Phaser.Curves.Ellipse.fromJSON * @since 3.0.0 * * @param {JSONEllipseCurve} data - The JSON object containing this curve data. * - * @return {Phaser.Curves.Ellipse} [description] + * @return {Phaser.Curves.Ellipse} The ellipse curve constructed from the configuration object. */ EllipseCurve.fromJSON = function (data) { @@ -102624,7 +103293,7 @@ var Vector2 = __webpack_require__(3); /** * @classdesc - * [description] + * A higher-order Bézier curve constructed of four points. * * @class CubicBezier * @extends Phaser.Curves.Curve @@ -102656,7 +103325,7 @@ var CubicBezierCurve = new Class({ } /** - * [description] + * The start point of this curve. * * @name Phaser.Curves.CubicBezier#p0 * @type {Phaser.Math.Vector2} @@ -102665,7 +103334,7 @@ var CubicBezierCurve = new Class({ this.p0 = p0; /** - * [description] + * The first control point of this curve. * * @name Phaser.Curves.CubicBezier#p1 * @type {Phaser.Math.Vector2} @@ -102674,7 +103343,7 @@ var CubicBezierCurve = new Class({ this.p1 = p1; /** - * [description] + * The second control point of this curve. * * @name Phaser.Curves.CubicBezier#p2 * @type {Phaser.Math.Vector2} @@ -102683,7 +103352,7 @@ var CubicBezierCurve = new Class({ this.p2 = p2; /** - * [description] + * The end point of this curve. * * @name Phaser.Curves.CubicBezier#p3 * @type {Phaser.Math.Vector2} @@ -102712,7 +103381,7 @@ var CubicBezierCurve = new Class({ }, /** - * [description] + * Returns the resolution of this curve. * * @method Phaser.Curves.CubicBezier#getResolution * @since 3.0.0 @@ -102752,17 +103421,17 @@ var CubicBezierCurve = new Class({ }, /** - * [description] + * Draws this curve to the specified graphics object. * * @method Phaser.Curves.CubicBezier#draw * @since 3.0.0 * * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * - * @param {Phaser.GameObjects.Graphics} graphics - [description] - * @param {integer} [pointsTotal=32] - [description] + * @param {Phaser.GameObjects.Graphics} graphics - The graphics object this curve should be drawn to. + * @param {integer} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. * - * @return {Phaser.GameObjects.Graphics} [description] + * @return {Phaser.GameObjects.Graphics} The graphics object this curve was drawn to. Useful for method chaining. */ draw: function (graphics, pointsTotal) { @@ -102785,7 +103454,7 @@ var CubicBezierCurve = new Class({ }, /** - * [description] + * Returns a JSON object that describes this curve. * * @method Phaser.Curves.CubicBezier#toJSON * @since 3.0.0 @@ -102808,14 +103477,14 @@ var CubicBezierCurve = new Class({ }); /** - * [description] + * Generates a curve from a JSON object. * * @function Phaser.Curves.CubicBezier.fromJSON * @since 3.0.0 * * @param {JSONCurve} data - The JSON object containing this curve data. * - * @return {Phaser.Curves.CubicBezier} [description] + * @return {Phaser.Curves.CubicBezier} The curve generated from the JSON object. */ CubicBezierCurve.fromJSON = function (data) { @@ -102897,8 +103566,8 @@ var GetValue = __webpack_require__(4); * @property {array} [data=[]] - [description] * @property {HTMLCanvasElement} [canvas=null] - [description] * @property {Palette} [palette=Arne16] - [description] - * @property {number} [pixelWidth=1] - [description] - * @property {number} [pixelHeight=1] - [description] + * @property {number} [pixelWidth=1] - The width of each 'pixel' in the generated texture. + * @property {number} [pixelHeight=1] - The height of each 'pixel' in the generated texture. * @property {boolean} [resizeCanvas=true] - [description] * @property {boolean} [clearCanvas=true] - [description] * @property {GenerateTextureRendererCallback} [preRender] - [description] @@ -105026,7 +105695,7 @@ var Pad = __webpack_require__(198); * @constructor * @since 3.0.0 * - * @param {Phaser.Game} game - [description] + * @param {Phaser.Game} game - A reference to the Phaser.Game instance. */ var AnimationManager = new Class({ @@ -105039,7 +105708,7 @@ var AnimationManager = new Class({ EventEmitter.call(this); /** - * [description] + * A reference to the Phaser.Game instance. * * @name Phaser.Animations.AnimationManager#game * @type {Phaser.Game} @@ -105049,7 +105718,7 @@ var AnimationManager = new Class({ this.game = game; /** - * [description] + * A reference to the Texture Manager. * * @name Phaser.Animations.AnimationManager#textureManager * @type {Phaser.Textures.TextureManager} @@ -105179,7 +105848,7 @@ var AnimationManager = new Class({ * @since 3.0.0 * * @param {(string|JSONAnimationManager|JSONAnimation)} data - [description] - * @param {boolean} [clearCurrentAnimations=false] - [description] + * @param {boolean} [clearCurrentAnimations=false] - If set to `true`, the current animations will be removed (`anims.clear()`). If set to `false` (default), the animations in `data` will be added. * * @return {Phaser.Animations.Animation[]} An array containing all of the Animation objects that were created as a result of this call. */ @@ -105234,15 +105903,17 @@ var AnimationManager = new Class({ */ /** - * [description] + * Generate an array of {@link AnimationFrameConfig} objects from a texture key and configuration object. + * + * Generates objects with string frame names, as configured by the given {@link AnimationFrameConfig}. * * @method Phaser.Animations.AnimationManager#generateFrameNames * @since 3.0.0 * - * @param {string} key - [description] - * @param {GenerateFrameNamesConfig} [config] - [description] + * @param {string} key - The key for the texture containing the animation frames. + * @param {GenerateFrameNamesConfig} [config] - The configuration object for the animation frame names. * - * @return {AnimationFrameConfig[]} [description] + * @return {AnimationFrameConfig[]} The array of {@link AnimationFrameConfig} objects. */ generateFrameNames: function (key, config) { @@ -105319,7 +105990,9 @@ var AnimationManager = new Class({ */ /** - * Generates an array of {@link AnimationFrameConfig} objects from a texture key and configuration object. + * Generate an array of {@link AnimationFrameConfig} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link GenerateFrameNumbersConfig}. * * @method Phaser.Animations.AnimationManager#generateFrameNumbers * @since 3.0.0 @@ -105383,14 +106056,14 @@ var AnimationManager = new Class({ }, /** - * [description] + * Get an Animation. * * @method Phaser.Animations.AnimationManager#get * @since 3.0.0 * - * @param {string} key - [description] + * @param {string} key - The key of the Animation to retrieve. * - * @return {Phaser.Animations.Animation} [description] + * @return {Phaser.Animations.Animation} The Animation. */ get: function (key) { @@ -105398,14 +106071,14 @@ var AnimationManager = new Class({ }, /** - * Load an Animation into a Game Objects Animation Component. + * Load an Animation into a Game Object's Animation Component. * * @method Phaser.Animations.AnimationManager#load * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] - * @param {string} key - [description] - * @param {(string|integer)} [startFrame] - [description] + * @param {Phaser.GameObjects.GameObject} child - The Game Object to load the animation into. + * @param {string} key - The key of the animation to load. + * @param {(string|integer)} [startFrame] - The name of a start frame to set on the loaded animation. * * @return {Phaser.GameObjects.GameObject} [description] */ @@ -105422,7 +106095,7 @@ var AnimationManager = new Class({ }, /** - * [description] + * Pause all animations. * * @method Phaser.Animations.AnimationManager#pauseAll * @fires PauseAllAnimationEvent @@ -105443,13 +106116,13 @@ var AnimationManager = new Class({ }, /** - * [description] + * Play an animation on the given Game Objects that have an Animation Component. * * @method Phaser.Animations.AnimationManager#play * @since 3.0.0 * - * @param {string} key - [description] - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {string} key - The key of the animation to play on the Game Object. + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Objects to play the animation on. * * @return {Phaser.Animations.AnimationManager} This Animation Manager. */ @@ -105476,13 +106149,13 @@ var AnimationManager = new Class({ }, /** - * [description] + * Remove an animation. * * @method Phaser.Animations.AnimationManager#remove * @fires RemoveAnimationEvent * @since 3.0.0 * - * @param {string} key - [description] + * @param {string} key - The key of the animation to remove. * * @return {Phaser.Animations.Animation} [description] */ @@ -105501,7 +106174,7 @@ var AnimationManager = new Class({ }, /** - * [description] + * Resume all paused animations. * * @method Phaser.Animations.AnimationManager#resumeAll * @fires ResumeAllAnimationEvent @@ -105522,17 +106195,17 @@ var AnimationManager = new Class({ }, /** - * Takes an array of Game Objects that have the Animation Component and then + * Takes an array of Game Objects that have an Animation Component and then * starts the given animation playing on them, each one offset by the * `stagger` amount given to this method. * * @method Phaser.Animations.AnimationManager#staggerPlay * @since 3.0.0 - * + * * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {string} key - The key of the animation to play on the Game Objects. - * @param {Phaser.GameObjects.GameObject[]} children - An array of Game Objects to play the animation on. They must have the Animation Component. + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} children - An array of Game Objects to play the animation on. They must have an Animation Component. * @param {number} [stagger=0] - The amount of time, in milliseconds, to offset each play time by. * * @return {Phaser.Animations.AnimationManager} This Animation Manager. @@ -106680,7 +107353,7 @@ var Animation = new Class({ component.pendingRepeat = false; - component.parent.emit('animationrepeat', this, component.currentFrame, component.repeatCounter); + component.parent.emit('animationrepeat', this, component.currentFrame, component.repeatCounter, component.parent); } } }, @@ -107216,7 +107889,7 @@ module.exports = Visible; */ var MATH_CONST = __webpack_require__(18); -var TransformMatrix = __webpack_require__(59); +var TransformMatrix = __webpack_require__(42); var WrapAngle = __webpack_require__(206); var WrapAngleDegrees = __webpack_require__(205); @@ -107881,15 +108554,19 @@ var Class = __webpack_require__(0); /** * @classdesc - * [description] + * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect a visible pixel from the geometry mask. The mask is essentially a clipping path which can only make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * + * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and alpha of the pixel from the Geometry Mask do not matter. + * + * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. Moving or transforming the underlying Graphics object will change the mask (and affect the visibility of any masked objects), whereas moving or transforming a masked object will not affect the mask. You can think of the Geometry Mask (or rather, of the its Graphics object) as an invisible curtain placed in front of all masked objects which has its own visual properties and, naturally, respects the camera's visual properties, but isn't affected by and doesn't follow the masked objects by itself. * * @class GeometryMask * @memberOf Phaser.Display.Masks * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description] + * @param {Phaser.Scene} scene - This parameter is not used. + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. */ var GeometryMask = new Class({ @@ -107898,7 +108575,7 @@ var GeometryMask = new Class({ function GeometryMask (scene, graphicsGeometry) { /** - * [description] + * The Graphics object which describes the Geometry Mask. * * @name Phaser.Display.Masks.GeometryMask#geometryMask * @type {Phaser.GameObjects.Graphics} @@ -107908,12 +108585,12 @@ var GeometryMask = new Class({ }, /** - * [description] + * Sets a new Graphics object for the Geometry Mask. * * @method Phaser.Display.Masks.GeometryMask#setShape * @since 3.0.0 * - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description] + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. */ setShape: function (graphicsGeometry) { @@ -107921,14 +108598,14 @@ var GeometryMask = new Class({ }, /** - * [description] + * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. * * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] - * @param {Phaser.GameObjects.GameObject} mask - [description] - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. */ preRenderWebGL: function (renderer, mask, camera) { @@ -107956,12 +108633,12 @@ var GeometryMask = new Class({ }, /** - * [description] + * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. * * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. */ postRenderWebGL: function (renderer) { @@ -107969,18 +108646,19 @@ var GeometryMask = new Class({ // Force flush before disabling stencil test renderer.flush(); + gl.disable(gl.STENCIL_TEST); }, /** - * [description] + * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. * * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description] - * @param {Phaser.GameObjects.GameObject} mask - [description] - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. */ preRenderCanvas: function (renderer, mask, camera) { @@ -107994,12 +108672,12 @@ var GeometryMask = new Class({ }, /** - * [description] + * Restore the canvas context's previous clipping path, thus turning off the mask for it. * * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description] + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. */ postRenderCanvas: function (renderer) { @@ -108511,19 +109189,19 @@ var Perimeter = __webpack_require__(133); // each spaced out based on the quantity or step required /** - * [description] + * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. * * @function Phaser.Geom.Rectangle.GetPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rectangle - [description] + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. * @param {number} step - [description] * @param {integer} quantity - [description] - * @param {(array|Phaser.Geom.Point[])} [out] - [description] + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. */ var GetPoints = function (rectangle, quantity, stepRate, out) { @@ -108775,36 +109453,59 @@ var Class = __webpack_require__(0); /** * This event is dispatched when an animation starts playing. + * + * Listen for it on the Game Object: `sprite.on('animationstart', listener)` * * @event Phaser.GameObjects.Components.Animation#onStartEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. + */ + +/** + * This event is dispatched when an animation restarts. + * + * Listen for it on the Game Object: `sprite.on('animationrestart', listener)` + * + * @event Phaser.GameObjects.Components.Animation#onRestartEvent + * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. + * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** * This event is dispatched when an animation repeats. + * + * Listen for it on the Game Object: `sprite.on('animationrepeat', listener)` * * @event Phaser.GameObjects.Components.Animation#onRepeatEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. * @param {integer} repeatCount - The number of times this animation has repeated. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** * This event is dispatched when an animation updates. This happens when the animation frame changes, * based on the animation frame rate and other factors like timeScale and delay. + * + * Listen for it on the Game Object: `sprite.on('animationupdate', listener)` * * @event Phaser.GameObjects.Components.Animation#onUpdateEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** * This event is dispatched when an animation completes playing, either naturally or via Animation.stop. + * + * Listen for it on the Game Object: `sprite.on('animationcomplete', listener)` * * @event Phaser.GameObjects.Components.Animation#onCompleteEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** @@ -109342,7 +110043,7 @@ var Animation = new Class({ gameObject.visible = true; } - gameObject.emit('animationstart', this.currentAnim, this.currentFrame); + gameObject.emit('animationstart', this.currentAnim, this.currentFrame, gameObject); return gameObject; }, @@ -109507,6 +110208,7 @@ var Animation = new Class({ * Restarts the current animation from its beginning, optionally including its delay value. * * @method Phaser.GameObjects.Components.Animation#restart + * @fires Phaser.GameObjects.Components.Animation#onRestartEvent * @since 3.0.0 * * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting. @@ -109527,6 +110229,10 @@ var Animation = new Class({ // Set frame this.updateFrame(this.currentAnim.frames[0]); + var gameObject = this.parent; + + gameObject.emit('animationrestart', this.currentAnim, this.currentFrame, gameObject); + return this.parent; }, @@ -109547,7 +110253,7 @@ var Animation = new Class({ var gameObject = this.parent; - gameObject.emit('animationcomplete', this.currentAnim, this.currentFrame); + gameObject.emit('animationcomplete', this.currentAnim, this.currentFrame, gameObject); return gameObject; }, @@ -109707,6 +110413,11 @@ var Animation = new Class({ gameObject.texture = animationFrame.frame.texture; gameObject.frame = animationFrame.frame; + if (gameObject.isCropped) + { + gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY); + } + gameObject.setSizeToFrame(); if (animationFrame.frame.customPivot) @@ -109744,7 +110455,7 @@ var Animation = new Class({ var anim = this.currentAnim; - gameObject.emit('animationupdate', anim, animationFrame); + gameObject.emit('animationupdate', anim, animationFrame, gameObject); if (this._pendingStop === 3 && this._pendingStopValue === animationFrame) { @@ -110738,10 +111449,10 @@ module.exports = GetPoint; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetRight = __webpack_require__(47); -var GetTop = __webpack_require__(45); -var SetRight = __webpack_require__(46); -var SetTop = __webpack_require__(44); +var GetRight = __webpack_require__(48); +var GetTop = __webpack_require__(46); +var SetRight = __webpack_require__(47); +var SetTop = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned in the top right of the other. @@ -110782,10 +111493,10 @@ module.exports = TopRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetLeft = __webpack_require__(49); -var GetTop = __webpack_require__(45); -var SetLeft = __webpack_require__(48); -var SetTop = __webpack_require__(44); +var GetLeft = __webpack_require__(50); +var GetTop = __webpack_require__(46); +var SetLeft = __webpack_require__(49); +var SetTop = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned in the top left of the other. @@ -110827,9 +111538,9 @@ module.exports = TopLeft; */ var GetCenterX = __webpack_require__(85); -var GetTop = __webpack_require__(45); +var GetTop = __webpack_require__(46); var SetCenterX = __webpack_require__(84); -var SetTop = __webpack_require__(44); +var SetTop = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned in the top center of the other. @@ -110871,9 +111582,9 @@ module.exports = TopCenter; */ var GetCenterY = __webpack_require__(82); -var GetRight = __webpack_require__(47); +var GetRight = __webpack_require__(48); var SetCenterY = __webpack_require__(83); -var SetRight = __webpack_require__(46); +var SetRight = __webpack_require__(47); /** * Takes given Game Object and aligns it so that it is positioned in the right center of the other. @@ -110915,9 +111626,9 @@ module.exports = RightCenter; */ var GetCenterY = __webpack_require__(82); -var GetLeft = __webpack_require__(49); +var GetLeft = __webpack_require__(50); var SetCenterY = __webpack_require__(83); -var SetLeft = __webpack_require__(48); +var SetLeft = __webpack_require__(49); /** * Takes given Game Object and aligns it so that it is positioned in the left center of the other. @@ -111037,10 +111748,10 @@ module.exports = Center; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(51); -var GetRight = __webpack_require__(47); -var SetBottom = __webpack_require__(50); -var SetRight = __webpack_require__(46); +var GetBottom = __webpack_require__(52); +var GetRight = __webpack_require__(48); +var SetBottom = __webpack_require__(51); +var SetRight = __webpack_require__(47); /** * Takes given Game Object and aligns it so that it is positioned in the bottom right of the other. @@ -111081,10 +111792,10 @@ module.exports = BottomRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(51); -var GetLeft = __webpack_require__(49); -var SetBottom = __webpack_require__(50); -var SetLeft = __webpack_require__(48); +var GetBottom = __webpack_require__(52); +var GetLeft = __webpack_require__(50); +var SetBottom = __webpack_require__(51); +var SetLeft = __webpack_require__(49); /** * Takes given Game Object and aligns it so that it is positioned in the bottom left of the other. @@ -111125,9 +111836,9 @@ module.exports = BottomLeft; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(51); +var GetBottom = __webpack_require__(52); var GetCenterX = __webpack_require__(85); -var SetBottom = __webpack_require__(50); +var SetBottom = __webpack_require__(51); var SetCenterX = __webpack_require__(84); /** @@ -111460,18 +112171,18 @@ var GetValue = __webpack_require__(4); var Clamp = __webpack_require__(24); /** - * [description] + * Retrieves and clamps a numerical value from an object. * * @function Phaser.Utils.Objects.GetMinMaxValue * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} defaultValue - [description] + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`). + * @param {number} min - The minimum value which can be returned. + * @param {number} max - The maximum value which can be returned. + * @param {number} defaultValue - The value to return if the property doesn't exist. It's also constrained to the given bounds. * - * @return {number} [description] + * @return {number} The clamped value from the `source` object. */ var GetMinMaxValue = function (source, key, min, max, defaultValue) { @@ -112978,31 +113689,61 @@ var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPer camMatrix.multiply(layerMatrix, calcMatrix); } - var tileset = src.tileset; var ctx = renderer.currentContext; - var image = tileset.image.getSourceImage(); + var gidMap = src.gidMap; ctx.save(); calcMatrix.copyToContext(ctx); + var alpha = camera.alpha * src.alpha; + ctx.globalAlpha = camera.alpha * src.alpha; for (var i = 0; i < tileCount; i++) { var tile = renderTiles[i]; + var tileset = gidMap[tile.index]; + + if (!tileset) + { + continue; + } + + var image = tileset.image.getSourceImage(); var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); if (tileTexCoords) { + var halfWidth = tile.width / 2; + var halfHeight = tile.height / 2; + + ctx.save(); + + ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); + + if (tile.rotation !== 0) + { + ctx.rotate(tile.rotation); + } + + if (tile.flipX || tile.flipY) + { + ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); + } + + ctx.globalAlpha = alpha * tile.alpha; + ctx.drawImage( image, tileTexCoords.x, tileTexCoords.y, tile.width, tile.height, - tile.pixelX, tile.pixelY, + -halfWidth, -halfHeight, tile.width, tile.height ); + + ctx.restore(); } } @@ -113041,33 +113782,44 @@ module.exports = StaticTilemapLayerCanvasRenderer; */ var StaticTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera) { - src.upload(camera); + var tilesets = src.tileset; - if (src.vertexCount > 0) + var pipeline = src.pipeline; + var pipelineVertexBuffer = pipeline.vertexBuffer; + + renderer.setPipeline(pipeline); + + pipeline.modelIdentity(); + pipeline.modelTranslate(src.x - (camera.scrollX * src.scrollFactorX), src.y - (camera.scrollY * src.scrollFactorY), 0); + pipeline.modelScale(src.scaleX, src.scaleY, 1); + pipeline.viewLoad2D(camera.matrix.matrix); + + for (var i = 0; i < tilesets.length; i++) { - var gl = renderer.gl; - var pipeline = this.pipeline; - var pipelineVertexBuffer = pipeline.vertexBuffer; - var texture = src.tileset.glTexture; - - if (renderer.currentPipeline && renderer.currentPipeline.vertexCount > 0) + src.upload(camera, i); + + if (src.vertexCount[i] > 0) { - renderer.flush(); + if (renderer.currentPipeline && renderer.currentPipeline.vertexCount > 0) + { + renderer.flush(); + } + + pipeline.vertexBuffer = src.vertexBuffer[i]; + + renderer.setPipeline(pipeline); + + renderer.setTexture2D(tilesets[i].glTexture, 0); + + renderer.gl.drawArrays(pipeline.topology, 0, src.vertexCount[i]); } - - pipeline.vertexBuffer = src.vertexBuffer; - - renderer.setPipeline(pipeline); - - renderer.setTexture2D(texture, 0); - - gl.drawArrays(pipeline.topology, 0, src.vertexCount); - - pipeline.vertexBuffer = pipelineVertexBuffer; - - pipeline.viewIdentity(); - pipeline.modelIdentity(); } + + // Restore the pipeline + pipeline.vertexBuffer = pipelineVertexBuffer; + + pipeline.viewIdentity(); + pipeline.modelIdentity(); }; module.exports = StaticTilemapLayerWebGLRenderer; @@ -113170,9 +113922,8 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe camMatrix.multiply(layerMatrix, calcMatrix); } - var tileset = src.tileset; var ctx = renderer.currentContext; - var image = tileset.image.getSourceImage(); + var gidMap = src.gidMap; ctx.save(); @@ -113184,6 +113935,14 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe { var tile = renderTiles[i]; + var tileset = gidMap[tile.index]; + + if (!tileset) + { + continue; + } + + var image = tileset.image.getSourceImage(); var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); if (tileTexCoords) @@ -113264,13 +114023,11 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer return; } - var pipeline = this.pipeline; + var gidMap = src.gidMap; + var pipeline = src.pipeline; var getTint = Utils.getTintAppendFloatAlpha; - var tileset = src.tileset; - var texture = tileset.glTexture; - var scrollFactorX = src.scrollFactorX; var scrollFactorY = src.scrollFactorY; @@ -113280,45 +114037,64 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer var sx = src.scaleX; var sy = src.scaleY; - for (var i = 0; i < tileCount; i++) + var tilesets = src.tileset; + + // Loop through each tileset in this layer, drawing just the tiles that are in that set each time + // Doing it this way around allows us to batch tiles using the same tileset + for (var c = 0; c < tilesets.length; c++) { - var tile = renderTiles[i]; + var currentSet = tilesets[c]; + var texture = currentSet.glTexture; - var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); - - if (tileTexCoords === null) + for (var i = 0; i < tileCount; i++) { - continue; + var tile = renderTiles[i]; + + var tileset = gidMap[tile.index]; + + if (tileset !== currentSet) + { + // Skip tiles that aren't in this set + continue; + } + + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + + if (tileTexCoords === null) + { + continue; + } + + var frameWidth = tile.width; + var frameHeight = tile.height; + + var frameX = tileTexCoords.x; + var frameY = tileTexCoords.y; + + var tw = tile.width * 0.5; + var th = tile.height * 0.5; + + var tint = getTint(tile.tint, alpha * tile.alpha); + + pipeline.batchTexture( + src, + texture, + texture.width, texture.height, + (tw + x + tile.pixelX) * sx, (th + y + tile.pixelY) * sy, + tile.width, tile.height, + sx, sy, + tile.rotation, + tile.flipX, tile.flipY, + scrollFactorX, scrollFactorY, + tw, th, + frameX, frameY, frameWidth, frameHeight, + tint, tint, tint, tint, false, + 0, 0, + camera, + null, + true + ); } - - var frameWidth = tile.width; - var frameHeight = tile.height; - - var frameX = tileTexCoords.x; - var frameY = tileTexCoords.y; - - var tw = tile.width * 0.5; - var th = tile.height * 0.5; - - var tint = getTint(tile.tint, alpha * tile.alpha); - - pipeline.batchTexture( - src, - texture, - texture.width, texture.height, - tw + x + tile.pixelX * sx, th + y + tile.pixelY * sy, - tile.width * sx, tile.height * sy, - 1, 1, - tile.rotation, - tile.flipX, tile.flipY, - scrollFactorX, scrollFactorY, - tw, th, - frameX, frameY, frameWidth, frameHeight, - tint, tint, tint, tint, false, - 0, 0, - camera, - null - ); } }; @@ -113783,27 +114559,78 @@ var ParseTilesets = function (json) { var newSet = new Tileset(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing); - // Properties stored per-tile in object with string indexes starting at "0" - if (set.tileproperties) + if (json.version > 1) { - newSet.tileProperties = set.tileproperties; - } + // Tiled 1.2+ - // Object & terrain shapes stored per-tile in object with string indexes starting at "0" - if (set.tiles) - { - newSet.tileData = set.tiles; - - // Parse the objects into Phaser format to match handling of other Tiled objects - for (stringID in newSet.tileData) + if (Array.isArray(set.tiles)) { - var objectGroup = newSet.tileData[stringID].objectgroup; - if (objectGroup && objectGroup.objects) + var tiles = {}; + var props = {}; + + for (var t = 0; t < set.tiles.length; t++) { - var parsedObjects = objectGroup.objects.map( - function (obj) { return ParseObject(obj); } - ); - newSet.tileData[stringID].objectgroup.objects = parsedObjects; + var tile = set.tiles[t]; + + // Convert tileproperties + if (tile.properties) + { + var newPropData = {}; + + tile.properties.forEach(function (propData) + { + newPropData[propData['name']] = propData['value']; + }); + + props[tile.id] = newPropData; + } + + // Convert objectgroup + if (tile.objectgroup) + { + tiles[tile.id] = { objectgroup: tile.objectgroup }; + + if (tile.objectgroup.objects) + { + var parsedObjects2 = tile.objectgroup.objects.map( + function (obj) { return ParseObject(obj); } + ); + + tiles[tile.id].objectgroup.objects = parsedObjects2; + } + } + } + + newSet.tileData = tiles; + newSet.tileProperties = props; + } + } + else + { + // Tiled 1 + + // Properties stored per-tile in object with string indexes starting at "0" + if (set.tileproperties) + { + newSet.tileProperties = set.tileproperties; + } + + // Object & terrain shapes stored per-tile in object with string indexes starting at "0" + if (set.tiles) + { + newSet.tileData = set.tiles; + + // Parse the objects into Phaser format to match handling of other Tiled objects + for (stringID in newSet.tileData) + { + var objectGroup = newSet.tileData[stringID].objectgroup; + if (objectGroup && objectGroup.objects) + { + var parsedObjects1 = objectGroup.objects.map( + function (obj) { return ParseObject(obj); } + ); + newSet.tileData[stringID].objectgroup.objects = parsedObjects1; + } } } } @@ -113907,14 +114734,14 @@ module.exports = ParseImageLayers; */ /** - * [description] + * Decode base-64 encoded data, for example as exported by Tiled. * * @function Phaser.Tilemaps.Parsers.Tiled.Base64Decode * @since 3.0.0 * - * @param {object} data - [description] + * @param {object} data - Base-64 encoded data to decode. * - * @return {array} [description] + * @return {array} Array containing the decoded bytes. */ var Base64Decode = function (data) { @@ -114101,8 +114928,8 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var WorldToTileX = __webpack_require__(53); -var WorldToTileY = __webpack_require__(52); +var WorldToTileX = __webpack_require__(54); +var WorldToTileY = __webpack_require__(53); var Vector2 = __webpack_require__(3); /** @@ -114114,12 +114941,11 @@ var Vector2 = __webpack_require__(3); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Math.Vector2} The XY location in tile units. @@ -114168,10 +114994,10 @@ var GetTilesWithin = __webpack_require__(19); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. @@ -114240,10 +115066,10 @@ var Vector2 = __webpack_require__(3); * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Math.Vector2} The XY location in world coordinates. @@ -114284,10 +115110,10 @@ var GetTilesWithin = __webpack_require__(19); * * @param {integer} tileA - First tile index. * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SwapByIndex = function (indexA, indexB, tileX, tileY, width, height, layer) @@ -114335,10 +115161,10 @@ var ShuffleArray = __webpack_require__(131); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Shuffle = function (tileX, tileY, width, height, layer) @@ -114378,10 +115204,10 @@ var GetTilesWithin = __webpack_require__(19); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -114420,8 +115246,7 @@ module.exports = SetTileLocationCallback; * @private * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a - * collision callback set for. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -114471,10 +115296,8 @@ var CalculateFacesWithin = __webpack_require__(38); * @private * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer) @@ -114501,7 +115324,10 @@ var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionFromCollisionGroup; @@ -114534,12 +115360,9 @@ var HasValue = __webpack_require__(77); * @private * @since 3.0.0 * - * @param {object} properties - An object with tile properties and corresponding values that should - * be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByProperty = function (properties, collides, recalculateFaces, layer) @@ -114576,7 +115399,10 @@ var SetCollisionByProperty = function (properties, collides, recalculateFaces, l } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionByProperty; @@ -114606,10 +115432,8 @@ var SetLayerCollisionIndex = __webpack_require__(142); * @since 3.0.0 * * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, layer) @@ -114632,7 +115456,10 @@ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, lay } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionByExclusion; @@ -114664,10 +115491,8 @@ var SetLayerCollisionIndex = __webpack_require__(142); * * @param {integer} start - The first index of the tile to be set for collision. * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, layer) @@ -114699,7 +115524,10 @@ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, lay } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionBetween; @@ -114729,10 +115557,8 @@ var SetLayerCollisionIndex = __webpack_require__(142); * @since 3.0.0 * * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollision = function (indexes, collides, recalculateFaces, layer) @@ -114761,7 +115587,10 @@ var SetCollision = function (indexes, collides, recalculateFaces, layer) } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollision; @@ -114780,6 +115609,10 @@ module.exports = SetCollision; var GetTilesWithin = __webpack_require__(19); var Color = __webpack_require__(383); +var defaultTileColor = new Color(105, 210, 231, 150); +var defaultCollidingTileColor = new Color(243, 134, 48, 200); +var defaultFaceColor = new Color(40, 39, 37, 150); + /** * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles @@ -114805,18 +115638,15 @@ var RenderDebug = function (graphics, styleConfig, layer) if (styleConfig === undefined) { styleConfig = {}; } // Default colors without needlessly creating Color objects - var tileColor = styleConfig.tileColor !== undefined - ? styleConfig.tileColor - : new Color(105, 210, 231, 150); - var collidingTileColor = styleConfig.collidingTileColor !== undefined - ? styleConfig.collidingTileColor - : new Color(243, 134, 48, 200); - var faceColor = styleConfig.faceColor !== undefined - ? styleConfig.faceColor - : new Color(40, 39, 37, 150); + var tileColor = (styleConfig.tileColor !== undefined) ? styleConfig.tileColor : defaultTileColor; + var collidingTileColor = (styleConfig.collidingTileColor !== undefined) ? styleConfig.collidingTileColor : defaultCollidingTileColor; + var faceColor = (styleConfig.faceColor !== undefined) ? styleConfig.faceColor : defaultFaceColor; var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); + graphics.translate(layer.tilemapLayer.x, layer.tilemapLayer.y); + graphics.scale(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); + for (var i = 0; i < tiles.length; i++) { var tile = tiles[i]; @@ -114827,6 +115657,7 @@ var RenderDebug = function (graphics, styleConfig, layer) var y = tile.pixelY; var color = tile.collides ? collidingTileColor : tileColor; + if (color !== null) { graphics.fillStyle(color.color, color.alpha / 255); @@ -114842,6 +115673,7 @@ var RenderDebug = function (graphics, styleConfig, layer) if (faceColor !== null) { graphics.lineStyle(1, faceColor.color, faceColor.alpha / 255); + if (tile.faceTop) { graphics.lineBetween(x, y, x + tw, y); } if (tile.faceRight) { graphics.lineBetween(x + tw, y, x + tw, y + th); } if (tile.faceBottom) { graphics.lineBetween(x, y + th, x + tw, y + th); } @@ -114864,8 +115696,8 @@ module.exports = RenderDebug; */ var RemoveTileAt = __webpack_require__(232); -var WorldToTileX = __webpack_require__(53); -var WorldToTileY = __webpack_require__(52); +var WorldToTileX = __webpack_require__(54); +var WorldToTileY = __webpack_require__(53); /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's @@ -114875,12 +115707,11 @@ var WorldToTileY = __webpack_require__(52); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. @@ -114919,10 +115750,10 @@ var GetRandom = __webpack_require__(177); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ @@ -114977,11 +115808,10 @@ var PutTileAt = __webpack_require__(143); * @private * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles - * or tile indexes to place. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var PutTilesAt = function (tilesArray, tileX, tileY, recalculateFaces, layer) @@ -115029,8 +115859,8 @@ module.exports = PutTilesAt; */ var PutTileAt = __webpack_require__(143); -var WorldToTileX = __webpack_require__(53); -var WorldToTileY = __webpack_require__(52); +var WorldToTileX = __webpack_require__(54); +var WorldToTileY = __webpack_require__(53); /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -115043,10 +115873,10 @@ var WorldToTileY = __webpack_require__(52); * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} worldX - [description] - * @param {integer} worldY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. @@ -115072,8 +115902,8 @@ module.exports = PutTileAtWorldXY; */ var HasTileAt = __webpack_require__(233); -var WorldToTileX = __webpack_require__(53); -var WorldToTileY = __webpack_require__(52); +var WorldToTileX = __webpack_require__(54); +var WorldToTileY = __webpack_require__(53); /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns @@ -115083,12 +115913,12 @@ var WorldToTileY = __webpack_require__(52); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The X coordinate of the world position. + * @param {number} worldY - The Y coordinate of the world position. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {boolean} + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ var HasTileAtWorldXY = function (worldX, worldY, camera, layer) { @@ -115112,8 +115942,8 @@ module.exports = HasTileAtWorldXY; */ var GetTilesWithin = __webpack_require__(19); -var WorldToTileX = __webpack_require__(53); -var WorldToTileY = __webpack_require__(52); +var WorldToTileX = __webpack_require__(54); +var WorldToTileY = __webpack_require__(53); /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. @@ -115122,18 +115952,15 @@ var WorldToTileY = __webpack_require__(52); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -115170,8 +115997,8 @@ var Intersects = __webpack_require__(302); var NOOP = __webpack_require__(2); var TileToWorldX = __webpack_require__(109); var TileToWorldY = __webpack_require__(108); -var WorldToTileX = __webpack_require__(53); -var WorldToTileY = __webpack_require__(52); +var WorldToTileX = __webpack_require__(54); +var WorldToTileY = __webpack_require__(53); var TriangleToRectangle = function (triangle, rect) { @@ -115191,13 +116018,10 @@ var TriangleToRectangle = function (triangle, rect) * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -115265,8 +116089,8 @@ module.exports = GetTilesWithinShape; */ var GetTileAt = __webpack_require__(110); -var WorldToTileX = __webpack_require__(53); -var WorldToTileY = __webpack_require__(52); +var WorldToTileX = __webpack_require__(54); +var WorldToTileY = __webpack_require__(53); /** * Gets a tile at the given world coordinates from the given layer. @@ -115277,9 +116101,8 @@ var WorldToTileY = __webpack_require__(52); * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates @@ -115311,9 +116134,9 @@ var GetTilesWithin = __webpack_require__(19); /** * @callback EachTileCallback * - * @param {Phaser.Tilemaps.Tile} value - [description] - * @param {number} index - [description] - * @param {Phaser.Tilemaps.Tile[]} array - [description] + * @param {Phaser.Tilemaps.Tile} value - The Tile. + * @param {integer} index - The index of the tile. + * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. */ /** @@ -115324,25 +116147,22 @@ var GetTilesWithin = __webpack_require__(19); * @private * @since 3.0.0 * - * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ForEachTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + tiles.forEach(callback, context); }; @@ -115364,11 +116184,11 @@ var GetTilesWithin = __webpack_require__(19); /** * @callback FindTileCallback * - * @param {Phaser.Tilemaps.Tile} value - [description] - * @param {number} index - [description] - * @param {Phaser.Tilemaps.Tile[]} array - [description] + * @param {Phaser.Tilemaps.Tile} value - The Tile. + * @param {integer} index - The index of the tile. + * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. * - * @return {boolean} [description] + * @return {boolean} Return `true` if the callback should run, otherwise `false`. */ /** @@ -115380,20 +116200,16 @@ var GetTilesWithin = __webpack_require__(19); * @private * @since 3.0.0 * - * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?Phaser.Tilemaps.Tile} A Tile that matches the search, or null if no Tile found @@ -115520,17 +116336,14 @@ var GetTilesWithin = __webpack_require__(19); * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} The filtered array of Tiles. @@ -115538,6 +116351,7 @@ var GetTilesWithin = __webpack_require__(19); var FilterTiles = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + return tiles.filter(callback, context); }; @@ -115568,21 +116382,20 @@ var SetTileCollision = __webpack_require__(62); * @private * @since 3.0.0 * - * @param {integer} index - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {integer} index - The tile index to fill the area with. + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} layer - The tile layer to use. If not given the current layer is used. */ var Fill = function (index, tileX, tileY, width, height, recalculateFaces, layer) { - if (recalculateFaces === undefined) { recalculateFaces = true; } - var doesIndexCollide = (layer.collideIndexes.indexOf(index) !== -1); var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + for (var i = 0; i < tiles.length; i++) { tiles[i].index = index; @@ -115622,7 +116435,7 @@ var SnapCeil = __webpack_require__(272); * * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. - * @param {array} [outputArray] - [description] + * @param {array} [outputArray] - An optional array to store the Tile objects within. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -115783,11 +116596,8 @@ var ReplaceByIndex = __webpack_require__(234); * @since 3.0.0 * * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted - * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a - * one-to-one mapping with the indexes array. - * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. + * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -115867,13 +116677,13 @@ var CalculateFacesWithin = __webpack_require__(38); * @private * @since 3.0.0 * - * @param {integer} srcTileX - [description] - * @param {integer} srcTileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] - * @param {integer} destTileX - [description] - * @param {integer} destTileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Copy = function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer) @@ -115929,7 +116739,7 @@ module.exports = { Components: __webpack_require__(111), Parsers: __webpack_require__(487), - Formats: __webpack_require__(29), + Formats: __webpack_require__(30), ImageCollection: __webpack_require__(227), ParseToTilemap: __webpack_require__(140), Tile: __webpack_require__(61), @@ -117732,6 +118542,7 @@ var Merge = __webpack_require__(79); var Plugin = __webpack_require__(146); var PluginCache = __webpack_require__(15); var World = __webpack_require__(236); +var Vertices = __webpack_require__(29); /** * @classdesc @@ -117795,6 +118606,17 @@ var MatterPhysics = new Class({ */ this.add; + /** + * A reference to the `Matter.Vertices` module which contains methods for creating and manipulating sets of vertices. + * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. + * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). + * + * @name Phaser.Physics.Matter.MatterPhysics#verts + * @type {MatterJS.Vertices} + * @since 3.14.0 + */ + this.verts = Vertices; + // Matter plugins if (GetValue(this.config, 'plugins.attractors', false)) @@ -118064,7 +118886,7 @@ var Svg = {}; module.exports = Svg; -var Bounds = __webpack_require__(32); +var Bounds = __webpack_require__(33); var Common = __webpack_require__(12); (function() { @@ -118392,11 +119214,11 @@ var Query = {}; module.exports = Query; -var Vector = __webpack_require__(33); +var Vector = __webpack_require__(34); var SAT = __webpack_require__(148); -var Bounds = __webpack_require__(32); -var Bodies = __webpack_require__(54); -var Vertices = __webpack_require__(34); +var Bounds = __webpack_require__(33); +var Bodies = __webpack_require__(55); +var Vertices = __webpack_require__(29); (function() { @@ -118522,7 +119344,7 @@ var Vertices = __webpack_require__(34); * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Bounds = __webpack_require__(32); +var Bounds = __webpack_require__(33); var Class = __webpack_require__(0); var Composite = __webpack_require__(63); var Constraint = __webpack_require__(73); @@ -118531,7 +119353,7 @@ var GetFastValue = __webpack_require__(1); var Merge = __webpack_require__(79); var Sleeping = __webpack_require__(89); var Vector2 = __webpack_require__(3); -var Vertices = __webpack_require__(34); +var Vertices = __webpack_require__(29); /** * @classdesc @@ -118924,7 +119746,7 @@ var _FLAG = 4; // 0100 // Transform Component /** - * [description] + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. * * @name Phaser.Physics.Matter.Components.Transform * @since 3.0.0 @@ -118932,7 +119754,7 @@ var _FLAG = 4; // 0100 var Transform = { /** - * [description] + * The x position of this Game Object. * * @name Phaser.Physics.Matter.Components.Transform#x * @type {number} @@ -118955,7 +119777,7 @@ var Transform = { }, /** - * [description] + * The y position of this Game Object. * * @name Phaser.Physics.Matter.Components.Transform#y * @type {number} @@ -118978,7 +119800,7 @@ var Transform = { }, /** - * [description] + * The horizontal scale of this Game Object. * * @name Phaser.Physics.Matter.Components.Transform#scaleX * @type {number} @@ -119015,7 +119837,7 @@ var Transform = { }, /** - * [description] + * The vertical scale of this Game Object. * * @name Phaser.Physics.Matter.Components.Transform#scaleY * @type {number} @@ -119051,7 +119873,7 @@ var Transform = { }, /** - * [description] + * Use `angle` to set or get rotation of the physics body associated to this GameObject. Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally. * * @name Phaser.Physics.Matter.Components.Transform#angle * @type {number} @@ -119072,7 +119894,7 @@ var Transform = { }, /** - * [description] + * Use `rotation` to set or get the rotation of the physics body associated with this GameObject. The value when set must be in radians. * * @name Phaser.Physics.Matter.Components.Transform#rotation * @type {number} @@ -119095,15 +119917,15 @@ var Transform = { }, /** - * [description] + * Sets the position of the physics body along x and y axes. Both the parameters to this function are optional and if not passed any they default to 0. * * @method Phaser.Physics.Matter.Components.Transform#setPosition * @since 3.0.0 * - * @param {number} [x=0] - [description] - * @param {number} [y=x] - [description] + * @param {number} [x=0] - The horizontal position of the body. + * @param {number} [y=x] - The vertical position of the body. * - * @return{Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setPosition: function (x, y) { @@ -119125,7 +119947,7 @@ var Transform = { * * @param {number} [radians=0] - [description] * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setRotation: function (radians) { @@ -119144,7 +119966,7 @@ var Transform = { * @method Phaser.Physics.Matter.Components.Transform#setFixedRotation * @since 3.0.0 * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setFixedRotation: function () { @@ -119161,7 +119983,7 @@ var Transform = { * * @param {number} [degrees=0] - [description] * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setAngle: function (degrees) { @@ -119175,16 +119997,16 @@ var Transform = { }, /** - * [description] + * Sets the scale of this Game Object. * * @method Phaser.Physics.Matter.Components.Transform#setScale * @since 3.0.0 * - * @param {number} [x=1] - [description] - * @param {number} [y=x] - [description] - * @param {Phaser.Math.Vector2} [point] - [description] + * @param {number} [x=1] - The horizontal scale of this Game Object. + * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the x value. + * @param {Phaser.Math.Vector2} [point] - The point (Vector2) from which scaling will occur. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setScale: function (x, y, point) { @@ -119340,13 +120162,13 @@ module.exports = Sleep; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Bodies = __webpack_require__(54); +var Bodies = __webpack_require__(55); var Body = __webpack_require__(25); -var Bounds = __webpack_require__(32); +var Bounds = __webpack_require__(33); var Common = __webpack_require__(12); var GetFastValue = __webpack_require__(1); -var Vector = __webpack_require__(33); -var Vertices = __webpack_require__(34); +var Vector = __webpack_require__(34); +var Vertices = __webpack_require__(29); /** * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file @@ -119517,10 +120339,11 @@ module.exports = PhysicsEditorParser; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Bodies = __webpack_require__(54); +var Bodies = __webpack_require__(55); var Body = __webpack_require__(25); var GetFastValue = __webpack_require__(1); var PhysicsEditorParser = __webpack_require__(541); +var Vertices = __webpack_require__(29); /** * [description] @@ -119624,7 +120447,11 @@ var SetBody = { } this.body = body; - this.body.gameObject = this; + + for (var i = 0; i < body.parts.length; i++) + { + body.parts[i].gameObject = this; + } var _this = this; @@ -119699,26 +120526,39 @@ var SetBody = { case 'polygon': var sides = GetFastValue(config, 'sides', 5); - var pradius = GetFastValue(config, 'radius', Math.max(bodyWidth, bodyHeight) / 2); - body = Bodies.polygon(bodyX, bodyY, sides, pradius, options); + var pRadius = GetFastValue(config, 'radius', Math.max(bodyWidth, bodyHeight) / 2); + body = Bodies.polygon(bodyX, bodyY, sides, pRadius, options); break; case 'fromVertices': case 'fromVerts': - var verts = GetFastValue(config, 'verts', []); - if (this.body) + var verts = GetFastValue(config, 'verts', null); + + if (verts) { - Body.setVertices(this.body, verts); - body = this.body; - } - else - { - var flagInternal = GetFastValue(config, 'flagInternal', false); - var removeCollinear = GetFastValue(config, 'removeCollinear', 0.01); - var minimumArea = GetFastValue(config, 'minimumArea', 10); - body = Bodies.fromVertices(bodyX, bodyY, verts, options, flagInternal, removeCollinear, minimumArea); + // Has the verts array come from Vertices.fromPath, or is it raw? + if (typeof verts === 'string') + { + verts = Vertices.fromPath(verts); + } + + if (this.body && !this.body.hasOwnProperty('temp')) + { + Body.setVertices(this.body, verts); + + body = this.body; + } + else + { + var flagInternal = GetFastValue(config, 'flagInternal', false); + var removeCollinear = GetFastValue(config, 'removeCollinear', 0.01); + var minimumArea = GetFastValue(config, 'minimumArea', 10); + + body = Bodies.fromVertices(bodyX, bodyY, verts, options, flagInternal, removeCollinear, minimumArea); + } } + break; case 'fromPhysicsEditor': @@ -119726,7 +120566,10 @@ var SetBody = { break; } - this.setExistingBody(body, config.addToWorld); + if (body) + { + this.setExistingBody(body, config.addToWorld); + } return this; } @@ -119932,7 +120775,7 @@ module.exports = Mass; */ /** - * [description] + * A component to manipulate world gravity for Matter.js bodies. * * @name Phaser.Physics.Matter.Components.Gravity * @since 3.0.0 @@ -119940,12 +120783,12 @@ module.exports = Mass; var Gravity = { /** - * [description] + * A togglable function for ignoring world gravity in real-time on the current body. * * @method Phaser.Physics.Matter.Components.Gravity#setIgnoreGravity * @since 3.0.0 * - * @param {boolean} value - [description] + * @param {boolean} value - Set to true to ignore the effect of world gravity, or false to not ignore it. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -120060,7 +120903,7 @@ module.exports = Friction; var Body = __webpack_require__(25); /** - * [description] + * A component to apply force to Matter.js bodies. * * @name Phaser.Physics.Matter.Components.Force * @since 3.0.0 @@ -120068,13 +120911,14 @@ var Body = __webpack_require__(25); var Force = { // force = vec2 / point + /** - * [description] + * Applies a force to a body. * * @method Phaser.Physics.Matter.Components.Force#applyForce * @since 3.0.0 * - * @param {Phaser.Math.Vector2} force - [description] + * @param {Phaser.Math.Vector2} force - A Vector that specifies the force to apply. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -120088,13 +120932,13 @@ var Force = { }, /** - * [description] + * Applies a force to a body from a given position. * * @method Phaser.Physics.Matter.Components.Force#applyForceFrom * @since 3.0.0 * - * @param {Phaser.Math.Vector2} position - [description] - * @param {Phaser.Math.Vector2} force - [description] + * @param {Phaser.Math.Vector2} position - The position in which the force comes from. + * @param {Phaser.Math.Vector2} force - A Vector that specifies the force to apply. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -120106,12 +120950,12 @@ var Force = { }, /** - * [description] + * Apply thrust to the forward position of the body. * * @method Phaser.Physics.Matter.Components.Force#thrust * @since 3.0.0 * - * @param {number} speed - [description] + * @param {number} speed - A speed value to be applied to a directional force. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -120127,12 +120971,12 @@ var Force = { }, /** - * [description] + * Apply thrust to the left position of the body. * * @method Phaser.Physics.Matter.Components.Force#thrustLeft * @since 3.0.0 * - * @param {number} speed - [description] + * @param {number} speed - A speed value to be applied to a directional force. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -120148,12 +120992,12 @@ var Force = { }, /** - * [description] + * Apply thrust to the right position of the body. * * @method Phaser.Physics.Matter.Components.Force#thrustRight * @since 3.0.0 * - * @param {number} speed - [description] + * @param {number} speed - A speed value to be applied to a directional force. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -120169,12 +121013,12 @@ var Force = { }, /** - * [description] + * Apply thrust to the back position of the body. * * @method Phaser.Physics.Matter.Components.Force#thrustBack * @since 3.0.0 * - * @param {number} speed - [description] + * @param {number} speed - A speed value to be applied to a directional force. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -120337,7 +121181,7 @@ var GetFastValue = __webpack_require__(1); var Vector2 = __webpack_require__(3); /** - * [description] + * Internal function to check if the object has a getter or setter. * * @function hasGetterOrSetter * @private @@ -120357,11 +121201,11 @@ function hasGetterOrSetter (def) * @function Phaser.Physics.Matter.MatterGameObject * @since 3.3.0 * - * @param {Phaser.Physics.Matter.World} world - [description] - * @param {Phaser.GameObjects.GameObject} gameObject - [description] - * @param {object} options - [description] + * @param {Phaser.Physics.Matter.World} world - The Matter world to add the body to. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will have the Matter body applied to it. + * @param {object} options - Matter options config object. * - * @return {Phaser.GameObjects.GameObject} [description] + * @return {Phaser.GameObjects.GameObject} The Game Object that was created with the Matter body. */ var MatterGameObject = function (world, gameObject, options) { @@ -120372,6 +121216,7 @@ var MatterGameObject = function (world, gameObject, options) // Temp body pos to avoid body null checks gameObject.body = { + temp: true, position: { x: x, y: y @@ -120511,6 +121356,15 @@ module.exports = { * @class MatterJS.Engine */ +/** + * @classdesc +* The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. +* A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. +* A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). +* +* @class MatterJS.Vertices +*/ + /***/ }), /* 553 */ @@ -120954,7 +121808,8 @@ module.exports = ImpactPhysics; */ /** - * [description] + * The Impact Velocity component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Velocity * @since 3.0.0 @@ -120962,14 +121817,14 @@ module.exports = ImpactPhysics; var Velocity = { /** - * [description] + * Sets the horizontal velocity of the physics body. * * @method Phaser.Physics.Impact.Components.Velocity#setVelocityX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The horizontal velocity value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setVelocityX: function (x) { @@ -120979,14 +121834,14 @@ var Velocity = { }, /** - * [description] + * Sets the vertical velocity of the physics body. * * @method Phaser.Physics.Impact.Components.Velocity#setVelocityY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} y - The vertical velocity value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setVelocityY: function (y) { @@ -120996,15 +121851,15 @@ var Velocity = { }, /** - * [description] + * Sets the horizontal and vertical velocities of the physics body. * * @method Phaser.Physics.Impact.Components.Velocity#setVelocity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The horizontal velocity value. + * @param {number} [y=x] - The vertical velocity value. If not given, defaults to the horizontal value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setVelocity: function (x, y) { @@ -121017,15 +121872,15 @@ var Velocity = { }, /** - * [description] + * Sets the maximum velocity this body can travel at. * * @method Phaser.Physics.Impact.Components.Velocity#setMaxVelocity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The maximum allowed horizontal velocity. + * @param {number} [y=x] - The maximum allowed vertical velocity. If not given, defaults to the horizontal value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setMaxVelocity: function (x, y) { @@ -121053,7 +121908,8 @@ module.exports = Velocity; */ /** - * [description] + * The Impact Set Game Object component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.SetGameObject * @since 3.0.0 @@ -121128,7 +121984,8 @@ module.exports = SetGameObject; */ /** - * [description] + * The Impact Offset component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Offset * @since 3.0.0 @@ -121177,7 +122034,8 @@ module.exports = Offset; */ /** - * [description] + * The Impact Gravity component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Gravity * @since 3.0.0 @@ -121238,7 +122096,8 @@ module.exports = Gravity; */ /** - * [description] + * The Impact Friction component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Friction * @since 3.0.0 @@ -121314,7 +122173,8 @@ module.exports = Friction; */ /** - * [description] + * The Impact Debug component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Debug * @since 3.0.0 @@ -121448,7 +122308,8 @@ var COLLIDES = __webpack_require__(91); */ /** - * [description] + * The Impact Collides component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Collides * @since 3.0.0 @@ -121595,7 +122456,8 @@ module.exports = Collides; var TYPE = __webpack_require__(90); /** - * [description] + * The Impact Check Against component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.CheckAgainst * @since 3.0.0 @@ -121714,7 +122576,8 @@ module.exports = CheckAgainst; */ /** - * [description] + * The Impact Bounce component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Bounce * @since 3.0.0 @@ -121722,12 +122585,12 @@ module.exports = CheckAgainst; var Bounce = { /** - * [description] + * Sets the impact physics bounce, or restitution, value. * * @method Phaser.Physics.Impact.Components.Bounce#setBounce * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - A value between 0 (no rebound) and 1 (full rebound) * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -121739,12 +122602,12 @@ var Bounce = { }, /** - * [description] + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. * * @method Phaser.Physics.Impact.Components.Bounce#setMinBounceVelocity * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - The minimum allowed velocity. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -121756,7 +122619,8 @@ var Bounce = { }, /** - * [description] + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) * * @name Phaser.Physics.Impact.Components.Bounce#bounce * @type {number} @@ -121794,7 +122658,8 @@ module.exports = Bounce; var TYPE = __webpack_require__(90); /** - * [description] + * The Impact Body Type component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.BodyType * @since 3.0.0 @@ -121875,7 +122740,8 @@ module.exports = BodyType; */ /** - * [description] + * The Impact Body Scale component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.BodyScale * @since 3.0.0 @@ -121883,15 +122749,15 @@ module.exports = BodyType; var BodyScale = { /** - * [description] + * Sets the size of the physics body. * * @method Phaser.Physics.Impact.Components.BodyScale#setBodySize * @since 3.0.0 * - * @param {number} width - [description] - * @param {number} [height=width] - [description] + * @param {number} width - The width of the body in pixels. + * @param {number} [height=width] - The height of the body in pixels. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setBodySize: function (width, height) { @@ -121904,15 +122770,15 @@ var BodyScale = { }, /** - * [description] + * Sets the scale of the physics body. * * @method Phaser.Physics.Impact.Components.BodyScale#setBodyScale * @since 3.0.0 * - * @param {number} scaleX - [description] - * @param {number} [scaleY] - [description] + * @param {number} scaleX - The horizontal scale of the body. + * @param {number} [scaleY] - The vertical scale of the body. If not given, will use the horizontal scale value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setBodyScale: function (scaleX, scaleY) { @@ -121948,7 +122814,8 @@ module.exports = BodyScale; */ /** - * [description] + * The Impact Acceleration component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Acceleration * @since 3.0.0 @@ -121956,14 +122823,14 @@ module.exports = BodyScale; var Acceleration = { /** - * [description] + * Sets the horizontal acceleration of this body. * * @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The amount of acceleration to apply. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setAccelerationX: function (x) { @@ -121973,14 +122840,14 @@ var Acceleration = { }, /** - * [description] + * Sets the vertical acceleration of this body. * * @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} y - The amount of acceleration to apply. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setAccelerationY: function (y) { @@ -121990,15 +122857,15 @@ var Acceleration = { }, /** - * [description] + * Sets the horizontal and vertical acceleration of this body. * * @method Phaser.Physics.Impact.Components.Acceleration#setAcceleration * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The amount of horizontal acceleration to apply. + * @param {number} y - The amount of vertical acceleration to apply. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setAcceleration: function (x, y) { @@ -122952,7 +123819,8 @@ module.exports = Velocity; */ /** - * [description] + * Provides methods for setting the size of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. * * @name Phaser.Physics.Arcade.Components.Size * @since 3.0.0 @@ -122960,13 +123828,14 @@ module.exports = Velocity; var Size = { /** - * [description] + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. * * @method Phaser.Physics.Arcade.Components.Size#setOffset * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The amount to offset the body from the parent Game Object along the x-axis. + * @param {number} [y=x] - The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. * * @return {this} This Game Object. */ @@ -122978,14 +123847,15 @@ var Size = { }, /** - * [description] + * Sets the size of this physics body. Setting the size does not adjust the dimensions + * of the parent Game Object. * * @method Phaser.Physics.Arcade.Components.Size#setSize * @since 3.0.0 * - * @param {number} width - [description] - * @param {number} height - [description] - * @param {boolean} [center=true] - [description] + * @param {number} width - The new width of the physics body, in pixels. + * @param {number} height - The new height of the physics body, in pixels. + * @param {boolean} [center=true] - Should the body be re-positioned so its center aligns with the parent Game Object? * * @return {this} This Game Object. */ @@ -122997,14 +123867,14 @@ var Size = { }, /** - * [description] + * Sets this physics body to use a circle for collision instead of a rectangle. * * @method Phaser.Physics.Arcade.Components.Size#setCircle * @since 3.0.0 * - * @param {number} radius - [description] - * @param {number} [offsetX] - [description] - * @param {number} [offsetY] - [description] + * @param {number} radius - The radius of the physics body, in pixels. + * @param {number} [offsetX] - The amount to offset the body from the parent Game Object along the x-axis. + * @param {number} [offsetY] - The amount to offset the body from the parent Game Object along the y-axis. * * @return {this} This Game Object. */ @@ -123113,7 +123983,8 @@ module.exports = Immovable; */ /** - * [description] + * Provides methods for setting the gravity properties of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. * * @name Phaser.Physics.Arcade.Components.Gravity * @since 3.0.0 @@ -123121,13 +123992,15 @@ module.exports = Immovable; var Gravity = { /** - * [description] + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The gravitational force to be applied to the X-axis. + * @param {number} [y=x] - The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. * * @return {this} This Game Object. */ @@ -123139,12 +124012,12 @@ var Gravity = { }, /** - * [description] + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravityX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The gravitational force to be applied to the X-axis. * * @return {this} This Game Object. */ @@ -123156,12 +124029,12 @@ var Gravity = { }, /** - * [description] + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravityY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} y - The gravitational force to be applied to the Y-axis. * * @return {this} This Game Object. */ @@ -123188,7 +124061,7 @@ module.exports = Gravity; */ /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. The higher than friction, the faster the body will slow down once force stops being applied to it. * * @name Phaser.Physics.Arcade.Components.Friction * @since 3.0.0 @@ -123196,13 +124069,14 @@ module.exports = Gravity; var Friction = { /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. * * @method Phaser.Physics.Arcade.Components.Friction#setFriction * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The amount of horizontal friction to apply. + * @param {number} [y=x] - The amount of vertical friction to apply. * * @return {this} This Game Object. */ @@ -123214,12 +124088,13 @@ var Friction = { }, /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. * * @method Phaser.Physics.Arcade.Components.Friction#setFrictionX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The amount of friction to apply. * * @return {this} This Game Object. */ @@ -123231,12 +124106,13 @@ var Friction = { }, /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. * * @method Phaser.Physics.Arcade.Components.Friction#setFrictionY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} x - The amount of friction to apply. * * @return {this} This Game Object. */ @@ -123271,18 +124147,25 @@ module.exports = Friction; var Enable = { /** - * [description] + * Enables this Game Object's Body. * * @method Phaser.Physics.Arcade.Components.Enable#enableBody * @since 3.0.0 * - * @param {boolean} reset - [description] - * @param {number} x - [description] - * @param {number} y - [description] - * @param {boolean} enableGameObject - [description] - * @param {boolean} showGameObject - [description] + * @param {boolean} reset - Also reset the Body and place it at (x, y). + * @param {number} x - The horizontal position to place the Game Object and Body. + * @param {number} y - The horizontal position to place the Game Object and Body. + * @param {boolean} enableGameObject - Also activate this Game Object. + * @param {boolean} showGameObject - Also show this Game Object. * * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.Body#enable + * @see Phaser.Physics.Arcade.StaticBody#enable + * @see Phaser.Physics.Arcade.Body#reset + * @see Phaser.Physics.Arcade.StaticBody#reset + * @see Phaser.GameObjects.GameObject#active + * @see Phaser.GameObjects.GameObject#visible */ enableBody: function (reset, x, y, enableGameObject, showGameObject) { @@ -123307,15 +124190,20 @@ var Enable = { }, /** - * [description] + * Stops and disables this Game Object's Body. * * @method Phaser.Physics.Arcade.Components.Enable#disableBody * @since 3.0.0 * - * @param {boolean} [disableGameObject=false] - [description] - * @param {boolean} [hideGameObject=false] - [description] + * @param {boolean} [disableGameObject=false] - Also deactivate this Game Object. + * @param {boolean} [hideGameObject=false] - Also hide this Game Object. * * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.Body#enable + * @see Phaser.Physics.Arcade.StaticBody#enable + * @see Phaser.GameObjects.GameObject#active + * @see Phaser.GameObjects.GameObject#visible */ disableBody: function (disableGameObject, hideGameObject) { @@ -123340,7 +124228,7 @@ var Enable = { }, /** - * Syncs the Bodies position and size with its parent Game Object. + * Syncs the Body's position and size with its parent Game Object. * You don't need to call this for Dynamic Bodies, as it happens automatically. * But for Static bodies it's a useful way of modifying the position of a Static Body * in the Physics World, based on its Game Object. @@ -123349,6 +124237,8 @@ var Enable = { * @since 3.1.0 * * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject */ refreshBody: function () { @@ -123755,7 +124645,7 @@ module.exports = Angular; */ /** - * [description] + * Provides methods used for setting the acceleration properties of an Arcade Body. * * @name Phaser.Physics.Arcade.Components.Acceleration * @since 3.0.0 @@ -123763,7 +124653,7 @@ module.exports = Angular; var Acceleration = { /** - * [description] + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. * * @method Phaser.Physics.Arcade.Components.Acceleration#setAcceleration * @since 3.0.0 @@ -123781,7 +124671,7 @@ var Acceleration = { }, /** - * [description] + * Sets the body's horizontal acceleration. * * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationX * @since 3.0.0 @@ -123798,7 +124688,7 @@ var Acceleration = { }, /** - * [description] + * Sets the body's vertical acceleration. * * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationY * @since 3.0.0 @@ -123831,7 +124721,7 @@ module.exports = Acceleration; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(36); -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); var DistanceSquared = __webpack_require__(278); var Factory = __webpack_require__(267); var GetFastValue = __webpack_require__(1); @@ -123840,18 +124730,19 @@ var PluginCache = __webpack_require__(15); var Vector2 = __webpack_require__(3); var World = __webpack_require__(262); -// All methods in this class are available under `this.physics` in a Scene. - /** * @classdesc - * [description] + * The Arcade Physics Plugin belongs to a Scene and sets up and manages the Scene's physics simulation. + * It also holds some useful methods for moving and rotating Arcade Physics Bodies. + * + * You can access it from within a Scene using `this.physics`. * * @class ArcadePhysics * @memberOf Phaser.Physics.Arcade * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene that this Plugin belongs to. */ var ArcadePhysics = new Class({ @@ -123860,7 +124751,7 @@ var ArcadePhysics = new Class({ function ArcadePhysics (scene) { /** - * [description] + * The Scene that this Plugin belongs to. * * @name Phaser.Physics.Arcade.ArcadePhysics#scene * @type {Phaser.Scene} @@ -123869,7 +124760,7 @@ var ArcadePhysics = new Class({ this.scene = scene; /** - * [description] + * The Scene's Systems. * * @name Phaser.Physics.Arcade.ArcadePhysics#systems * @type {Phaser.Scenes.Systems} @@ -123878,7 +124769,7 @@ var ArcadePhysics = new Class({ this.systems = scene.sys; /** - * [description] + * A configuration object. Union of the `physics.arcade.*` properties of the GameConfig and SceneConfig objects. * * @name Phaser.Physics.Arcade.ArcadePhysics#config * @type {object} @@ -123887,7 +124778,7 @@ var ArcadePhysics = new Class({ this.config = this.getConfig(); /** - * [description] + * The physics simulation. * * @name Phaser.Physics.Arcade.ArcadePhysics#world * @type {Phaser.Physics.Arcade.World} @@ -123896,7 +124787,7 @@ var ArcadePhysics = new Class({ this.world; /** - * [description] + * An object holding the Arcade Physics factory methods. * * @name Phaser.Physics.Arcade.ArcadePhysics#add * @type {Phaser.Physics.Arcade.Factory} @@ -123949,12 +124840,12 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Creates the physics configuration for the current Scene. * * @method Phaser.Physics.Arcade.ArcadePhysics#getConfig * @since 3.0.0 * - * @return {object} [description] + * @return {object} The physics configuration. */ getConfig: function () { @@ -123970,31 +124861,20 @@ var ArcadePhysics = new Class({ }, /** - * Checks for overlaps between two Game Objects. The objects can be any Game Object that have an Arcade Physics Body. - * - * Unlike {@link #collide} the objects are NOT automatically separated or have any physics applied, they merely test for overlap results. - * - * Both the first and second parameter can be arrays of objects, of differing types. - * If two arrays are passed, the contents of the first parameter will be tested against all contents of the 2nd parameter. - * - * ##### Tilemaps - * - * Any overlapping tiles, including blank/null tiles, will give a positive result. Tiles marked via {@link Phaser.Tilemap#setCollision} (and similar methods) have no special status, and callbacks added via {@link Phaser.Tilemap#setTileIndexCallback} or {@link Phaser.Tilemap#setTileLocationCallback} are not invoked. So calling this method without any callbacks isn't very useful. - * - * If you're interested only in whether an object overlaps a certain tile or class of tiles, filter the tiles with `processCallback` and then use the result returned by this method. Blank/null tiles can be excluded by their {@link Phaser.Tile#index index} (-1). - * - * If you want to take action on certain overlaps, examine the tiles in `collideCallback` and then handle as you like. + * Tests if Game Objects overlap. See {@link Phaser.Physics.Arcade.World#overlap} * * @method Phaser.Physics.Arcade.ArcadePhysics#overlap * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {ArcadePhysicsCallback} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter. - * @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * - * @return {boolean} True if an overlap occurred otherwise false. + * @return {boolean} True if at least one Game Object overlaps another. + * + * @see Phaser.Physics.Arcade.World#overlap */ overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) { @@ -124006,18 +124886,20 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Tests if Game Objects overlap and separates them (if possible). See {@link Phaser.Physics.Arcade.World#collide}. * * @method Phaser.Physics.Arcade.ArcadePhysics#collide * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {ArcadePhysicsCallback} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter. - * @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * - * @return {boolean} True if a collision occurred otherwise false. + * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. + * + * @see Phaser.Physics.Arcade.World#collide */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -124029,12 +124911,12 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Pauses the simulation. * * @method Phaser.Physics.Arcade.ArcadePhysics#pause * @since 3.0.0 * - * @return {Phaser.Physics.Arcade.World} [description] + * @return {Phaser.Physics.Arcade.World} The simulation. */ pause: function () { @@ -124042,12 +124924,12 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Resumes the simulation (if paused). * * @method Phaser.Physics.Arcade.ArcadePhysics#resume * @since 3.0.0 * - * @return {Phaser.Physics.Arcade.World} [description] + * @return {Phaser.Physics.Arcade.World} The simulation. */ resume: function () { @@ -124293,6 +125175,12 @@ var ArcadePhysics = new Class({ */ shutdown: function () { + if (!this.world) + { + // Already destroyed + return; + } + var eventEmitter = this.systems.events; eventEmitter.off('update', this.world.update, this.world); @@ -124580,9 +125468,9 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#equals * @since 3.0.0 * - * @param {Phaser.Math.Vector4} v - [description] + * @param {Phaser.Math.Vector4} v - The vector to check equality with. * - * @return {boolean} [description] + * @return {boolean} A boolean indicating whether the two Vectors are equal or not. */ equals: function (v) { @@ -124844,7 +125732,7 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#distance * @since 3.0.0 * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. * * @return {number} The distance from this Vector to the given Vector. */ @@ -126067,7 +126955,7 @@ module.exports = DistancePower; module.exports = { - Between: __webpack_require__(57), + Between: __webpack_require__(58), Power: __webpack_require__(627), Squared: __webpack_require__(278) @@ -126443,7 +127331,7 @@ var PhaserMath = { SmoothStep: __webpack_require__(200), TransformXY: __webpack_require__(362), Within: __webpack_require__(598), - Wrap: __webpack_require__(58), + Wrap: __webpack_require__(59), // Vector classes Vector2: __webpack_require__(3), @@ -127298,6 +128186,12 @@ var LoaderPlugin = new Class({ */ nextFile: function (file, success) { + // Has the game been destroyed during load? If so, bail out now. + if (!this.inflight) + { + return; + } + this.inflight.delete(file); this.updateProgress(); @@ -127338,6 +128232,12 @@ var LoaderPlugin = new Class({ */ fileProcessComplete: function (file) { + // Has the game been destroyed during load? If so, bail out now. + if (!this.scene || !this.systems || !this.systems.game || this.systems.game.pendingDestroy) + { + return; + } + // This file has failed, so move it to the failed Set if (file.state === CONST.FILE_ERRORED) { @@ -127821,8 +128721,8 @@ module.exports = UnityAtlasFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(55); -var TILEMAP_FORMATS = __webpack_require__(29); +var JSONFile = __webpack_require__(56); +var TILEMAP_FORMATS = __webpack_require__(30); /** * @typedef {object} Phaser.Loader.FileTypes.TilemapJSONFileConfig @@ -127986,8 +128886,8 @@ module.exports = TilemapJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(55); -var TILEMAP_FORMATS = __webpack_require__(29); +var JSONFile = __webpack_require__(56); +var TILEMAP_FORMATS = __webpack_require__(30); /** * @typedef {object} Phaser.Loader.FileTypes.TilemapImpactFileConfig @@ -128155,7 +129055,7 @@ var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(8); -var TILEMAP_FORMATS = __webpack_require__(29); +var TILEMAP_FORMATS = __webpack_require__(30); /** * @typedef {object} Phaser.Loader.FileTypes.TilemapCSVFileConfig @@ -129528,7 +130428,7 @@ module.exports = PluginFile; var Class = __webpack_require__(0); var CONST = __webpack_require__(20); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(55); +var JSONFile = __webpack_require__(56); /** * @typedef {object} Phaser.Loader.FileTypes.PackFileConfig @@ -129758,7 +130658,7 @@ var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(1); var ImageFile = __webpack_require__(65); var IsPlainObject = __webpack_require__(8); -var JSONFile = __webpack_require__(55); +var JSONFile = __webpack_require__(56); var MultiFile = __webpack_require__(64); /** @@ -131180,7 +132080,7 @@ var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(1); var IsPlainObject = __webpack_require__(8); -var JSONFile = __webpack_require__(55); +var JSONFile = __webpack_require__(56); var MultiFile = __webpack_require__(64); /** @@ -131736,7 +132636,7 @@ var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(1); var ImageFile = __webpack_require__(65); var IsPlainObject = __webpack_require__(8); -var JSONFile = __webpack_require__(55); +var JSONFile = __webpack_require__(56); var MultiFile = __webpack_require__(64); /** @@ -131995,7 +132895,7 @@ module.exports = AtlasJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(55); +var JSONFile = __webpack_require__(56); /** * @classdesc @@ -132213,7 +133113,7 @@ module.exports = { HTMLFile: __webpack_require__(651), HTMLTextureFile: __webpack_require__(650), ImageFile: __webpack_require__(65), - JSONFile: __webpack_require__(55), + JSONFile: __webpack_require__(56), MultiAtlasFile: __webpack_require__(649), PackFile: __webpack_require__(648), PluginFile: __webpack_require__(647), @@ -133472,11 +134372,11 @@ module.exports = CreatePixelPerfectHandler; */ var Circle = __webpack_require__(81); -var CircleContains = __webpack_require__(43); +var CircleContains = __webpack_require__(44); var Class = __webpack_require__(0); var CreateInteractiveObject = __webpack_require__(289); var CreatePixelPerfectHandler = __webpack_require__(675); -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); var Ellipse = __webpack_require__(99); var EllipseContains = __webpack_require__(98); var EventEmitter = __webpack_require__(11); @@ -133485,7 +134385,7 @@ var InputPluginCache = __webpack_require__(116); var IsPlainObject = __webpack_require__(8); var PluginCache = __webpack_require__(15); var Rectangle = __webpack_require__(10); -var RectangleContains = __webpack_require__(42); +var RectangleContains = __webpack_require__(43); var Triangle = __webpack_require__(66); var TriangleContains = __webpack_require__(76); @@ -136915,7 +137815,7 @@ var Length = __webpack_require__(71); // The 2D area of a triangle. The area value is always non-negative. /** - * [description] + * Gets the length of the perimeter of the given triangle. * * @function Phaser.Geom.Triangle.Perimeter * @since 3.0.0 @@ -136947,15 +137847,15 @@ module.exports = Perimeter; */ /** - * [description] + * Returns true if two triangles have the same coordinates. * * @function Phaser.Geom.Triangle.Equals * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Triangle} toCompare - [description] + * @param {Phaser.Geom.Triangle} triangle - The first triangle to check. + * @param {Phaser.Geom.Triangle} toCompare - The second triangle to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the two given triangles have the exact same coordinates, otherwise `false`. */ var Equals = function (triangle, toCompare) { @@ -137245,19 +138145,19 @@ var Offset = __webpack_require__(291); */ /** - * [description] + * Positions the Triangle so that it is centered on the given coordinates. * * @function Phaser.Geom.Triangle.CenterOn * @since 3.0.0 * * @generic {Phaser.Geom.Triangle} O - [triangle,$return] * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {number} x - [description] - * @param {number} y - [description] - * @param {CenterFunction} [centerFunc] - [description] + * @param {Phaser.Geom.Triangle} triangle - The triangle to be positioned. + * @param {number} x - The horizontal coordinate to center on. + * @param {number} y - The vertical coordinate to center on. + * @param {CenterFunction} [centerFunc] - The function used to center the triangle. Defaults to Centroid centering. * - * @return {Phaser.Geom.Triangle} [description] + * @return {Phaser.Geom.Triangle} The Triangle that was centered. */ var CenterOn = function (triangle, x, y, centerFunc) { @@ -137293,17 +138193,17 @@ var Triangle = __webpack_require__(66); // w/h can be positive or negative and represent the length of each side /** - * [description] + * Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles. * * @function Phaser.Geom.Triangle.BuildRight * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} x - The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle. + * @param {number} y - The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle. + * @param {number} width - The length of the side which is to the left or to the right of the right angle. + * @param {number} height - The length of the side which is above or below the right angle. * - * @return {Phaser.Geom.Triangle} [description] + * @return {Phaser.Geom.Triangle} The constructed right Triangle. */ var BuildRight = function (x, y, width, height) { @@ -137412,24 +138312,18 @@ module.exports = BuildFromPolygon; var Triangle = __webpack_require__(66); -// Builds an equilateral triangle. -// In the equilateral triangle, all the sides are the same length (congruent) -// and all the angles are the same size (congruent). - -// The x/y specifies the top-middle of the triangle (x1/y1) and length -// is the length of each side - /** - * [description] + * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). + * The x/y specifies the top-middle of the triangle (x1/y1) and length is the length of each side. * * @function Phaser.Geom.Triangle.BuildEquilateral * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} length - [description] + * @param {number} x - x coordinate of the top point of the triangle. + * @param {number} y - y coordinate of the top point of the triangle. + * @param {number} length - Length of each side of the triangle. * - * @return {Phaser.Geom.Triangle} [description] + * @return {Phaser.Geom.Triangle} The Triangle object of the given size. */ var BuildEquilateral = function (x, y, length) { @@ -137741,17 +138635,17 @@ module.exports = Overlaps; */ /** - * [description] + * Nudges (translates) the top-left corner of a Rectangle by the coordinates of a point (translation vector). * * @function Phaser.Geom.Rectangle.OffsetPoint * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point} point - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * @param {(Phaser.Geom.Point|Phaser.Math.Vector2)} point - The point whose coordinates should be used as an offset. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var OffsetPoint = function (rect, point) { @@ -137775,18 +138669,18 @@ module.exports = OffsetPoint; */ /** - * [description] + * Nudges (translates) the top left corner of a Rectangle by a given offset. * * @function Phaser.Geom.Rectangle.Offset * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * @param {number} x - The distance to move the Rectangle horizontally. + * @param {number} y - The distance to move the Rectangle vertically. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var Offset = function (rect, x, y) { @@ -137810,18 +138704,18 @@ module.exports = Offset; */ /** - * [description] + * Merges a Rectangle with a point by repositioning and/or resizing it so that the point is on or within its bounds. * * @function Phaser.Geom.Rectangle.MergeXY * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [target,$return] * - * @param {Phaser.Geom.Rectangle} target - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged and modified. + * @param {number} x - The X coordinate of the point which should be merged. + * @param {number} y - The Y coordinate of the point which should be merged. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The modified `target` Rectangle. */ var MergeXY = function (target, x, y) { @@ -137857,17 +138751,18 @@ module.exports = MergeXY; // Neither rect should have negative widths or heights /** - * [description] + * Merges the source rectangle into the target rectangle and returns the target. + * Neither rectangle should have a negative width or height. * * @function Phaser.Geom.Rectangle.MergeRect * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [target,$return] * - * @param {Phaser.Geom.Rectangle} target - [description] - * @param {Phaser.Geom.Rectangle} source - [description] + * @param {Phaser.Geom.Rectangle} target - Target rectangle. Will be modified to include source rectangle. + * @param {Phaser.Geom.Rectangle} source - Rectangle that will be merged into target rectangle. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} Modified target rectangle that contains source rectangle. */ var MergeRect = function (target, source) { @@ -137899,21 +138794,18 @@ module.exports = MergeRect; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// Merges the target Rectangle with a list of points. -// The points is an array of objects with public x/y properties. - /** - * [description] + * Merges a Rectangle with a list of points by repositioning and/or resizing it such that all points are located on or within its bounds. * * @function Phaser.Geom.Rectangle.MergePoints * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [target,$return] * - * @param {Phaser.Geom.Rectangle} target - [description] - * @param {Phaser.Geom.Point[]} points - [description] + * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged. + * @param {Phaser.Geom.Point[]} points - An array of Points (or any object with public `x` and `y` properties) which should be merged with the Rectangle. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The modified Rectangle. */ var MergePoints = function (target, points) { @@ -138088,20 +138980,18 @@ module.exports = GetSize; var Point = __webpack_require__(6); -// The center of the Rectangle object, expressed as a Point object - /** - * [description] + * Returns the center of a Rectangle as a Point. * * @function Phaser.Geom.Rectangle.GetCenter * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {(Phaser.Geom.Point|object)} [out] - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the center of. + * @param {(Phaser.Geom.Point|object)} [out] - Optional point-like object to update with the center coordinates. * - * @return {(Phaser.Geom.Point|object)} [description] + * @return {(Phaser.Geom.Point|object)} The modified `out` object, or a new Point if none was provided. */ var GetCenter = function (rect, out) { @@ -138127,16 +139017,16 @@ module.exports = GetCenter; */ /** - * [description] + * Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension. * * @function Phaser.Geom.Rectangle.FloorAll * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var FloorAll = function (rect) { @@ -138365,18 +139255,18 @@ module.exports = CopyFrom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(42); +var Contains = __webpack_require__(43); /** - * [description] + * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. * * @function Phaser.Geom.Rectangle.ContainsPoint * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point} point - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle object. + * @param {Phaser.Geom.Point} point - The point object to be checked. Can be a Phaser Point object or any object with x and y values. * - * @return {boolean} [description] + * @return {boolean} A value of true if the Rectangle object contains the specified point, otherwise false. */ var ContainsPoint = function (rect, point) { @@ -138399,14 +139289,14 @@ module.exports = ContainsPoint; var Rectangle = __webpack_require__(10); /** - * [description] + * Creates a new Rectangle which is identical to the given one. * * @function Phaser.Geom.Rectangle.Clone * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} source - [description] + * @param {Phaser.Geom.Rectangle} source - The Rectangle to clone. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The newly created Rectangle, which is separate from the given one. */ var Clone = function (source) { @@ -138462,16 +139352,16 @@ module.exports = CeilAll; */ /** - * [description] + * Rounds a Rectangle's position up to the smallest integer greater than or equal to each current coordinate. * * @function Phaser.Geom.Rectangle.Ceil * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var Ceil = function (rect) { @@ -138557,17 +139447,19 @@ module.exports = Reverse; // Export the points as an array of flat numbers, following the sequence [ x,y, x,y, x,y ] /** - * [description] + * Stores all of the points of a Polygon into a flat array of numbers following the sequence [ x,y, x,y, x,y ], + * i.e. each point of the Polygon, in the order it's defined, corresponds to two elements of the resultant + * array for the point's X and Y coordinate. * * @function Phaser.Geom.Polygon.GetNumberArray * @since 3.0.0 * * @generic {number[]} O - [output,$return] * - * @param {Phaser.Geom.Polygon} polygon - [description] - * @param {(array|number[])} [output] - [description] + * @param {Phaser.Geom.Polygon} polygon - The Polygon whose points to export. + * @param {(array|number[])} [output] - An array to which the points' coordinates should be appended. * - * @return {(array|number[])} [description] + * @return {(array|number[])} The modified `output` array, or a new array if none was given. */ var GetNumberArray = function (polygon, output) { @@ -138851,16 +139743,16 @@ module.exports = Negative; */ /** - * [description] + * Swaps the X and the Y coordinate of a point. * * @function Phaser.Geom.Point.Invert * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [point,$return] * - * @param {Phaser.Geom.Point} point - [description] + * @param {Phaser.Geom.Point} point - The Point to modify. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} The modified `point`. */ var Invert = function (point) { @@ -138883,7 +139775,7 @@ module.exports = Invert; var Point = __webpack_require__(6); /** - * [description] + * Interpolate two given Point objects, based on `t` value. Return result either as new Point if `out` parameter is omitted or load result into Point passed as `out` parameter and return it. For `out` parameter you can also use any object with public x/y properties. * * @function Phaser.Geom.Point.Interpolate * @since 3.0.0 @@ -139085,15 +139977,15 @@ module.exports = Floor; */ /** - * [description] + * A comparison of two `Point` objects to see if they are equal. * * @function Phaser.Geom.Point.Equals * @since 3.0.0 * - * @param {Phaser.Geom.Point} point - [description] - * @param {Phaser.Geom.Point} toCompare - [description] + * @param {Phaser.Geom.Point} point - The original `Point` to compare against. + * @param {Phaser.Geom.Point} toCompare - The second `Point` to compare. * - * @return {boolean} [description] + * @return {boolean} Returns true if the both `Point` objects are equal. */ var Equals = function (point, toCompare) { @@ -139541,7 +140433,7 @@ var Angle = __webpack_require__(75); * @function Phaser.Geom.Line.NormalX * @since 3.0.0 * - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Line} line - The Line object to get the normal value from. * * @return {number} [description] */ @@ -139941,15 +140833,17 @@ var Contains = __webpack_require__(76); var LineToLine = __webpack_require__(117); /** - * [description] + * Checks if a Triangle and a Line intersect. + * + * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * * @function Phaser.Geom.Intersects.TriangleToLine * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check with. + * @param {Phaser.Geom.Line} line - The Line to check with. * - * @return {boolean} [description] + * @return {boolean} `true` if the Triangle and the Line intersect, otherwise `false`. */ var TriangleToLine = function (triangle, line) { @@ -140095,20 +140989,20 @@ module.exports = RectangleToValues; */ var LineToLine = __webpack_require__(117); -var Contains = __webpack_require__(42); +var Contains = __webpack_require__(43); var ContainsArray = __webpack_require__(162); var Decompose = __webpack_require__(299); /** - * [description] + * Checks for intersection between Rectangle shape and Triangle shape. * * @function Phaser.Geom.Intersects.RectangleToTriangle * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Triangle} triangle - [description] + * @param {Phaser.Geom.Rectangle} rect - Rectangle object to test. + * @param {Phaser.Geom.Triangle} triangle - Triangle object to test. * - * @return {boolean} [description] + * @return {boolean} A value of `true` if objects intersect; otherwise `false`. */ var RectangleToTriangle = function (rect, triangle) { @@ -140333,18 +141227,22 @@ var Rectangle = __webpack_require__(10); var RectangleToRectangle = __webpack_require__(163); /** - * [description] + * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. + * + * If optional `output` parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero). + * + * If Rectangle object is passed as `output` and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersetion, it will be returned without any change. * * @function Phaser.Geom.Intersects.GetRectangleIntersection * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [output,$return] * - * @param {Phaser.Geom.Rectangle} rectA - [description] - * @param {Phaser.Geom.Rectangle} rectB - [description] - * @param {Phaser.Geom.Rectangle} [output] - [description] + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle object. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle object. + * @param {Phaser.Geom.Rectangle} [output] - Optional Rectangle object. If given, the intersection data will be loaded into it (in case of no intersection, it will be left unchanged). Otherwise, new Rectangle object will be created and returned with either intersection data or empty (all values set to zero), if there is no intersection. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} A rectangle object with intersection data. */ var GetRectangleIntersection = function (rectA, rectB, output) { @@ -140428,18 +141326,18 @@ module.exports = CircleToRectangle; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); /** - * [description] + * Checks if two Circles intersect. * * @function Phaser.Geom.Intersects.CircleToCircle * @since 3.0.0 * - * @param {Phaser.Geom.Circle} circleA - [description] - * @param {Phaser.Geom.Circle} circleB - [description] + * @param {Phaser.Geom.Circle} circleA - The first Circle to check for intersection. + * @param {Phaser.Geom.Circle} circleB - The second Circle to check for intersection. * - * @return {boolean} [description] + * @return {boolean} `true` if the two Circles intersect, otherwise `false`. */ var CircleToCircle = function (circleA, circleB) { @@ -140972,7 +141870,7 @@ module.exports = CopyFrom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(43); +var Contains = __webpack_require__(44); /** * Check to see if the Circle contains all four points of the given Rectangle object. @@ -141008,7 +141906,7 @@ module.exports = ContainsRect; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(43); +var Contains = __webpack_require__(44); /** * Check to see if the Circle contains the given Point object. @@ -141103,7 +142001,7 @@ Circle.Area = __webpack_require__(788); Circle.Circumference = __webpack_require__(439); Circle.CircumferencePoint = __webpack_require__(212); Circle.Clone = __webpack_require__(787); -Circle.Contains = __webpack_require__(43); +Circle.Contains = __webpack_require__(44); Circle.ContainsPoint = __webpack_require__(786); Circle.ContainsRect = __webpack_require__(785); Circle.CopyFrom = __webpack_require__(784); @@ -141243,7 +142141,7 @@ module.exports = LightsPlugin; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); var Quad = __webpack_require__(164); @@ -141293,7 +142191,7 @@ GameObjectCreator.register('quad', function (config, addToScene) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); var GetValue = __webpack_require__(4); @@ -141661,7 +142559,7 @@ GameObjectCreator.register('zone', function (config) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); var TileSprite = __webpack_require__(167); @@ -141727,7 +142625,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); var Text = __webpack_require__(168); @@ -141815,7 +142713,7 @@ GameObjectCreator.register('text', function (config, addToScene) */ var BitmapText = __webpack_require__(119); -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); var GetValue = __webpack_require__(4); @@ -141867,11 +142765,11 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var BuildGameObjectAnimation = __webpack_require__(340); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); -var Sprite = __webpack_require__(56); +var Sprite = __webpack_require__(57); /** * @typedef {object} SpriteConfig @@ -141928,7 +142826,7 @@ GameObjectCreator.register('sprite', function (config, addToScene) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); var RenderTexture = __webpack_require__(169); @@ -142044,7 +142942,7 @@ GameObjectCreator.register('particles', function (config, addToScene) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); var Image = __webpack_require__(78); @@ -142176,7 +143074,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) */ var BitmapText = __webpack_require__(174); -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); @@ -142236,7 +143134,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var Container = __webpack_require__(175); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); @@ -142285,7 +143183,7 @@ GameObjectCreator.register('container', function (config, addToScene) */ var Blitter = __webpack_require__(176); -var BuildGameObject = __webpack_require__(31); +var BuildGameObject = __webpack_require__(32); var GameObjectCreator = __webpack_require__(14); var GetAdvancedValue = __webpack_require__(13); @@ -143136,7 +144034,7 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align */ var GameObjectFactory = __webpack_require__(5); -var Sprite = __webpack_require__(56); +var Sprite = __webpack_require__(57); /** * Creates a new Sprite Game Object and adds it to the Scene. @@ -146786,20 +147684,27 @@ var TextStyle = new Class({ */ setFont: function (font) { - if (typeof font === 'string') + var fontFamily = font; + var fontSize = ''; + var fontStyle = ''; + + if (typeof font !== 'string') { - this.fontFamily = font; - this.fontSize = ''; - this.fontStyle = ''; - } - else - { - this.fontFamily = GetValue(font, 'fontFamily', 'Courier'); - this.fontSize = GetValue(font, 'fontSize', '16px'); - this.fontStyle = GetValue(font, 'fontStyle', ''); + fontFamily = GetValue(font, 'fontFamily', 'Courier'); + fontSize = GetValue(font, 'fontSize', '16px'); + fontStyle = GetValue(font, 'fontStyle', ''); } - return this.update(true); + if (fontFamily !== this.fontFamily || fontSize !== this.fontSize || fontStyle !== this.fontStyle) + { + this.fontFamily = fontFamily; + this.fontSize = fontSize; + this.fontStyle = fontStyle; + + this.update(true); + } + + return this.parent; }, /** @@ -146814,9 +147719,14 @@ var TextStyle = new Class({ */ setFontFamily: function (family) { - this.fontFamily = family; + if (this.fontFamily !== family) + { + this.fontFamily = family; - return this.update(true); + this.update(true); + } + + return this.parent; }, /** @@ -146831,9 +147741,14 @@ var TextStyle = new Class({ */ setFontStyle: function (style) { - this.fontStyle = style; + if (this.fontStyle !== style) + { + this.fontStyle = style; - return this.update(true); + this.update(true); + } + + return this.parent; }, /** @@ -146853,9 +147768,14 @@ var TextStyle = new Class({ size = size.toString() + 'px'; } - this.fontSize = size; + if (this.fontSize !== size) + { + this.fontSize = size; - return this.update(true); + this.update(true); + } + + return this.parent; }, /** @@ -146993,24 +147913,31 @@ var TextStyle = new Class({ */ setStroke: function (color, thickness) { - if (color === undefined) + if (thickness === undefined) { thickness = this.strokeThickness; } + + if (color === undefined && this.strokeThickness !== 0) { // Reset the stroke to zero (disabling it) this.strokeThickness = 0; - } - else - { - if (thickness === undefined) { thickness = this.strokeThickness; } + this.update(true); + } + else if (this.stroke !== color || this.strokeThickness !== thickness) + { this.stroke = color; this.strokeThickness = thickness; + + this.update(true); } - return this.update(true); + return this.parent; }, /** * Set the shadow settings. + * + * Calling this method always re-measures the parent Text object, + * so only call it when you actually change the shadow settings. * * @method Phaser.GameObjects.Text.TextStyle#setShadow * @since 3.0.0 @@ -148238,7 +149165,7 @@ var Class = __webpack_require__(0); var FloatBetween = __webpack_require__(328); var GetEaseFunction = __webpack_require__(95); var GetFastValue = __webpack_require__(1); -var Wrap = __webpack_require__(58); +var Wrap = __webpack_require__(59); /** * The returned value sets what the property will be at the START of the particle's life, on emit. @@ -151909,14 +152836,14 @@ var UpdateList = new Class({ while (i--) { - this.this._pendingRemoval[i].destroy(true); + this._pendingRemoval[i].destroy(true); } i = this._pendingInsertion.length; while (i--) { - this.this._pendingInsertion[i].destroy(true); + this._pendingInsertion[i].destroy(true); } this._list.length = 0; @@ -153260,14 +154187,14 @@ module.exports = ReverseRows; */ /** - * [description] + * Reverses the columns in the given Array Matrix. * * @function Phaser.Utils.Array.Matrix.ReverseColumns * @since 3.0.0 * - * @param {array} matrix - [description] + * @param {array} matrix - The array matrix to reverse the columns for. * - * @return {array} [description] + * @return {array} The column reversed matrix. */ var ReverseColumns = function (matrix) { @@ -153299,14 +154226,14 @@ var CheckMatrix = __webpack_require__(178); // Array Matrix. /** - * [description] + * Generates a string (which you can pass to console.log) from the given Array Matrix. * * @function Phaser.Utils.Array.Matrix.MatrixToString * @since 3.0.0 * - * @param {array} matrix - [description] + * @param {array} matrix - A 2-dimensional array. * - * @return {string} [description] + * @return {string} A string representing the matrix. */ var MatrixToString = function (matrix) { @@ -153657,7 +154584,7 @@ var GameObjects = { Components: __webpack_require__(16), - BuildGameObject: __webpack_require__(31), + BuildGameObject: __webpack_require__(32), BuildGameObjectAnimation: __webpack_require__(340), GameObject: __webpack_require__(17), BitmapText: __webpack_require__(119), @@ -153671,14 +154598,14 @@ var GameObjects = { PathFollower: __webpack_require__(325), RenderTexture: __webpack_require__(169), RetroFont: __webpack_require__(880), - Sprite: __webpack_require__(56), + Sprite: __webpack_require__(57), Text: __webpack_require__(168), TileSprite: __webpack_require__(167), Zone: __webpack_require__(134), // Shapes - Shape: __webpack_require__(30), + Shape: __webpack_require__(31), Arc: __webpack_require__(322), Curve: __webpack_require__(321), Ellipse: __webpack_require__(320), @@ -155873,7 +156800,7 @@ var CanvasTexture = new Class({ /** * A reference to the Texture Source of this Canvas. * - * @name Phaser.Textures.CanvasTexturer#_source + * @name Phaser.Textures.CanvasTexture#_source * @type {Phaser.Textures.TextureSource} * @private * @since 3.7.0 @@ -155893,7 +156820,7 @@ var CanvasTexture = new Class({ /** * The 2D Canvas Rendering Context. * - * @name Phaser.Textures.CanvasTexture#canvas + * @name Phaser.Textures.CanvasTexture#context * @readOnly * @type {CanvasRenderingContext2D} * @since 3.7.0 @@ -157797,76 +158724,76 @@ var ValueToColor = __webpack_require__(197); /** * @callback BootCallback * - * @param {Phaser.Game} game - [description] + * @param {Phaser.Game} game - The game. */ /** * @typedef {object} InputConfig * - * @property {(boolean|KeyboardInputConfig)} [keyboard=true] - [description] - * @property {(boolean|MouseInputConfig)} [mouse=true] - [description] - * @property {(boolean|TouchInputConfig)} [touch=true] - [description] - * @property {(boolean|GamepadInputConfig)} [gamepad=false] - [description] - * @property {integer} [activePointers=1] - [description] + * @property {(boolean|KeyboardInputConfig)} [keyboard=true] - Keyboard input configuration. `true` uses the default configuration and `false` disables keyboard input. + * @property {(boolean|MouseInputConfig)} [mouse=true] - Mouse input configuration. `true` uses the default configuration and `false` disables mouse input. + * @property {(boolean|TouchInputConfig)} [touch=true] - Touch input configuration. `true` uses the default configuration and `false` disables touch input. + * @property {(boolean|GamepadInputConfig)} [gamepad=false] - Gamepad input configuration. `true` enables gamepad input. + * @property {integer} [activePointers=1] - The maximum number of touch pointers. See {@link Phaser.Input.InputManager#pointers}. */ /** * @typedef {object} MouseInputConfig * - * @property {*} [target=null] - [description] - * @property {boolean} [capture=true] - [description] + * @property {*} [target=null] - Where the Mouse Manager listens for mouse input events. The default is the game canvas. + * @property {boolean} [capture=true] - Whether mouse input events have preventDefault() called on them. */ /** * @typedef {object} KeyboardInputConfig * - * @property {*} [target=window] - [description] + * @property {*} [target=window] - Where the Keyboard Manager listens for keyboard input events. */ /** * @typedef {object} TouchInputConfig * - * @property {*} [target=null] - [description] - * @property {boolean} [capture=true] - [description] + * @property {*} [target=null] - Where the Touch Manager listens for touch input events. The default is the game canvas. + * @property {boolean} [capture=true] - Whether touch input events have preventDefault() called on them. */ /** * @typedef {object} GamepadInputConfig * - * @property {*} [target=window] - [description] + * @property {*} [target=window] - Where the Gamepad Manager listens for gamepad input events. */ /** * @typedef {object} BannerConfig * - * @property {boolean} [hidePhaser=false] - [description] - * @property {string} [text='#ffffff'] - [description] - * @property {string[]} [background] - [description] + * @property {boolean} [hidePhaser=false] - Omit Phaser's name and version from the banner. + * @property {string} [text='#ffffff'] - The color of the banner text. + * @property {string[]} [background] - The background colors of the banner. */ /** * @typedef {object} FPSConfig * - * @property {integer} [min=10] - [description] - * @property {integer} [target=60] - [description] - * @property {boolean} [forceSetTimeOut=false] - [description] - * @property {integer} [deltaHistory=10] - [description] + * @property {integer} [min=10] - The minimum acceptable rendering rate, in frames per second. + * @property {integer} [target=60] - The optimum rendering rate, in frames per second. + * @property {boolean} [forceSetTimeOut=false] - Use setTimeout instead of requestAnimationFrame to run the game loop. + * @property {integer} [deltaHistory=10] - Calculate the average frame delta from this many consecutive frame intervals. * @property {integer} [panicMax=120] - [description] */ /** * @typedef {object} RenderConfig * - * @property {boolean} [antialias=true] - [description] - * @property {boolean} [pixelArt=false] - [description] + * @property {boolean} [antialias=true] - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. + * @property {boolean} [pixelArt=false] - Sets `antialias` and `roundPixels` to true. This is the best setting for pixel-art games. * @property {boolean} [autoResize=true] - Automatically resize the Game Canvas if you resize the renderer. - * @property {boolean} [roundPixels=false] - [description] - * @property {boolean} [transparent=false] - [description] - * @property {boolean} [clearBeforeRender=true] - [description] - * @property {boolean} [premultipliedAlpha=true] - [description] - * @property {boolean} [preserveDrawingBuffer=false] - [description] - * @property {boolean} [failIfMajorPerformanceCaveat=false] - [description] - * @property {string} [powerPreference='default'] - "high-performance", "low-power" or "default" + * @property {boolean} [roundPixels=false] - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. + * @property {boolean} [transparent=false] - Whether the game canvas will be transparent. + * @property {boolean} [clearBeforeRender=true] - Whether the game canvas will be cleared between each rendering frame. + * @property {boolean} [premultipliedAlpha=true] - In WebGL mode, the drawing buffer contains colors with pre-multiplied alpha. + * @property {boolean} [preserveDrawingBuffer=false] - In WebGL mode, the drawing buffer won't be cleared automatically each frame. + * @property {boolean} [failIfMajorPerformanceCaveat=false] - Let the browser abort creating a WebGL context if it judges performance would be unacceptable. + * @property {string} [powerPreference='default'] - "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. * @property {integer} [batchSize=2000] - The default WebGL batch size. */ @@ -157877,8 +158804,8 @@ var ValueToColor = __webpack_require__(197); * @property {(integer|string)} [height=768] - The base height of your game. * @property {integer} [zoom=1] - The zoom value of the game canvas. * @property {number} [resolution=1] - The rendering resolution of the canvas. - * @property {any} [parent] - The parent DOM element. - * @property {integer} [mode=0] - The scale mode to apply to the canvas. + * @property {(HTMLElement|string)} [parent] - The DOM element that will contain the game canvas, or its `id`. If null (the default) or if the named element doesn't exist, the game canvas is inserted directly into the document body. + * @property {integer} [mode=0] - The scale mode to apply to the canvas. SHOW_ALL, EXACT_FIT, USER_SCALE, or RESIZE. * @property {integer} [minWidth] - The minimum width the canvas can be scaled down to. * @property {integer} [minHeight] - The minimum height the canvas can be scaled down to. * @property {integer} [maxWidth] - The maximum width the canvas can be scaled up to. @@ -157888,22 +158815,22 @@ var ValueToColor = __webpack_require__(197); /** * @typedef {object} CallbacksConfig * - * @property {BootCallback} [preBoot=NOOP] - [description] - * @property {BootCallback} [postBoot=NOOP] - [description] + * @property {BootCallback} [preBoot=NOOP] - A function to run at the start of the boot sequence. + * @property {BootCallback} [postBoot=NOOP] - A function to run at the end of the boot sequence. At this point, all the game systems have started and plugins have been loaded. */ /** * @typedef {object} LoaderConfig * - * @property {string} [baseURL] - [description] - * @property {string} [path] - [description] - * @property {integer} [maxParallelDownloads=32] - [description] - * @property {(string|undefined)} [crossOrigin=undefined] - [description] - * @property {string} [responseType] - [description] - * @property {boolean} [async=true] - [description] - * @property {string} [user] - [description] - * @property {string} [password] - [description] - * @property {integer} [timeout=0] - [description] + * @property {string} [baseURL] - An URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. + * @property {string} [path] - An URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. + * @property {integer} [maxParallelDownloads=32] - The maximum number of resources the loader will start loading at once. + * @property {(string|undefined)} [crossOrigin=undefined] - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. + * @property {string} [responseType] - The response type of the XHR request, e.g. `blob`, `text`, etc. + * @property {boolean} [async=true] - Should the XHR request use async or not? + * @property {string} [user] - Optional username for the XHR request. + * @property {string} [password] - Optional password for the XHR request. + * @property {integer} [timeout=0] - Optional XHR timeout value, in ms. */ /** @@ -157916,65 +158843,81 @@ var ValueToColor = __webpack_require__(197); /** * @typedef {object} ImagesConfig * - * @property {string} [default] - [description] - * @property {string} [missing] - [description] + * @property {string} [default] - URL to use for the 'default' texture. + * @property {string} [missing] - URL to use for the 'missing' texture. */ +/** + * @typedef {object} PhysicsConfig + * + * @property {string} [default] - The default physics system. It will be started for each scene. Phaser provides 'arcade', 'impact', and 'matter'. + * @property {ArcadeWorldConfig} [arcade] - Arcade Physics configuration. + * @property {Phaser.Physics.Impact.WorldConfig} [impact] - Impact Physics configuration. + * @property {object} [matter] - Matter Physics configuration. + */ + /** * @typedef {object} PluginObjectItem * - * @property {string} [key] - [description] - * @property {*} [plugin] - [description] - * @property {boolean} [start] - [description] - * @property {string} [systemKey] - [description] - * @property {string} [sceneKey] - [description] - * @property {*} [data] - [description] + * @property {string} [key] - A key to identify the plugin in the Plugin Manager. + * @property {*} [plugin] - The plugin itself. Usually a class/constructor. + * @property {boolean} [start] - Whether the plugin should be started automatically. + * @property {string} [systemKey] - For a scene plugin, add the plugin to the scene's systems object under this key (`this.sys.KEY`, from the scene). + * @property {string} [sceneKey] - For a scene plugin, add the plugin to the scene object under this key (`this.KEY`, from the scene). + * @property {*} [data] - Arbitrary data passed to the plugin's init() method. + * + * @example + * // Global plugin + * { key: 'BankPlugin', plugin: BankPluginV3, start: true, data: { gold: 5000 } } + * @example + * // Scene plugin + * { key: 'WireFramePlugin', plugin: WireFramePlugin, systemKey: 'wireFramePlugin', sceneKey: 'wireframe' } */ /** * @typedef {object} PluginObject * - * @property {?PluginObjectItem[]} [global] - [description] - * @property {?PluginObjectItem[]} [scene] - [description] - * @property {string[]} [default] - [description] - * @property {*} [defaultMerge] - [description] + * @property {?PluginObjectItem[]} [global] - Global plugins to install. + * @property {?PluginObjectItem[]} [scene] - Scene plugins to install. + * @property {string[]} [default] - The default set of scene plugins (names). + * @property {string[]} [defaultMerge] - Plugins to *add* to the default set of scene plugins. */ /** * @typedef {object} GameConfig * - * @property {(integer|string)} [width=1024] - [description] - * @property {(integer|string)} [height=768] - [description] - * @property {number} [zoom=1] - [description] - * @property {number} [resolution=1] - [description] - * @property {number} [type=CONST.AUTO] - [description] - * @property {*} [parent=null] - [description] + * @property {(integer|string)} [width=1024] - The width of the game, in game pixels. + * @property {(integer|string)} [height=768] - The height of the game, in game pixels. + * @property {number} [zoom=1] - Simple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc. + * @property {number} [resolution=1] - The size of each game pixel, in canvas pixels. Values larger than 1 are "high" resolution. + * @property {number} [type=CONST.AUTO] - Which renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS. + * @property {(HTMLElement|string)} [parent=null] - The DOM element that will contain the game canvas, or its `id`. If null (the default) or if the named element doesn't exist, the game canvas is inserted directly into the document body. * @property {HTMLCanvasElement} [canvas=null] - Provide your own Canvas element for Phaser to use instead of creating one. - * @property {string} [canvasStyle=null] - [description] + * @property {string} [canvasStyle=null] - CSS styles to apply to the game canvas instead of Phaser's default styles. * @property {CanvasRenderingContext2D} [context] - Provide your own Canvas Context for Phaser to use, instead of creating one. - * @property {object} [scene=null] - [description] - * @property {string[]} [seed] - [description] - * @property {string} [title=''] - [description] - * @property {string} [url='http://phaser.io'] - [description] - * @property {string} [version=''] - [description] - * @property {boolean} [autoFocus=true] - Automatically call window.focus() when the game boots. - * @property {(boolean|InputConfig)} [input] - [description] - * @property {boolean} [disableContextMenu=false] - [description] - * @property {(boolean|BannerConfig)} [banner=false] - [description] + * @property {object} [scene=null] - A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have { active: true }. + * @property {string[]} [seed] - Seed for the random number generator. + * @property {string} [title=''] - The title of the game. Shown in the browser console. + * @property {string} [url='http://phaser.io'] - The URL of the game. Shown in the browser console. + * @property {string} [version=''] - The version of the game. Shown in the browser console. + * @property {boolean} [autoFocus=true] - Automatically call window.focus() when the game boots. Usually necessary to capture input events if the game is in a separate frame. + * @property {(boolean|InputConfig)} [input] - Input configuration, or `false` to disable all game input. + * @property {boolean} [disableContextMenu=false] - Disable the browser's default 'contextmenu' event (usually triggered by a right-button mouse click). + * @property {(boolean|BannerConfig)} [banner=false] - Configuration for the banner printed in the browser console when the game starts. * @property {DOMContainerConfig} [dom] - The DOM Container configuration object. - * @property {FPSConfig} [fps] - [description] - * @property {RenderConfig} [render] - [description] - * @property {(string|number)} [backgroundColor=0x000000] - [description] - * @property {CallbacksConfig} [callbacks] - [description] - * @property {LoaderConfig} [loader] - [description] - * @property {ImagesConfig} [images] - [description] - * @property {object} [physics] - [description] - * @property {PluginObject|PluginObjectItem[]} [plugins] - [description] + * @property {FPSConfig} [fps] - Game loop configuration. + * @property {RenderConfig} [render] - Game renderer configuration. + * @property {(string|number)} [backgroundColor=0x000000] - The background color of the game canvas. The default is black. + * @property {CallbacksConfig} [callbacks] - Optional callbacks to run before or after game boot. + * @property {LoaderConfig} [loader] - Loader configuration. + * @property {ImagesConfig} [images] - Images configuration. + * @property {object} [physics] - Physics configuration. + * @property {PluginObject|PluginObjectItem[]} [plugins] - Plugins to install. */ /** * @classdesc - * [description] + * The active game configuration settings, parsed from a {@link GameConfig} object. * * @class Config * @memberOf Phaser.Boot @@ -157982,6 +158925,8 @@ var ValueToColor = __webpack_require__(197); * @since 3.0.0 * * @param {GameConfig} [GameConfig] - The configuration object for your Phaser Game instance. + * + * @see Phaser.Game#config */ var Config = new Class({ @@ -158048,7 +158993,7 @@ var Config = new Class({ } /** - * @const {number} Phaser.Boot.Config#renderType - [description] + * @const {number} Phaser.Boot.Config#renderType - Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) */ this.renderType = GetValue(config, 'type', CONST.AUTO); @@ -158080,17 +159025,17 @@ var Config = new Class({ MATH.RND.init(this.seed); /** - * @const {string} Phaser.Boot.Config#gameTitle - [description] + * @const {string} Phaser.Boot.Config#gameTitle - The title of the game. */ this.gameTitle = GetValue(config, 'title', ''); /** - * @const {string} Phaser.Boot.Config#gameURL - [description] + * @const {string} Phaser.Boot.Config#gameURL - The URL of the game. */ this.gameURL = GetValue(config, 'url', 'https://phaser.io'); /** - * @const {string} Phaser.Boot.Config#gameVersion - [description] + * @const {string} Phaser.Boot.Config#gameVersion - The version of the game. */ this.gameVersion = GetValue(config, 'version', ''); @@ -158169,7 +159114,7 @@ var Config = new Class({ this.inputGamepadEventTarget = GetValue(config, 'input.gamepad.target', window); /** - * @const {boolean} Phaser.Boot.Config#disableContextMenu - [description] + * @const {boolean} Phaser.Boot.Config#disableContextMenu - Set to `true` to disable context menu. Default value is `false`. */ this.disableContextMenu = GetValue(config, 'disableContextMenu', false); @@ -158239,7 +159184,7 @@ var Config = new Class({ this.roundPixels = GetValue(renderConfig, 'roundPixels', false); /** - * @const {boolean} Phaser.Boot.Config#pixelArt - [description] + * @const {boolean} Phaser.Boot.Config#pixelArt - Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode). */ this.pixelArt = GetValue(renderConfig, 'pixelArt', false); @@ -158339,7 +159284,7 @@ var Config = new Class({ this.loaderPath = GetValue(config, 'loader.path', ''); /** - * @const {integer} Phaser.Boot.Config#loaderMaxParallelDownloads - [description] + * @const {integer} Phaser.Boot.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). */ this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', 32); @@ -158387,9 +159332,9 @@ var Config = new Class({ * { key: 'WireFramePlugin', plugin: WireFramePlugin, systemKey: 'wireFramePlugin', sceneKey: 'wireframe' } * ], * default: [], OR - * defaultMerge: { + * defaultMerge: [ * 'ModPlayer' - * } + * ] * } */ @@ -160190,20 +161135,20 @@ module.exports = GetOffsetX; module.exports = { CenterOn: __webpack_require__(448), - GetBottom: __webpack_require__(51), + GetBottom: __webpack_require__(52), GetCenterX: __webpack_require__(85), GetCenterY: __webpack_require__(82), - GetLeft: __webpack_require__(49), + GetLeft: __webpack_require__(50), GetOffsetX: __webpack_require__(991), GetOffsetY: __webpack_require__(990), - GetRight: __webpack_require__(47), - GetTop: __webpack_require__(45), - SetBottom: __webpack_require__(50), + GetRight: __webpack_require__(48), + GetTop: __webpack_require__(46), + SetBottom: __webpack_require__(51), SetCenterX: __webpack_require__(84), SetCenterY: __webpack_require__(83), - SetLeft: __webpack_require__(48), - SetRight: __webpack_require__(46), - SetTop: __webpack_require__(44) + SetLeft: __webpack_require__(49), + SetRight: __webpack_require__(47), + SetTop: __webpack_require__(45) }; @@ -160218,10 +161163,10 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetRight = __webpack_require__(47); -var GetTop = __webpack_require__(45); -var SetBottom = __webpack_require__(50); -var SetRight = __webpack_require__(46); +var GetRight = __webpack_require__(48); +var GetTop = __webpack_require__(46); +var SetBottom = __webpack_require__(51); +var SetRight = __webpack_require__(47); /** * Takes given Game Object and aligns it so that it is positioned next to the top right position of the other. @@ -160262,10 +161207,10 @@ module.exports = TopRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetLeft = __webpack_require__(49); -var GetTop = __webpack_require__(45); -var SetBottom = __webpack_require__(50); -var SetLeft = __webpack_require__(48); +var GetLeft = __webpack_require__(50); +var GetTop = __webpack_require__(46); +var SetBottom = __webpack_require__(51); +var SetLeft = __webpack_require__(49); /** * Takes given Game Object and aligns it so that it is positioned next to the top left position of the other. @@ -160307,8 +161252,8 @@ module.exports = TopLeft; */ var GetCenterX = __webpack_require__(85); -var GetTop = __webpack_require__(45); -var SetBottom = __webpack_require__(50); +var GetTop = __webpack_require__(46); +var SetBottom = __webpack_require__(51); var SetCenterX = __webpack_require__(84); /** @@ -160350,10 +161295,10 @@ module.exports = TopCenter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetRight = __webpack_require__(47); -var GetTop = __webpack_require__(45); -var SetLeft = __webpack_require__(48); -var SetTop = __webpack_require__(44); +var GetRight = __webpack_require__(48); +var GetTop = __webpack_require__(46); +var SetLeft = __webpack_require__(49); +var SetTop = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the right top position of the other. @@ -160395,9 +161340,9 @@ module.exports = RightTop; */ var GetCenterY = __webpack_require__(82); -var GetRight = __webpack_require__(47); +var GetRight = __webpack_require__(48); var SetCenterY = __webpack_require__(83); -var SetLeft = __webpack_require__(48); +var SetLeft = __webpack_require__(49); /** * Takes given Game Object and aligns it so that it is positioned next to the right center position of the other. @@ -160438,10 +161383,10 @@ module.exports = RightCenter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(51); -var GetRight = __webpack_require__(47); -var SetBottom = __webpack_require__(50); -var SetLeft = __webpack_require__(48); +var GetBottom = __webpack_require__(52); +var GetRight = __webpack_require__(48); +var SetBottom = __webpack_require__(51); +var SetLeft = __webpack_require__(49); /** * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other. @@ -160482,10 +161427,10 @@ module.exports = RightBottom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetLeft = __webpack_require__(49); -var GetTop = __webpack_require__(45); -var SetRight = __webpack_require__(46); -var SetTop = __webpack_require__(44); +var GetLeft = __webpack_require__(50); +var GetTop = __webpack_require__(46); +var SetRight = __webpack_require__(47); +var SetTop = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the left top position of the other. @@ -160527,9 +161472,9 @@ module.exports = LeftTop; */ var GetCenterY = __webpack_require__(82); -var GetLeft = __webpack_require__(49); +var GetLeft = __webpack_require__(50); var SetCenterY = __webpack_require__(83); -var SetRight = __webpack_require__(46); +var SetRight = __webpack_require__(47); /** * Takes given Game Object and aligns it so that it is positioned next to the left center position of the other. @@ -160570,10 +161515,10 @@ module.exports = LeftCenter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(51); -var GetLeft = __webpack_require__(49); -var SetBottom = __webpack_require__(50); -var SetRight = __webpack_require__(46); +var GetBottom = __webpack_require__(52); +var GetLeft = __webpack_require__(50); +var SetBottom = __webpack_require__(51); +var SetRight = __webpack_require__(47); /** * Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other. @@ -160614,10 +161559,10 @@ module.exports = LeftBottom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(51); -var GetRight = __webpack_require__(47); -var SetRight = __webpack_require__(46); -var SetTop = __webpack_require__(44); +var GetBottom = __webpack_require__(52); +var GetRight = __webpack_require__(48); +var SetRight = __webpack_require__(47); +var SetTop = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other. @@ -160658,10 +161603,10 @@ module.exports = BottomRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(51); -var GetLeft = __webpack_require__(49); -var SetLeft = __webpack_require__(48); -var SetTop = __webpack_require__(44); +var GetBottom = __webpack_require__(52); +var GetLeft = __webpack_require__(50); +var SetLeft = __webpack_require__(49); +var SetTop = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other. @@ -160702,10 +161647,10 @@ module.exports = BottomLeft; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(51); +var GetBottom = __webpack_require__(52); var GetCenterX = __webpack_require__(85); var SetCenterX = __webpack_require__(84); -var SetTop = __webpack_require__(44); +var SetTop = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other. @@ -161705,9 +162650,9 @@ var Path = new Class({ * @method Phaser.Curves.Path#getPoints * @since 3.0.0 * - * @param {integer} [divisions=12] - [description] + * @param {integer} [divisions=12] - The number of points to divide the path in to. * - * @return {Phaser.Math.Vector2[]} [description] + * @return {Phaser.Math.Vector2[]} An array of Vector2 objects that containing the points along the Path. */ getPoints: function (divisions) { @@ -161761,7 +162706,7 @@ var Path = new Class({ * * @generic {Phaser.Math.Vector2} O - [out,$return] * - * @param {Phaser.Math.Vector2} [out] - [description] + * @param {Phaser.Math.Vector2} [out] - `Vector2` instance that should be used for storing the result. If `undefined` a new `Vector2` will be created. * * @return {Phaser.Math.Vector2} [description] */ @@ -162234,7 +163179,7 @@ var Camera = __webpack_require__(414); var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(1); var PluginCache = __webpack_require__(15); -var RectangleContains = __webpack_require__(42); +var RectangleContains = __webpack_require__(43); /** * @typedef {object} InputJSONCameraObject @@ -166840,7 +167785,7 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Wrap = __webpack_require__(58); +var Wrap = __webpack_require__(59); /** * Wrap each item's coordinates within a rectangle's area. @@ -166889,7 +167834,8 @@ module.exports = WrapInRectangle; */ /** - * [description] + * Takes an array of Game Objects and toggles the visibility of each one. + * Those previously `visible = false` will become `visible = true`, and vice versa. * * @function Phaser.Actions.ToggleVisible * @since 3.0.0 @@ -166924,7 +167870,16 @@ module.exports = ToggleVisible; */ /** - * [description] + * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, the + * calculated spread value. + * + * The spread value is derived from the given `min` and `max` values and the total number of items in the array.//#endregion + * + * For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call: + * + * ```javascript + * Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1); + * ``` * * @function Phaser.Actions.Spread * @since 3.0.0 @@ -166932,12 +167887,12 @@ module.exports = ToggleVisible; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {string} property - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} [inc=false] - [description] + * @param {string} property - The property of the Game Object to spread. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) * - * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that were passed to this Action. */ var Spread = function (items, property, min, max, inc) { @@ -166980,7 +167935,9 @@ module.exports = Spread; var MathSmoothStep = __webpack_require__(200); /** - * [description] + * Smoothstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. * * @function Phaser.Actions.SmoothStep * @since 3.0.0 @@ -166988,10 +167945,10 @@ var MathSmoothStep = __webpack_require__(200); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {string} property - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} inc - [description] + * @param {string} property - The property of the Game Object to interpolate. + * @param {number} min - The minimum interpolation value. + * @param {number} max - The maximum interpolation value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -167036,7 +167993,9 @@ module.exports = SmoothStep; var MathSmootherStep = __webpack_require__(201); /** - * [description] + * Smootherstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. * * @function Phaser.Actions.SmootherStep * @since 3.0.0 @@ -167044,10 +168003,10 @@ var MathSmootherStep = __webpack_require__(201); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {string} property - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} inc - [description] + * @param {string} property - The property of the Game Object to interpolate. + * @param {number} min - The minimum interpolation value. + * @param {number} max - The maximum interpolation value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -167125,9 +168084,11 @@ module.exports = Shuffle; var Vector2 = __webpack_require__(3); /** - * Iterate through items changing the position of each element to - * be that of the element that came before it in the array (or after it if direction = 1) + * Iterate through the items array changing the position of each element to be that of the element that came before + * it in the array (or after it if direction = 1) + * * The first items position is set to x/y. + * * The final x/y coords are returned * * @function Phaser.Actions.ShiftPosition @@ -167137,10 +168098,10 @@ var Vector2 = __webpack_require__(3); * @generic {Phaser.Math.Vector2} O - [output,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {number} x - [description] - * @param {number} y - [description] - * @param {integer} [direction=0] - [description] - * @param {(Phaser.Math.Vector2|object)} [output] - [description] + * @param {number} x - The x coordinate to place the first item in the array at. + * @param {number} y - The y coordinate to place the first item in the array at. + * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {(Phaser.Math.Vector2|object)} [output] - An optional objec to store the final objects position in. * * @return {Phaser.Math.Vector2} The output vector. */ @@ -167418,7 +168379,7 @@ module.exports = SetVisible; */ /** - * [description] + * Takes an array of Game Objects, or any objects that have the public method setTint() and then updates it to the given value(s). You can specify tint color per corner or provide only one color value for `topLeft` parameter, in which case whole item will be tinted with that color. * * @function Phaser.Actions.SetTint * @since 3.0.0 @@ -167426,10 +168387,10 @@ module.exports = SetVisible; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {number} topLeft - [description] - * @param {number} [topRight] - [description] - * @param {number} [bottomLeft] - [description] - * @param {number} [bottomRight] - [description] + * @param {number} topLeft - The tint being applied to top-left corner of item. If other parameters are given no value, this tint will be applied to whole item. + * @param {number} [topRight] - The tint to be applied to top-right corner of item. + * @param {number} [bottomLeft] - The tint to be applied to the bottom-left corner of item. + * @param {number} [bottomRight] - The tint to be applied to the bottom-right corner of item. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -167674,7 +168635,9 @@ module.exports = SetOrigin; */ /** - * [description] + * Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks. + * + * @see {@link Phaser.GameObjects.GameObject#setInteractive} * * @function Phaser.Actions.SetHitArea * @since 3.0.0 @@ -167682,8 +168645,8 @@ module.exports = SetOrigin; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {*} hitArea - [description] - * @param {HitAreaCallback} hitAreaCallback - [description] + * @param {*} hitArea - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {HitAreaCallback} hitAreaCallback - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -167964,7 +168927,7 @@ module.exports = ScaleX; var MathRotateAroundDistance = __webpack_require__(202); /** - * [description] + * Rotates an array of Game Objects around a point by the given angle and distance. * * @function Phaser.Actions.RotateAroundDistance * @since 3.0.0 @@ -168011,7 +168974,7 @@ module.exports = RotateAroundDistance; */ var RotateAroundDistance = __webpack_require__(202); -var DistanceBetween = __webpack_require__(57); +var DistanceBetween = __webpack_require__(58); /** * Rotates each item around the given point by the given angle. @@ -168100,7 +169063,9 @@ module.exports = Rotate; var Random = __webpack_require__(203); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomTriangle * @since 3.0.0 @@ -168108,7 +169073,7 @@ var Random = __webpack_require__(203); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Triangle} triangle - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -168138,7 +169103,7 @@ module.exports = RandomTriangle; var Random = __webpack_require__(207); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Ellipse. * * @function Phaser.Actions.RandomRectangle * @since 3.0.0 @@ -168146,7 +169111,7 @@ var Random = __webpack_require__(207); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -168176,7 +169141,9 @@ module.exports = RandomRectangle; var Random = __webpack_require__(208); /** - * [description] + * Takes an array of Game Objects and positions them at random locations on the Line. + * + * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomLine * @since 3.0.0 @@ -168184,7 +169151,7 @@ var Random = __webpack_require__(208); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Line} line - The Line to position the Game Objects randomly on. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -168214,7 +169181,9 @@ module.exports = RandomLine; var Random = __webpack_require__(204); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomEllipse * @since 3.0.0 @@ -168222,7 +169191,7 @@ var Random = __webpack_require__(204); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Ellipse} ellipse - [description] + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -168252,7 +169221,9 @@ module.exports = RandomEllipse; var Random = __webpack_require__(211); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomCircle * @since 3.0.0 @@ -168260,7 +169231,7 @@ var Random = __webpack_require__(211); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Circle} circle - [description] + * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -168324,11 +169295,12 @@ module.exports = PlayAnimation; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// var GetPointsOnLine = require('../geom/line/GetPointsOnLine'); var BresenhamPoints = __webpack_require__(421); /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.PlaceOnTriangle * @since 3.0.0 @@ -168336,8 +169308,8 @@ var BresenhamPoints = __webpack_require__(421); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {number} [stepRate=1] - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects on. + * @param {number} [stepRate=1] - An optional step rate, to increase or decrease the packing of the Game Objects on the lines. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -168388,14 +169360,11 @@ var MarchingAnts = __webpack_require__(424); var RotateLeft = __webpack_require__(423); var RotateRight = __webpack_require__(422); -// Place the items in the array around the perimeter of the given rectangle. - -// Placement starts from the top-left of the rectangle, and proceeds in a -// clockwise direction. If the shift parameter is given you can offset where -// placement begins. - /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. + * + * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. + * If the `shift` parameter is given you can offset where placement begins. * * @function Phaser.Actions.PlaceOnRectangle * @since 3.0.0 @@ -168403,8 +169372,8 @@ var RotateRight = __webpack_require__(422); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {integer} [shift=1] - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects on. + * @param {integer} [shift=1] - An optional positional offset. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -168448,7 +169417,7 @@ module.exports = PlaceOnRectangle; var GetPoints = __webpack_require__(209); /** - * [description] + * Positions an array of Game Objects on evenly spaced points of a Line. * * @function Phaser.Actions.PlaceOnLine * @since 3.0.0 @@ -168456,7 +169425,7 @@ var GetPoints = __webpack_require__(209); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Line} line - The Line to position the Game Objects on. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -168490,7 +169459,9 @@ module.exports = PlaceOnLine; */ /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of an Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.PlaceOnEllipse * @since 3.0.0 @@ -168498,9 +169469,9 @@ module.exports = PlaceOnLine; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Ellipse} ellipse - [description] - * @param {number} [startAngle=0] - [description] - * @param {number} [endAngle=6.28] - [description] + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects on. + * @param {number} [startAngle=0] - Optional angle to start position from, in radians. + * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -168540,7 +169511,9 @@ module.exports = PlaceOnEllipse; */ /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.PlaceOnCircle * @since 3.0.0 @@ -168548,9 +169521,9 @@ module.exports = PlaceOnEllipse; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Circle} circle - [description] - * @param {number} [startAngle=0] - [description] - * @param {number} [endAngle=6.28] - [description] + * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects on. + * @param {number} [startAngle=0] - Optional angle to start position from, in radians. + * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -170841,7 +171814,7 @@ module.exports = GetFirst; /** * @callback CallCallback * - * @param {Phaser.GameObjects.GameObject} item - [description] + * @param {Phaser.GameObjects.GameObject} item - The Game Object to run the callback on. */ /** diff --git a/dist/phaser-facebook-instant-games.min.js b/dist/phaser-facebook-instant-games.min.js index 0bfcdd700..75afbcfbe 100644 --- a/dist/phaser-facebook-instant-games.min.js +++ b/dist/phaser-facebook-instant-games.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1131)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,e,s,r){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,t.exports=n},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,s="~";function r(){}function o(t,e,i,n,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new function(t,e,i){this.fn=t,this.context=e,this.once=i||!1}(i,n||t,r),a=s?s+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function h(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),h.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(s?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},h.prototype.listeners=function(t){var e=s?s+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,r=i.length,o=new Array(r);n0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i0&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit("destroy",this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});a.RENDER_MASK=15,t.exports=a},function(t,e,i){var n=i(441),s={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:new n};t.exports=s},function(t,e,i){var n=i(1);t.exports=function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===s&&(s=o.height);var a=n(r,"isNotEmpty",!1),h=n(r,"isColliding",!1),l=n(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit("filecomplete",e,i,t),this.loader.emit("filecomplete-"+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){t.exports=function(t,e,i,n,s){var r=n.alpha*i.alpha;if(r<=0)return!1;var o=t._tempMatrix1.copyFromArray(n.matrix.matrix),a=t._tempMatrix2.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),h=t._tempMatrix3;return s?(o.multiplyWithOffset(s,-n.scrollX*i.scrollFactorX,-n.scrollY*i.scrollFactorY),a.e=i.x,a.f=i.y,o.multiply(a,h)):(a.e-=n.scrollX*i.scrollFactorX,a.f-=n.scrollY*i.scrollFactorY,o.multiply(a,h)),e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=r,e.save(),h.setToContext(e),!0}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n={};t.exports=n;var s=i(34),r=i(33),o=i(89),a=i(12),h=i(32),l=i(151);!function(){n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",gameObject:null,parts:[],plugin:{},angle:0,vertices:s.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,ignoreGravity:!1,ignorePointer:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0},lineWidth:0},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,_original:null},n=a.extend(i,e);return t(n,e),n},n.nextGroup=function(t){return t?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var t=function(t,e){e=e||{},n.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),s.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),n.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var i=t.isStatic?"#2e2b44":a.choose(["#006BA6","#0496FF","#FFBC42","#D81159","#8F2D56"]);t.render.fillStyle=t.render.fillStyle||i,t.render.strokeStyle=t.render.strokeStyle||"#000",t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};n.set=function(t,e,i){var s;for(s in"string"==typeof e&&(s=e,(e={})[s]=i),e)if(e.hasOwnProperty(s))switch(i=e[s],s){case"isStatic":n.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":n.setMass(t,i);break;case"density":n.setDensity(t,i);break;case"inertia":n.setInertia(t,i);break;case"vertices":n.setVertices(t,i);break;case"position":n.setPosition(t,i);break;case"angle":n.setAngle(t,i);break;case"velocity":n.setVelocity(t,i);break;case"angularVelocity":n.setAngularVelocity(t,i);break;case"parts":n.setParts(t,i);break;default:t[s]=i}},n.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n={VERSION:"3.13.0",BlendModes:i(72),ScaleModes:i(104),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n=i(0),s=i(16),r=i(17),o=i(60),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e,i){var n=i(72),s=i(13),r=i(104);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),e.blendMode=s(i,"blendMode",n.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){var i={};t.exports=i,i.create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;nt.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){var i={};t.exports=i,i.create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i||(i={});var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e,i){var n={};t.exports=n;var s=i(33),r=i(12);n.create=function(t,e){for(var i=[],n=0;n0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e){t.exports=function(t,e,i){var n=i||e.fillColor,s=e.fillAlpha,r=(16711680&n)>>>16,o=(65280&n)>>>8,a=255&n;t.fillStyle="rgba("+r+","+o+","+a+","+s+")"}},function(t,e,i){var n=i(18);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(110),s=i(19);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;d>>16,r=(65280&i)>>>8,o=255&i;t.strokeStyle="rgba("+s+","+r+","+o+","+n+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),s=i(196),r=i(412),o=i(195),a=i(411),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e,i){var n={};t.exports=n;var s=i(34),r=i(12),o=i(25),a=i(32),h=i(33),l=i(245);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-n+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},n.circle=function(t,e,i,s,o){s=s||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,r.extend({},a,s))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&s.area(A)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e,i){var n=i(0),s=i(20),r=i(22),o=i(7),a=i(1),h=i(4),l=i(8),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;sthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=h},function(t,e,i){var n=i(0),s=i(16),r=i(294),o=new n({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=null,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return this.getLeft(t)+this.width/2},getCenterY:function(t){return this.getTop(t)+this.height/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight-(this.height-this.baseHeight),this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.tilemapLayer;return t?t.tileset:null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n={};t.exports=n;var s=i(74),r=i(12),o=i(32),a=i(25);n.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},n.setModified=function(t,e,i,s){if(t.isModified=e,i&&t.parent&&n.setModified(t.parent,e,i,s),s)for(var r=0;r=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;ps||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,a,h,l,u,f,g,v=e&&e.length,y=v?e[0]*i:t.length,m=s(t,0,y,i,!0),x=[];if(!m)return x;if(v&&(m=function(t,e,i,n){var o,a,h,l,u,f=[];for(o=0,a=e.length;o80*i){n=h=t[0],a=l=t[1];for(var w=i;wh&&(h=u),f>l&&(l=f);g=Math.max(h-n,l-a)}return o(m,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===_(t,e,i,n)>0)for(r=e;r=e;r-=n)o=T(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!m(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),S(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(y(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&y(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(y(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!m(s,r)&&x(s,n,n.next,r)&&w(s,r)&&w(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),S(n),S(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&w(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=b(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&w(t,e)&&w(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(m(t,e)&&m(i,n)||m(t,n)&&m(i,e))||y(t,e,i)>0!=y(t,e,n)>0&&y(i,n,t)>0!=y(i,n,e)>0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function T(t,e,i,n){var s=new A(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={SKIP_CHECK:-1,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}},function(t,e,i){var n={};t.exports=n;var s=i(34),r=i(33),o=i(89),a=i(32),h=i(151),l=i(12);n._warming=.4,n._torqueDampen=1,n._minLength=1e-6,n.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,s=r.magnitude(r.sub(i,n));e.length=void 0!==e.length?e.length:s,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e,i){var n={};t.exports=n;var s=i(12);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r0){i||(i={}),n=e.split(" ");for(var l=0;l=0&&y>=0&&v+y<1}},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,i){var n=i(0),s=i(16),r=i(17),o=i(892),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,s){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},function(t,e,i){var n=i(69);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e,i){var n=i(0),s=i(191),r=i(10),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){var n=i(0),s=i(43),r=i(442),o=i(440),a=i(211),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation","orthogonal"),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[])}});t.exports=r},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",{}),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null)}});t.exports=r},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e0&&r.motion=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;sn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r,o){for(var a=n.getTintAppendFloatAlphaAndSwap(i.fillColor,i.fillAlpha*s),h=i.pathData,l=i.pathIndexes,u=0;u-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return this.entries.length=t}}});t.exports=n},function(t,e,i){var n=i(454),s=i(0),r=i(1),o=i(4),a=i(8),h=i(341),l=i(96),u=i(56),c=new s({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?a(e[0])&&(i=e,e=null):a(e)&&(i=e,e=null),this.scene=t,this.children=new l(e),this.isParent=!0,this.classType=r(i,"classType",u),this.active=r(i,"active",!0),this.maxSize=r(i,"maxSize",-1),this.defaultKey=r(i,"defaultKey",null),this.defaultFrame=r(i,"defaultFrame",null),this.runChildUpdate=r(i,"runChildUpdate",!1),this.createCallback=r(i,"createCallback",null),this.removeCallback=r(i,"removeCallback",null),this.createMultipleCallback=r(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i=t.length)){for(var i=t.length-1,n=t[e],s=e;s=this.firstgid&&t=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e,i){var n=i(0),s=i(16),r=i(17),o=i(797),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,o],initialize:function(t,e,i,n,s,o,a,h,l){if(r.call(this,t,"Mesh"),n.length!==s.length)throw new Error("Mesh Vertex count must match UV count");var u,c=n.length/2|0;if(o.length>0&&o.length0&&a.lengthl&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(0),s=i(24),r=i(21),o=new n({initialize:function(t,e,i,n,s,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,d)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),y=r=s(r,0,f-i),m=this.data;if(m.trim){var x=m.spriteSourceSize,w=e+n,b=i+r;if(!(x.rw||x.y>b)){var T=Math.max(x.x,e),S=Math.max(x.y,i),A=Math.min(x.r,w)-T,_=Math.min(x.b,b)-S;v=A,y=_,p=o?h+(u-(T-x.x)-A):h+(T-x.x),g=a?l+(c-(S-x.y)-_):l+(S-x.y),e=T,i=S,n=A,r=_}else p=0,g=0,v=0,y=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var C=this.source.width,M=this.source.height;return t.u0=Math.max(0,p/C),t.v0=Math.max(0,g/M),t.u1=Math.min(1,(p+v)/C),t.v1=Math.min(1,(g+y)/M),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=y,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){var n=i(0),s=i(11),r=i(21),o=i(2),a=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=r(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=r(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=r(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=r(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit("destroy",this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=a},function(t,e,i){var n=i(0),s=i(69),r=i(11),o=i(2),a=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on("blur",function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on("focus",function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on("prestep",this.update,this),t.events.once("destroy",this.destroy,this)},add:o,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once("ended",i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once("ended",n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("pauseall",this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit("resumeall",this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit("stopall",this)},unlock:o,onBlur:o,onFocus:o,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("rate",this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("detune",this,t)}}});t.exports=a},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){var n,s=i(101),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){var n=i(0),s=i(16),r=i(36),o=i(11),a=i(10),h=i(59),l=i(197),u=i(3),c=new n({Extends:o,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.config,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new a,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new a,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new h,this.transparent=!0,this.backgroundColor=l("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new u(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new u);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOn:function(t,e){var i=.5*this.width,n=.5*this.height;return this.midPoint.set(t,e),this.scrollX=t-i,this.scrollY=e-n,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;g-y&&T>-m&&b<_&&T-y&&A>-m&&S<_&&As&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=l(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.config=t.sys.game.config,this.sceneManager=t.sys.game.scene;var e=this.config.resolution;return this.resolution=e,this._cx=this._x*e,this._cy=this._y*e,this._cw=this._width*e,this._ch=this._height*e,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.config){var t=0!==this._x||0!==this._y||this.config.width!==this._width||this.config.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit("cameradestroy",this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.config=null,this.sceneManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=c},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e){var i={defaultPipeline:null,pipeline:null,initPipeline:function(t){void 0===t&&(t="TextureTintPipeline");var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return e&&e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t)),this},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=i},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e,i){var n=i(72),s=i(81),r=i(43),o=i(0),a=i(16),h=i(17),l=i(10),u=i(42),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.ScaleMode,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,s,r){void 0===s&&(s=1),void 0===r&&(r=s),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=s,this.height=r,this.blendMode=n.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){return void 0===i&&(i=!0),this.width=t,this.height=e,i&&this.input&&this.input.hitArea instanceof l&&(this.input.hitArea.width=t,this.input.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new s(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return void 0===t?this.setRectangleDropZone(this.width,this.height):this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},renderCanvas:function(){},renderWebGL:function(){}});t.exports=c},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e,i){var n=i(0),s=i(14),r=i(5),o=i(93),a=new n({initialize:function(t,e,i){this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onRepeat:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(){return this.data[0].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},isPaused:function(){return this.state===o.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){for(var n=0;n0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){if(this.state!==o.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this},play:function(t){if(this.state!==o.ACTIVE){this.state!==o.PENDING_REMOVE&&this.state!==o.REMOVED||(this.init(),this.parent.makeActive(this),t=!0);var e=this.callbacks.onStart;this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this))}},resetTweenData:function(t){for(var e=this.data,i=0;i0?(n.elapsed=n.delay,n.state=o.DELAY):n.state=o.PENDING_RENDER}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&ns.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},stop:function(t){this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parent._destroy.push(this),this.parent._toProcess++),this.state=o.PENDING_REMOVE)},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e){function i(t){return!!t.getStart&&"function"==typeof t.getStart}function n(t){return!!t.getEnd&&"function"==typeof t.getEnd}var s=function(t,e){var r,o,a=function(t,e,i){return i},h=function(t,e,i){return i},l=typeof e;if("number"===l)a=function(){return e};else if("string"===l){var u=e[0],c=parseFloat(e.substr(2));switch(u){case"+":a=function(t,e,i){return i+c};break;case"-":a=function(t,e,i){return i-c};break;case"*":a=function(t,e,i){return i*c};break;case"/":a=function(t,e,i){return i/c};break;default:a=function(){return parseFloat(e)}}}else"function"===l?a=e:"object"===l&&(i(o=e)||n(o))?(n(e)&&(a=e.getEnd),i(e)&&(h=e.getStart)):e.hasOwnProperty("value")&&(r=s(t,e.value));return r||(r={getEnd:a,getStart:h}),r};t.exports=s},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"targets",null);return null===e?e:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(29),s=i(86),r=i(231),o=i(223);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",n.ARRAY_2D,u,i,a,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new s({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){var n=i(29),s=i(87),r=i(86),o=i(61);t.exports=function(t,e,i,a,h){for(var l=new s({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;pr?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n=i(241);n.Body=i(25),n.Composite=i(63),n.World=i(145),n.Detector=i(149),n.Grid=i(240),n.Pairs=i(239),n.Pair=i(112),n.Query=i(536),n.Resolver=i(238),n.SAT=i(148),n.Constraint=i(73),n.Common=i(12),n.Engine=i(237),n.Events=i(74),n.Sleeping=i(89),n.Plugin=i(146),n.Bodies=i(54),n.Composites=i(244),n.Axes=i(151),n.Bounds=i(32),n.Svg=i(534),n.Vector=i(33),n.Vertices=i(34),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,t.exports=n},function(t,e,i){var n={};t.exports=n;var s=i(34),r=i(33);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlaps?s=a:a=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n=i(54),s=i(25),r=i(0),o=i(113),a=i(1),h=i(77),l=i(34),u=new r({Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var n=a(i,"body",null),s=a(i,"addToWorld",!0);if(n)this.setBody(n,s);else{var r=e.getCollisionGroup();a(r,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(33),r=i(12);n.fromVertices=function(t){for(var e={},i=0;i0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],y=s[12],m=s[13],x=s[14],w=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+y)*w,this.y=(e*o+i*u+n*p+m)*w,this.z=(e*a+i*c+n*g+x)*w,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});t.exports=n},function(t,e,i){var n=i(0),s=i(20),r=i(22),o=i(7),a=i(1),h=i(8),l=i(379),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n=0&&r>=0&&s+r<1&&(n.push({x:e[b].x,y:e[b].y}),i)));b++);return n}},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.righte.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),s=i(118),r=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,1,1,1,0],[16777215,16777215,16777215,16777215,16777215,16777215],[1,1,1,1,1,1],n,r),this.resetPosition()},setFrame:function(t){return this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,t=this.frame,this.uv[0]=t.u0,this.uv[1]=t.v0,this.uv[2]=t.u0,this.uv[3]=t.v1,this.uv[4]=t.u1,this.uv[5]=t.v1,this.uv[6]=t.u0,this.uv[7]=t.v0,this.uv[8]=t.u1,this.uv[9]=t.v1,this.uv[10]=t.u1,this.uv[11]=t.v0,this},topLeftX:{get:function(){return this.x+this.vertices[0]},set:function(t){this.vertices[0]=t-this.x,this.vertices[6]=t-this.x}},topLeftY:{get:function(){return this.y+this.vertices[1]},set:function(t){this.vertices[1]=t-this.y,this.vertices[7]=t-this.y}},topRightX:{get:function(){return this.x+this.vertices[10]},set:function(t){this.vertices[10]=t-this.x}},topRightY:{get:function(){return this.y+this.vertices[11]},set:function(t){this.vertices[11]=t-this.y}},bottomLeftX:{get:function(){return this.x+this.vertices[2]},set:function(t){this.vertices[2]=t-this.x}},bottomLeftY:{get:function(){return this.y+this.vertices[3]},set:function(t){this.vertices[3]=t-this.y}},bottomRightX:{get:function(){return this.x+this.vertices[4]},set:function(t){this.vertices[4]=t-this.x,this.vertices[8]=t-this.x}},bottomRightY:{get:function(){return this.y+this.vertices[5]},set:function(t){this.vertices[5]=t-this.y,this.vertices[9]=t-this.y}},topLeftAlpha:{get:function(){return this.alphas[0]},set:function(t){this.alphas[0]=t,this.alphas[3]=t}},topRightAlpha:{get:function(){return this.alphas[5]},set:function(t){this.alphas[5]=t}},bottomLeftAlpha:{get:function(){return this.alphas[1]},set:function(t){this.alphas[1]=t}},bottomRightAlpha:{get:function(){return this.alphas[2]},set:function(t){this.alphas[2]=t,this.alphas[4]=t}},topLeftColor:{get:function(){return this.colors[0]},set:function(t){this.colors[0]=t,this.colors[3]=t}},topRightColor:{get:function(){return this.colors[5]},set:function(t){this.colors[5]=t}},bottomLeftColor:{get:function(){return this.colors[1]},set:function(t){this.colors[1]=t}},bottomRightColor:{get:function(){return this.colors[2]},set:function(t){this.colors[2]=t,this.colors[4]=t}},setTopLeft:function(t,e){return this.topLeftX=t,this.topLeftY=e,this},setTopRight:function(t,e){return this.topRightX=t,this.topRightY=e,this},setBottomLeft:function(t,e){return this.bottomLeftX=t,this.bottomLeftY=e,this},setBottomRight:function(t,e){return this.bottomRightX=t,this.bottomRightY=e,this},resetPosition:function(){var t=this.x,e=this.y,i=Math.floor(this.width/2),n=Math.floor(this.height/2);return this.setTopLeft(t-i,e-n),this.setTopRight(t+i,e-n),this.setBottomLeft(t-i,e+n),this.setBottomRight(t+i,e+n),this},resetAlpha:function(){var t=this.alphas;return t[0]=1,t[1]=1,t[2]=1,t[3]=1,t[4]=1,t[5]=1,this},resetColors:function(){var t=this.colors;return t[0]=16777215,t[1]=16777215,t[2]=16777215,t[3]=16777215,t[4]=16777215,t[5]=16777215,this},reset:function(){return this.resetPosition(),this.resetAlpha(),this.resetColors()}});t.exports=r},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++sl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var y=u[c].length?c:c+1,m=u.slice(y).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=m+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h0&&(a+=u.lineSpacing*p),i.rtl?o=d-o:"right"===i.align?o+=u.width-u.lineWidths[p]:"center"===i.align&&(o+=(u.width-u.lineWidths[p])/2),this.autoRound&&(o=Math.round(o),a=Math.round(a)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[p],o,a)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[p],o,a));return e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(130),s=i(26),r=i(0),o=i(16),a=i(28),h=i(123),l=i(17),u=i(883),c=i(324),d=new r({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,r,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===o&&(o=32),l.call(this,t,"RenderTexture"),this.renderer=t.sys.game.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=s.create2D(this,r,o),this.context=this.canvas.getContext("2d"),this.framebuffer=null,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(c(),this.canvas),this.frame=this.texture.get(),this._saved=!1,this.camera=new n(0,0,r,o),this.dirty=!1,this.gl=null;var h=this.renderer;if(h.type===a.WEBGL){var u=h.gl;this.gl=u,this.drawGameObject=this.batchGameObjectWebGL,this.framebuffer=h.createFramebuffer(r,o,this.frame.source.glTexture,!1)}else h.type===a.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas);this.camera.setScene(t),this.setPosition(e,i),this.setSize(r,o),this.setOrigin(0,0),this.initPipeline()},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas.width=t,this.canvas.height=e,this.gl){var i=this.gl;this.renderer.deleteTexture(this.frame.source.glTexture),this.renderer.deleteFramebuffer(this.framebuffer),this.frame.source.glTexture=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1),this.framebuffer=this.renderer.createFramebuffer(t,e,this.frame.source.glTexture,!1),this.frame.glTexture=this.frame.source.glTexture}this.frame.source.width=t,this.frame.source.height=e,this.camera.setSize(t,e),this.frame.setSize(t,e),this.width=t,this.height=e}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e){void 0===e&&(e=1);var i=255&(t>>16|0),n=255&(t>>8|0),s=255&(0|t);if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var r=this.gl;r.clearColor(i/255,n/255,s/255,e),r.clear(r.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else this.context.fillStyle="rgb("+i+","+n+","+s+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height);return this},clear:function(){if(this.dirty){if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.restore()}this.dirty=!1}return this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1,1),r){this.renderer.setFramebuffer(this.framebuffer);var o=this.pipeline;o.projOrtho(0,this.width,0,this.height,-1e3,1e3),this.batchList(t,e,i,n,s),o.flush(),this.renderer.setFramebuffer(null),o.projOrtho(0,o.width,o.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1,1),o){this.renderer.setFramebuffer(this.framebuffer);var h=this.pipeline;h.projOrtho(0,this.width,0,this.height,-1e3,1e3),h.batchTextureFrame(a,i,n,r,s,this.camera.matrix,null),h.flush(),this.renderer.setFramebuffer(null),h.projOrtho(0,h.width,h.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i,n,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;r0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),o.gl&&n&&(n.source[0].glTexture=o.canvasToTexture(s.canvas,n.source[0].glTexture))),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e,i){var n=i(119),s=i(0),r=i(900),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(179),s=i(72),r=i(0),o=i(16),a=i(17),h=i(10),l=i(903),u=i(338),c=i(3),d=new r({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.ScrollFactor,o.Transform,o.Visible,l],initialize:function(t,e,i,n){a.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new h),t.setTo(this.x,this.y,0,0),this.list.length>0)for(var e=this.list,i=new h,n=0;n-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=d},function(t,e,i){var n=i(907),s=i(904),r=i(0),o=i(16),a=i(123),h=i(17),l=i(122),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(t,e,i,n,s){h.call(this,t,"Blitter"),this.setTexture(n,s),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,r){void 0===n&&(n=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new s(this,t,e,i,n);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,n){for(var s=this.createMultiple(e,i,n),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit("start",this),this.events.emit("ready",this,t)},resize:function(t,e){this.events.emit("resize",t,e)},shutdown:function(t){this.events.off("transitioninit"),this.events.off("transitionstart"),this.events.off("transitioncomplete"),this.events.off("transitionout"),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit("destroy",this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;ethis.vertexCapacity&&(this.flush(),y=!0);var m=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.vertexComponentCount-1;return m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=i,m[++w]=n,m[++w]=h,m[++w]=c,m[++w]=v,x[++w]=p,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=o,m[++w]=a,m[++w]=u,m[++w]=l,m[++w]=v,x[++w]=f,this.vertexCount+=6,y},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f){var p=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),p=!0);var g=this.vertexViewF32,v=this.vertexViewU32,y=this.vertexCount*this.vertexComponentCount-1;return g[++y]=t,g[++y]=e,g[++y]=o,g[++y]=a,g[++y]=f,v[++y]=u,g[++y]=i,g[++y]=n,g[++y]=o,g[++y]=l,g[++y]=f,v[++y]=c,g[++y]=s,g[++y]=r,g[++y]=h,g[++y]=l,g[++y]=f,v[++y]=d,this.vertexCount+=3,p},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,A,_,C,M,P,E){this.renderer.setPipeline(this,t);var k=this._tempMatrix1,F=this._tempMatrix2,L=this._tempMatrix3,R=y/i+C,O=m/n+M,I=(y+x)/i+C,B=(m+w)/n+M,D=o,Y=a,X=-g,z=-v;if(t.isCropped){var N=t._crop;D=N.width,Y=N.height,o=N.width,a=N.height;var U=y=N.x,V=m=N.y;c&&(U=x-N.x-N.width),d&&!e.isRenderTexture&&(V=w-N.y-N.height),R=U/i+C,O=V/n+M,I=(U+N.width)/i+C,B=(V+N.height)/n+M,X=-g+y,z=-v+m}d^=e.isRenderTexture?1:0,c&&(D*=-1,X+=o),d&&(Y*=-1,z+=a);var G=X+D,W=z+Y;F.applyITRS(s,r,u,h,l),k.copyFrom(P.matrix),E?(k.multiplyWithOffset(E,-P.scrollX*f,-P.scrollY*p),F.e=s,F.f=r,k.multiply(F,L)):(F.e-=P.scrollX*f,F.f-=P.scrollY*p,k.multiply(F,L));var H=L.getX(X,z),j=L.getY(X,z),q=L.getX(X,W),K=L.getY(X,W),J=L.getX(G,W),Z=L.getY(G,W),Q=L.getX(G,z),$=L.getY(G,z);P.roundPixels&&(H|=0,j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0),this.setTexture2D(e,0),this.batchQuad(H,j,q,K,J,Z,Q,$,R,O,I,B,b,T,S,A,_)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),y=h.getY(l,c),m=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,y,m,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n,h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),y=this.currentFrame,m=y.u0,x=y.v0,w=y.u1,b=y.v1;this.batchQuad(l,u,c,d,f,p,g,v,m,x,w,b,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,y=g.v0,m=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,y,m,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(R,O,E,k,H[0],H[1],H[2],H[3],U,V,G,W,D,Y,X,z,B):(j[0]=R,j[1]=O,j[2]=E,j[3]=k,j[4]=1),h&&j[4]?this.batchQuad(M,P,F,L,j[0],j[1],j[2],j[3],U,V,G,W,D,Y,X,z,B):(H[0]=M,H[1]=P,H[2]=F,H[3]=L,H[4]=1)}}});t.exports=d},function(t,e,i){var n=i(0),s=i(966),r=i(182),o=new n({Extends:r,initialize:function(t){t.fragShader=s.replace("%LIGHT_COUNT%",10..toString()),r.call(this,t),this.defaultNormalMap},boot:function(){this.defaultNormalMap=this.game.textures.getFrame("__DEFAULT")},onBind:function(t){r.prototype.onBind.call(this);var e=this.renderer,i=this.program;return this.mvpUpdate(),e.setInt1(i,"uNormSampler",1),e.setFloat2(i,"uResolution",this.width,this.height),t&&this.setNormalMap(t),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,10);if(0===s)return this;this.active=!0;var r,o=this.renderer,a=this.program,h=e.matrix,l={x:0,y:0},u=o.height;for(r=0;r<10;++r)o.setFloat1(a,"uLights["+r+"].radius",0);for(o.setFloat4(a,"uCamera",e.x,e.y,e.rotation,e.zoom),o.setFloat3(a,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n={Global:["game","anims","cache","plugins","registry","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};n.Global.push("facebook"),t.exports=n},function(t,e,i){var n=i(101),s=i(128),r=i(26),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D||n.cocoonJS;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this);n.cocoonJS&&(t.screencanvas=!1);var e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d").createImageData(1,1);return a=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(o.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e){t.exports=function(t,e,i){var n;if(void 0===i&&(i=!0),e)"string"==typeof e?n=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(n=e);else if(t.parentElement)return t;return n||(n=document.body),i&&n.style&&(n.style.overflow="hidden"),n.appendChild(t),t}},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e){t.exports=function(t,e,i,n,s){var r=.5*(n-e),o=.5*(s-i),a=t*t;return(2*i-2*n+r+o)*(t*a)+(-3*i+3*n-2*r-o)*a+r*t+i}},function(t,e,i){var n=i(18);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){var n=i(10);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,s=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return e.x=t.x+s*Math.cos(i)*t.width/2,e.y=t.y+s*Math.sin(i)*t.height/2,e}},function(t,e,i){var n=i(58);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(58);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var n=i(71),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),r=s>1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e){t.exports={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}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(0),s=i(11),r=i(105),o=i(93),a=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},add:function(t){return this.queue(r(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=o.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit("loop",this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit("complete",this),this.state=o.PENDING_REMOVE}},update:function(t,e){if(this.state!==o.PAUSED){var i=e;switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var n=this.totalData,s=0;s0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var y=0;y0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(0),s=i(16),r=i(28),o=i(17),a=i(473),h=i(111),l=i(9),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=n,this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.vertexBuffer=null,this.renderer=t.sys.game.renderer,this.bufferData=null,this.vertexViewF32=null,this.vertexViewU32=null,this.dirty=!0,this.vertexCount=0,this._renderOrder=0,this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.dirty=!0,this.vertexBuffer=null},this)},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t,this.dirty=!0),this},upload:function(t){var e=this.renderer,i=e.gl,n=e.pipelines.TextureTintPipeline;if(this.dirty){var s,r,o,a=this.tileset,h=this.layer.width,l=this.layer.height,u=a.image.source[0].width,c=a.image.source[0].height,d=this.layer.data,f=this._renderOrder,p=this.vertexBuffer,g=this.bufferData,v=-1,y=h*l*n.vertexSize*6;if(this.vertexCount=0,null===g&&(g=new ArrayBuffer(y),this.bufferData=g,this.vertexViewF32=new Float32Array(g),this.vertexViewU32=new Uint32Array(g)),0===f)for(r=0;r=0;o--)(s=d[r][o])&&-1!==s.index&&s.visible&&(v=this.batchTile(v,s,a,u,c,t));else if(2===f)for(r=l-1;r>=0;r--)for(o=0;o=0;r--)for(o=h-1;o>=0;o--)(s=d[r][o])&&-1!==s.index&&s.visible&&(v=this.batchTile(v,s,a,u,c,t));this.dirty=!1,null===p?(p=e.createVertexBuffer(g,i.STATIC_DRAW),this.vertexBuffer=p):(e.setVertexBuffer(p),i.bufferSubData(i.ARRAY_BUFFER,0,g))}return n.modelIdentity(),n.modelTranslate(this.x-t.scrollX*this.scrollFactorX,this.y-t.scrollY*this.scrollFactorY,0),n.modelScale(this.scaleX,this.scaleY,1),n.viewLoad2D(t.matrix.matrix),this},batchTile:function(t,e,i,n,s,r){var o=e.pixelX,a=e.pixelY,h=o+e.width,u=a+e.height,c=i.getTileTextureCoordinates(e.index);if(c){var d=c.x/n,f=c.y/s,p=(c.x+e.width)/n,g=(c.y+e.height)/s,v=l.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),y=o,m=a,x=o,w=u,b=h,T=u,S=h,A=a;r.roundPixels&&(y|=0,m|=0,x|=0,w|=0,b|=0,T|=0,S|=0,A|=0);var _=this.vertexViewF32,C=this.vertexViewU32;return _[++t]=y,_[++t]=m,_[++t]=d,_[++t]=f,_[++t]=0,C[++t]=v,_[++t]=x,_[++t]=w,_[++t]=d,_[++t]=g,_[++t]=0,C[++t]=v,_[++t]=b,_[++t]=T,_[++t]=p,_[++t]=g,_[++t]=0,C[++t]=v,_[++t]=y,_[++t]=m,_[++t]=d,_[++t]=f,_[++t]=0,C[++t]=v,_[++t]=b,_[++t]=T,_[++t]=p,_[++t]=g,_[++t]=0,C[++t]=v,_[++t]=S,_[++t]=A,_[++t]=p,_[++t]=f,_[++t]=0,C[++t]=v,this.vertexCount+=6,t}},calculateFacesAt:function(t,e){return h.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return h.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return h.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},findByIndex:function(t,e,i){return h.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return h.FindTile(t,e,i,n,s,r,o,this.layer)},filterTiles:function(t,e,i,n,s,r,o){return h.FilterTiles(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return h.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return h.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return h.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return h.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return h.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return h.GetTilesWithinShape(t,e,i,this.layer)},hasTileAt:function(t,e){return h.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return h.HasTileAtWorldXY(t,e,i,this.layer)},renderDebug:function(t,e){return h.RenderDebug(t,e,this.layer),this},setCollision:function(t,e,i){return h.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return h.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return h.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return h.SetCollisionByExclusion(t,e,i,this.layer),this},setTileIndexCallback:function(t,e,i){return h.SetTileIndexCallback(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return h.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return h.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return h.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return h.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return h.TileToWorldXY(t,e,i,n,this.layer)},worldToTileX:function(t,e,i){return h.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return h.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return h.WorldToTileXY(t,e,i,n,s,this.layer)},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.tileset=void 0,this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this)}});t.exports=u},function(t,e,i){var n=i(0),s=i(16),r=i(476),o=i(17),a=i(111),h=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DynamicTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=n,this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=a.CullTiles,this._renderOrder=0,this.setAlpha(this.layer.alpha),this.setPosition(s,r),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline")},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.tileset=void 0,this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(36),r=i(222),o=i(21),a=i(29),h=i(87),l=i(271),u=i(221),c=i(61),d=i(111),f=i(107),p=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn('Invalid image key given for tileset: "'+e+'"'),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn('No data found in the JSON tilemap from Tiled matching the tileset name: "'+t+'"'),null;if(this.tilesets[l])return this.tilesets[l].setTileSize(i,n),this.tilesets[l].setSpacing(s,r),this.tilesets[l].setImage(h),this.tilesets[l];void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0);var u=new f(t,o,i,n,s,r);return u.setImage(h),this.tilesets.push(u),u},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new u(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:(null!==a&&d.Copy(t,e,i,n,s,r,o,a),this)},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===a&&(a=e.tileWidth),void 0===l&&(l=e.tileHeight),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===i&&(i=0),void 0===n&&(n=0),null!==this.getLayerIndex(t))return console.warn("Cannot create blank layer: layer with matching name already exists "+t),null;for(var u,d=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;fa&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[])}});t.exports=r},function(t,e,i){var n=i(482),s=i(228),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=n(t,o);if(a.x+=e,a.y+=i,t.gid){var h=s(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?(a.ellipse=t.ellipse,a.width=t.width,a.height=t.height):t.text?(a.width=t.width,a.height=t.height,a.text=t.text):(a.rectangle=!0,a.width=t.width,a.height=t.height);return a}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|s,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t-1}return!1}},function(t,e,i){var n=i(19);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionstart",e,i,n)}),d.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionactive",e,i,n)}),d.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionend",e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&p.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&p.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return p.add(this.localWorld,o),o},add:function(t){return p.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return o.removeBody(this.localWorld,i,e),this},removeConstraint:function(t,e){return o.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i0&&u.trigger(t,"collisionStart",{pairs:w.collisionStart}),o.preSolvePosition(w.list),s=0;s0&&u.trigger(t,"collisionActive",{pairs:w.collisionActive}),w.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:w.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(y),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;sf.friction*f.frictionStatic*O*i&&(B=F,I=o.clamp(f.friction*L*i,-B,B));var D=r.cross(A,y),Y=r.cross(_,y),X=w/(g.inverseMass+v.inverseMass+g.inverseInertia*D*D+v.inverseInertia*Y*Y);if(R*=X,I*=X,E<0&&E*E>n._restingThresh*i)T.normalImpulse=0;else{var z=T.normalImpulse;T.normalImpulse=Math.min(T.normalImpulse+R,0),R=T.normalImpulse-z}if(k*k>n._restingThreshTangent*i)T.tangentImpulse=0;else{var N=T.tangentImpulse;T.tangentImpulse=o.clamp(T.tangentImpulse+I,-B,B),I=T.tangentImpulse-N}s.x=y.x*R+m.x*I,s.y=y.y*R+m.y*I,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(A,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(_,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(112),r=i(12);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;ou.bounds.max.x||p.bounds.max.yu.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var y=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,m=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!y&&m&&m&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||y&&!m||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(146),r=i(12);n.name="matter-js",n.version="0.14.2",n.uses=[],n.used=[],n.use=function(){s.use(n,Array.prototype.slice.call(arguments))},n.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(n,t,e)},n.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(n,t,e)}},function(t,e,i){var n=i(437),s=i(0),r=i(113),o=i(17),a=i(1),h=i(132),l=i(56),u=i(3),c=new s({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,s,r,h){o.call(this,t.scene,"Image"),this.anims=new n(this),this.setTexture(s,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=c},function(t,e,i){var n=i(0),s=i(113),r=i(17),o=i(1),a=i(78),h=i(132),l=i(3),u=new n({Extends:a,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,h],initialize:function(t,e,i,n,s,a){r.call(this,t.scene,"Image"),this.setTexture(n,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(63),r=i(73),o=i(12),a=i(25),h=i(54);n.stack=function(t,e,i,n,r,o,h){for(var l,u=s.create({label:"Stack"}),c=t,d=e,f=0,p=0;pg&&(g=m),a.translate(y,{x:.5*x,y:.5*m}),c=y.bounds.max.x+r,s.addBody(u,y),l=y,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;l=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var F=0;FA&&(A+=e.length),S=Number.MAX_VALUE,A<_)return i;for(var L=_;L<=A;++L)o(f(E,F-1),f(E,F),f(E,L))&&h(f(E,F+1),f(E,F),f(E,L))&&(T=d(f(E,F),f(E,L)))3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);r(f(t,e-1),f(t,e),f(t,e+1))||function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))r.ACTIVE&&c(this,t,e))},setCollidesNever:function(t){for(var e=0;e1)for(var h=i/a,l=n/a,u=0;u0?r:0,y=n<0?f:0,m=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var w=Math.floor((e+v)/f);if((l>0||u===w||w<0||w>=p)&&(w=-1),u>=0&&u1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,w,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+y,e=t.pos.x,a=0;break}}if(s){var b=s>0?o:0,T=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),A=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+b)/f);var _=Math.floor((i+b)/f);if((l>0||c===_||_<0||_>=g)&&(_=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,_));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-b+T;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],y=i+s+(g<0?o:0)-d,m=n+r+(p>0?a:0)-f;if(p*m-g*y>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),w=g/x,b=-p/x,T=y*w+m*b,S=w*T,A=b*T;return S*S+A*A>=s*s+r*r?v||p*(m-r)-g*(y-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-A,t.collision.slope={x:p,y:g,nx:w,ny:b},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(91),r=i(571),o=i(90),a=i(570),h=new n({initialize:function(t,e,i,n,r){void 0===n&&(n=16),void 0===r&&(r=n),this.world=t,this.gameObject=null,this.enabled=!0,this.parent,this.id=t.getNextID(),this.name="",this.size={x:n,y:r},this.offset={x:0,y:0},this.pos={x:e,y:i},this.last={x:e,y:i},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:t.defaults.maxVelocityX,y:t.defaults.maxVelocityY},this.standing=!1,this.gravityFactor=t.defaults.gravityFactor,this.bounciness=t.defaults.bounciness,this.minBounceVelocity=t.defaults.minBounceVelocity,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER,this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.updateCallback,this.slopeStanding={min:.767944870877505,max:2.3736477827122884}},reset:function(t,e){this.pos={x:t,y:e},this.last={x:t,y:e},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:100,y:100},this.standing=!1,this.gravityFactor=1,this.bounciness=0,this.minBounceVelocity=40,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER},update:function(t){var e=this.pos;this.last.x=e.x,this.last.y=e.y,this.vel.y+=this.world.gravity*t*this.gravityFactor,this.vel.x=r(t,this.vel.x,this.accel.x,this.friction.x,this.maxVel.x),this.vel.y=r(t,this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var i=this.vel.x*t,n=this.vel.y*t,s=this.world.collisionMap.trace(e.x,e.y,i,n,this.size.x,this.size.y);this.handleMovementTrace(s)&&a(this,s);var o=this.gameObject;o&&(o.x=e.x-this.offset.x+o.displayOriginX*o.scaleX,o.y=e.y-this.offset.y+o.displayOriginY*o.scaleY),this.updateCallback&&this.updateCallback(this)},drawDebug:function(t){var e=this.pos;if(this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.size.x,this.size.y)),this.debugShowVelocity){var i=e.x+this.size.x/2,n=e.y+this.size.y/2;t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.vel.x,n+this.vel.y)}},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},skipHash:function(){return!this.enabled||0===this.type&&0===this.checkAgainst&&0===this.collides},touches:function(t){return!(this.pos.x>=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},function(t,e,i){var n=i(43),s=i(0),r=i(39),o=i(42),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i,n){void 0===i&&(i=this.offset.x),void 0===n&&(n=this.offset.y);var s=this.gameObject;return!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),this.offset.set(i,n),this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(342);function s(t){if(!(this instanceof s))return new s(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,y,m;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),y=Math.min(f.maxX,p.maxX),m=Math.min(f.maxY,p.maxY),o=Math.max(0,y-g)*Math.max(0,m-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;te._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(43),s=i(0),r=i(39),o=i(190),a=i(10),h=i(42),l=i(3),u=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x,e.y),this.prev=new l(e.x,e.y),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.physicsType=r.DYNAMIC_BODY,this._reset=!0,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY;var n=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,n=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},update:function(t){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds();var e=this.transform;if(this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter(),this.rotation=e.rotation,this.preRotation=this.rotation,this._reset&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves){this.world.updateMotion(this,t);var i=this.velocity.x,n=this.velocity.y;this.newVelocity.set(i*t,n*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(n,i),this.speed=Math.sqrt(i*i+n*n),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit("worldbounds",this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y,this.moves&&(0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.gameObject.x+=this._dx,this.gameObject.y+=this._dy,this._reset=!0),this._dx<0?this.facing=r.FACING_LEFT:this._dx>0&&(this.facing=r.FACING_RIGHT),this._dy<0?this.facing=r.FACING_UP:this._dy>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft(this.position),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height)),this.debugShowVelocity&&(t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t){return void 0===t&&(t=!0),this.collideWorldBounds=t,this},setVelocity:function(t,e){return this.velocity.set(t,e),this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},function(t,e,i){var n=i(261),s=i(24),r=i(0),o=i(260),a=i(39),h=i(57),l=i(11),u=i(277),c=i(276),d=i(275),f=i(259),p=i(258),g=i(4),v=i(257),y=i(580),m=i(10),x=i(256),w=i(579),b=i(574),T=i(573),S=i(96),A=i(254),_=i(255),C=i(59),M=i(3),P=i(58),E=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.bodies=new S,this.staticBodies=new S,this.pendingDestroy=new S,this.colliders=new v,this.gravity=new M(g(e,"gravity.x",0),g(e,"gravity.y",0)),this.bounds=new m(g(e,"x",0),g(e,"y",0),g(e,"width",t.sys.game.config.width),g(e,"height",t.sys.game.config.height)),this.checkCollision={up:g(e,"checkCollision.up",!0),down:g(e,"checkCollision.down",!0),left:g(e,"checkCollision.left",!0),right:g(e,"checkCollision.right",!0)},this.fps=g(e,"fps",60),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=g(e,"timeScale",1),this.OVERLAP_BIAS=g(e,"overlapBias",4),this.TILE_BIAS=g(e,"tileBias",16),this.forceX=g(e,"forceX",!1),this.isPaused=g(e,"isPaused",!1),this._total=0,this.drawDebug=g(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:g(e,"debugShowBody",!0),debugShowStaticBody:g(e,"debugShowStaticBody",!0),debugShowVelocity:g(e,"debugShowVelocity",!0),bodyDebugColor:g(e,"debugBodyColor",16711935),staticBodyDebugColor:g(e,"debugStaticBodyColor",255),velocityDebugColor:g(e,"debugVelocityColor",65280)},this.maxEntries=g(e,"maxEntries",16),this.useTree=g(e,"useTree",!0),this.tree=new x(this.maxEntries),this.staticTree=new x(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new C,this._tempMatrix2=new C,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=a.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=s;)this._elapsed-=s,i++,this.step(n);this.stepsLastFrame=i}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(o=(r=s.entries).length,t=0;ta.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,u=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)l.right&&(a=h(u.x,u.y,l.right,l.y)-u.radius):u.y>l.bottom&&(u.xl.right&&(a=h(u.x,u.y,l.right,l.bottom)-u.radius)),a*=-1}else a=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===a||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==a&&(t.onOverlap||e.onOverlap)&&this.emit("overlap",t.gameObject,e.gameObject,t,e),0!==a;var c=t.velocity.x,d=t.velocity.y,g=t.mass,v=e.velocity.x,y=e.velocity.y,m=e.mass,x=c*Math.cos(o)+d*Math.sin(o),w=c*Math.sin(o)-d*Math.cos(o),b=v*Math.cos(o)+y*Math.sin(o),T=v*Math.sin(o)-y*Math.cos(o),S=((g-m)*x+2*m*b)/(g+m),A=(2*g*x+(m-g)*b)/(g+m);t.immovable||(t.velocity.x=(S*Math.cos(o)-w*Math.sin(o))*t.bounce.x,t.velocity.y=(w*Math.cos(o)+S*Math.sin(o))*t.bounce.y,c=t.velocity.x,d=t.velocity.y),e.immovable||(e.velocity.x=(A*Math.cos(o)-T*Math.sin(o))*e.bounce.x,e.velocity.y=(T*Math.cos(o)+A*Math.sin(o))*e.bounce.y,v=e.velocity.x,y=e.velocity.y),Math.abs(o)0&&!t.immovable&&v>c?t.velocity.x*=-1:v<0&&!e.immovable&&c0&&!t.immovable&&y>d?t.velocity.y*=-1:y<0&&!e.immovable&&dMath.PI/2&&(c<0&&!t.immovable&&v0&&!e.immovable&&c>v?e.velocity.x*=-1:d<0&&!t.immovable&&y0&&!e.immovable&&c>y&&(e.velocity.y*=-1));var _=this._frameTime;return t.immovable||(t.x+=t.velocity.x*_-a*Math.cos(o),t.y+=t.velocity.y*_-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*_+a*Math.cos(o),e.y+=e.velocity.y*_+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),t.postUpdate(),e.postUpdate(),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f,p=e.getTilesWithinWorldXY(a,h,l,u);if(0===p.length)return!1;for(var g={left:0,right:0,top:0,bottom:0},v=0;v0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=o[s],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],y=e*o-i*r,m=e*a-n*r,x=e*h-s*r,w=i*a-n*o,b=i*h-s*o,T=n*h-s*a,S=l*p-u*f,A=l*g-c*f,_=l*v-d*f,C=u*g-c*p,M=u*v-d*p,P=c*v-d*g,E=y*P-m*M+x*C+w*_-b*A+T*S;return E?(E=1/E,t[0]=(o*P-a*M+h*C)*E,t[1]=(n*M-i*P-s*C)*E,t[2]=(p*T-g*b+v*w)*E,t[3]=(c*b-u*T-d*w)*E,t[4]=(a*_-r*P-h*A)*E,t[5]=(e*P-n*_+s*A)*E,t[6]=(g*x-f*T-v*m)*E,t[7]=(l*T-c*x+d*m)*E,t[8]=(r*M-o*_+h*S)*E,t[9]=(i*_-e*M-s*S)*E,t[10]=(f*b-p*x+v*y)*E,t[11]=(u*x-l*b-d*y)*E,t[12]=(o*A-r*C-a*S)*E,t[13]=(e*C-i*A+n*S)*E,t[14]=(p*m-f*w-g*y)*E,t[15]=(l*w-u*m+c*y)*E,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=t.val,x=m[0],w=m[1],b=m[2],T=m[3];return e[0]=x*i+w*o+b*u+T*p,e[1]=x*n+w*a+b*c+T*g,e[2]=x*s+w*h+b*d+T*v,e[3]=x*r+w*l+b*f+T*y,x=m[4],w=m[5],b=m[6],T=m[7],e[4]=x*i+w*o+b*u+T*p,e[5]=x*n+w*a+b*c+T*g,e[6]=x*s+w*h+b*d+T*v,e[7]=x*r+w*l+b*f+T*y,x=m[8],w=m[9],b=m[10],T=m[11],e[8]=x*i+w*o+b*u+T*p,e[9]=x*n+w*a+b*c+T*g,e[10]=x*s+w*h+b*d+T*v,e[11]=x*r+w*l+b*f+T*y,x=m[12],w=m[13],b=m[14],T=m[15],e[12]=x*i+w*o+b*u+T*p,e[13]=x*n+w*a+b*c+T*g,e[14]=x*s+w*h+b*d+T*v,e[15]=x*r+w*l+b*f+T*y,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],y=i[7],m=i[8],x=i[9],w=i[10],b=i[11],T=n*n*l+h,S=s*n*l+r*a,A=r*n*l-s*a,_=n*s*l-r*a,C=s*s*l+h,M=r*s*l+n*a,P=n*r*l+s*a,E=s*r*l-n*a,k=r*r*l+h;return i[0]=u*T+p*S+m*A,i[1]=c*T+g*S+x*A,i[2]=d*T+v*S+w*A,i[3]=f*T+y*S+b*A,i[4]=u*_+p*C+m*M,i[5]=c*_+g*C+x*M,i[6]=d*_+v*C+w*M,i[7]=f*_+y*C+b*M,i[8]=u*P+p*E+m*k,i[9]=c*P+g*E+x*k,i[10]=d*P+v*E+w*k,i[11]=f*P+y*E+b*k,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,y=o*h,m=o*l;return i[0]=1-(f+g),i[1]=c+m,i[2]=d-y,i[3]=0,i[4]=c-m,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+y,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,y=r*h;return e[0]=1-(d+p),e[1]=u+y,e[2]=c-v,e[3]=0,e[4]=u-y,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),y=h*(g*=v)-l*(p*=v),m=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(y*y+m*m+x*x))?(y*=v=1/v,m*=v,x*=v):(y=0,m=0,x=0);var w=p*x-g*m,b=g*y-f*x,T=f*m-p*y;return(v=Math.sqrt(w*w+b*b+T*T))?(w*=v=1/v,b*=v,T*=v):(w=0,b=0,T=0),n[0]=y,n[1]=w,n[2]=f,n[3]=0,n[4]=m,n[5]=b,n[6]=p,n[7]=0,n[8]=x,n[9]=T,n[10]=g,n[11]=0,n[12]=-(y*s+m*r+x*o),n[13]=-(w*s+b*r+T*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],y=c[5],m=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+y*h,e[4]=g*n+v*o+y*l,e[5]=g*s+v*a+y*u,e[6]=m*i+x*r+w*h,e[7]=m*n+x*o+w*l,e[8]=m*s+x*a+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,y=this.val;return y[0]=1-(c+f),y[3]=l+v,y[6]=u-g,y[1]=l-v,y[4]=1-(h+f),y[7]=d+p,y[2]=u+g,y[5]=d-p,y[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],x=n*h-s*a,w=n*l-r*a,b=n*u-o*a,T=s*l-r*h,S=s*u-o*h,A=r*u-o*l,_=c*v-d*g,C=c*y-f*g,M=c*m-p*g,P=d*y-f*v,E=d*m-p*v,k=f*m-p*y,F=x*k-w*E+b*P+T*M-S*C+A*_;return F?(F=1/F,i[0]=(h*k-l*E+u*P)*F,i[1]=(l*M-a*k-u*C)*F,i[2]=(a*E-h*M+u*_)*F,i[3]=(r*E-s*k-o*P)*F,i[4]=(n*k-r*M+o*C)*F,i[5]=(s*M-n*E-o*_)*F,i[6]=(v*A-y*S+m*T)*F,i[7]=(y*b-g*A-m*w)*F,i[8]=(g*S-v*b+m*x)*F,this):null}});t.exports=n},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e,i){var n=i(273);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),te-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)=0?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(20),r=i(22),o=i(7),a=i(1),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="txt";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"text",cache:t.cacheManager.text,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",function(t,e,i){if(Array.isArray(t))for(var n=0;n=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=this.threshold?this.pressed||(this.pressed=!0,this.events.emit("down",e,this,t),this.pad.emit("down",i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit("up",e,this,t),this.pad.emit("up",i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){t.exports={CircleToCircle:i(769),CircleToRectangle:i(768),GetRectangleIntersection:i(767),LineToCircle:i(301),LineToLine:i(117),LineToRectangle:i(766),PointToLine:i(300),PointToLineSegment:i(765),RectangleToRectangle:i(163),RectangleToTriangle:i(764),RectangleToValues:i(763),TriangleToCircle:i(762),TriangleToLine:i(761),TriangleToTriangle:i(760)}},function(t,e,i){t.exports={Circle:i(789),Ellipse:i(779),Intersects:i(302),Line:i(759),Point:i(741),Polygon:i(727),Rectangle:i(294),Triangle:i(698)}},function(t,e,i){var n=i(0),s=i(305),r=i(183),o=i(9),a=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1},enable:function(){return this.active=!0,this},disable:function(){return this.active=!1,this},cull:function(t){var e=this.lights,i=this.culledLights,n=e.length,s=t.x+t.width/2,o=t.y+t.height/2,a=(t.width+t.height)/2,h={x:0,y:0},l=t.matrix,u=this.systems.game.config.height;i.length=0;for(var c=0;c0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],r):h=new s(t,e,i,a[0],a[1],a[2],r),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=a},function(t,e,i){var n=i(0),s=i(9),r=new n({initialize:function(t,e,i,n,s,r,o){this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1},set:function(t,e,i,n,s,r,o){return this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1,this},setScrollFactor:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this},setColor:function(t){var e=s.getFloatsFromUintRGB(t);return this.r=e[0],this.g=e[1],this.b=e[2],this},setIntensity:function(t){return this.intensity=t,this},setPosition:function(t,e){return this.x=t,this.y=e,this},setRadius:function(t){return this.radius=t,this}});t.exports=r},function(t,e,i){var n=i(71),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e,i){var n=i(6),s=i(71);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(0),s=i(30),r=i(66),o=i(838),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),s.call(this,t,"Triangle",new r(n,o,a,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,s,r){return this.geom.setTo(t,e,i,n,s,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(841),s=i(0),r=i(70),o=i(30),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(71),s=i(60);t.exports=function(t){for(var e=t.points,i=0,r=0;rc+v)){var y=g.getPoint((u-c)/v);o.push(y);break}c+=v}return o}},function(t,e,i){var n=i(10);t.exports=function(t,e){void 0===e&&(e=new n);for(var i,s=1/0,r=1/0,o=-s,a=-r,h=0;h0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=i(72),s=i(0),r=i(16),o=i(330),a=i(329),h=i(888),l=i(1),u=i(177),c=i(327),d=i(77),f=i(332),p=i(326),g=i(10),v=i(120),y=i(3),m=i(58),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0),this.y=new h(e,"y",0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3),this.angle=new h(e,"angle",{min:0,max:360}),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new y,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0?n.pop():new this.particleClass(this)).fire(e,i),this.particleBringToTop?this.alive.push(r):this.alive.unshift(r),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,r,this),this.atLimit())break}return r}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);for(var n=this.manager.getProcessors(),s=this.alive,r=s.length,o=0;o0){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y},indexSortCallback:function(t,e){return t.index-e.index}});t.exports=x},function(t,e,i){var n=i(0),s=i(36),r=i(57),o=new n({initialize:function(t){this.emitter=t,this.frame=null,this.index=0,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint"),this.index=i.alive.length},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s>>16,m=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+y+","+m+","+x+","+d+")",c.lineWidth=v,w+=3;break;case n.FILL_STYLE:g=l[w+1],f=l[w+2],y=(16711680&g)>>>16,m=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+y+","+m+","+x+","+f+")",w+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[w+1],l[w+2],l[w+3],l[w+4]):c.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.fill(),w+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.stroke(),w+=6;break;case n.LINE_TO:c.lineTo(l[w+1],l[w+2]),w+=2;break;case n.MOVE_TO:c.moveTo(l[w+1],l[w+2]),w+=2;break;case n.LINE_FX_TO:c.lineTo(l[w+1],l[w+2]),w+=5;break;case n.MOVE_FX_TO:c.moveTo(l[w+1],l[w+2]),w+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[w+1],l[w+2]),w+=2;break;case n.SCALE:c.scale(l[w+1],l[w+2]),w+=2;break;case n.ROTATE:c.rotate(l[w+1]),w+=1;break;case n.GRADIENT_FILL_STYLE:w+=5;break;case n.GRADIENT_LINE_STYLE:w+=6;break;case n.SET_TEXTURE:w+=2}c.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var n=i(335),s=i(171),r=i(103),o=i(18);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(4),s=i(131),r=function(t,e,i){for(var n=[],s=0;sr;){if(o-r>600){var h=o-r+1,l=e-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*c/h+d)),p=Math.min(o,Math.floor(e+(h-l)*c/h+d));i(t,e,f,p,a)}var g=t[e],v=r,y=o;for(n(t,r,e),a(t[o],g)>0&&n(t,r,o);v0;)y--}0===a(t[r],g)?n(t,r,y):n(t,++y,o),y<=e&&(r=y+1),e<=y&&(o=y-1)}};function n(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function s(t,e){return te?1:0}t.exports=i},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s-1;r--)n[s][r]=t[r][s]}return n}},function(t,e,i){var n=i(947),s=i(0),r=i(102),o=i(11),a=i(946),h=i(944),l=i(943),u=new s({Extends:o,initialize:function(t){o.call(this),this.game=t,this.data=new r(this),this.on("setdata",this.setDataHandler,this),this.on("changedata",this.changeDataHandler,this),this.hasLoaded=!1,this.dataLocked=!1,this.supportedAPIs=[],this.entryPoint="",this.entryPointData=null,this.contextID=null,this.contextType=null,this.locale=null,this.platform=null,this.version=null,this.playerID=null,this.playerName=null,this.playerPhotoURL=null,this.playerCanSubscribeBot=!1,this.paymentsReady=!1,this.catalog=[],this.purchases=[],this.leaderboards={},this.ads=[]},setDataHandler:function(t,e,i){if(!this.dataLocked){var n={};n[e]=i;var s=this;FBInstant.player.setDataAsync(n).then(function(){s.emit("savedata",n)})}},changeDataHandler:function(t,e,i){if(!this.dataLocked){var n={};n[e]=i;var s=this;FBInstant.player.setDataAsync(n).then(function(){s.emit("savedata",n)})}},showLoadProgress:function(t){return t.load.on("progress",function(t){this.hasLoaded||FBInstant.setLoadingProgress(100*t)},this),t.load.on("complete",function(){this.hasLoaded||(this.hasLoaded=!0,FBInstant.startGameAsync().then(this.gameStarted.bind(this)))},this),this},gameStarted:function(){var t={},e=function(t){return t[1].toUpperCase()};FBInstant.getSupportedAPIs().forEach(function(i){i=i.replace(/\../g,e),t[i]=!0}),this.supportedAPIs=t,this.getID(),this.getType(),this.getLocale(),this.getPlatform(),this.getSDKVersion(),this.getPlayerID(),this.getPlayerName(),this.getPlayerPhotoURL();var i=this;FBInstant.onPause(function(){i.emit("pause")}),FBInstant.getEntryPointAsync().then(function(t){i.entryPoint=t,i.entryPointData=FBInstant.getEntryPointData(),i.emit("startgame")}).catch(function(t){console.warn(t)}),this.supportedAPIs.paymentsPurchaseAsync&&FBInstant.payments.onReady(function(){i.paymentsReady=!0}).catch(function(t){console.warn(t)})},checkAPI:function(t){return!!this.supportedAPIs[t]},getID:function(){return!this.contextID&&this.supportedAPIs.contextGetID&&(this.contextID=FBInstant.context.getID()),this.contextID},getType:function(){return!this.contextType&&this.supportedAPIs.contextGetType&&(this.contextType=FBInstant.context.getType()),this.contextType},getLocale:function(){return!this.locale&&this.supportedAPIs.getLocale&&(this.locale=FBInstant.getLocale()),this.locale},getPlatform:function(){return!this.platform&&this.supportedAPIs.getPlatform&&(this.platform=FBInstant.getPlatform()),this.platform},getSDKVersion:function(){return!this.version&&this.supportedAPIs.getSDKVersion&&(this.version=FBInstant.getSDKVersion()),this.version},getPlayerID:function(){return!this.playerID&&this.supportedAPIs.playerGetID&&(this.playerID=FBInstant.player.getID()),this.playerID},getPlayerName:function(){return!this.playerName&&this.supportedAPIs.playerGetName&&(this.playerName=FBInstant.player.getName()),this.playerName},getPlayerPhotoURL:function(){return!this.playerPhotoURL&&this.supportedAPIs.playerGetPhoto&&(this.playerPhotoURL=FBInstant.player.getPhoto()),this.playerPhotoURL},loadPlayerPhoto:function(t,e){return this.playerPhotoURL&&(t.load.setCORS("anonymous"),t.load.image(e,this.playerPhotoURL),t.load.once("filecomplete_image_"+e,function(){this.emit("photocomplete",e)},this),t.load.start()),this},canSubscribeBot:function(){if(this.supportedAPIs.playerCanSubscribeBotAsync){var t=this;FBInstant.player.canSubscribeBotAsync().then(function(){t.playerCanSubscribeBot=!0,t.emit("cansubscribebot")}).catch(function(e){t.emit("cansubscribebotfail",e)})}else this.emit("cansubscribebotfail");return this},subscribeBot:function(){if(this.playerCanSubscribeBot){var t=this;FBInstant.player.subscribeBotAsync().then(function(){t.emit("subscribebot")}).catch(function(e){t.emit("subscribebotfail",e)})}else this.emit("subscribebotfail");return this},getData:function(t){if(!this.checkAPI("playerGetDataAsync"))return this;Array.isArray(t)||(t=[t]);var e=this;return FBInstant.player.getDataAsync(t).then(function(t){for(var i in e.dataLocked=!0,t)e.data.set(i,t[i]);e.dataLocked=!1,e.emit("getdata",t)}),this},saveData:function(t){if(!this.checkAPI("playerSetDataAsync"))return this;var e=this;return FBInstant.player.setDataAsync(t).then(function(){e.emit("savedata",t)}).catch(function(t){e.emit("savedatafail",t)}),this},flushData:function(){if(!this.checkAPI("playerFlushDataAsync"))return this;var t=this;return FBInstant.player.flushDataAsync().then(function(){t.emit("flushdata")}).catch(function(e){t.emit("flushdatafail",e)}),this},getStats:function(t){if(!this.checkAPI("playerGetStatsAsync"))return this;var e=this;return FBInstant.player.getStatsAsync(t).then(function(t){e.emit("getstats",t)}).catch(function(t){e.emit("getstatsfail",t)}),this},saveStats:function(t){if(!this.checkAPI("playerSetStatsAsync"))return this;var e={};for(var i in t)"number"==typeof t[i]&&(e[i]=t[i]);var n=this;return FBInstant.player.setStatsAsync(e).then(function(){n.emit("savestats",e)}).catch(function(t){n.emit("savestatsfail",t)}),this},incStats:function(t){if(!this.checkAPI("playerIncrementStatsAsync"))return this;var e={};for(var i in t)"number"==typeof t[i]&&(e[i]=t[i]);var n=this;return FBInstant.player.incrementStatsAsync(e).then(function(t){n.emit("incstats",t)}).catch(function(t){n.emit("incstatsfail",t)}),this},saveSession:function(t){return this.checkAPI("setSessionData")?(JSON.stringify(t).length<=1e3?FBInstant.setSessionData(t):console.warn("Session data too long. Max 1000 chars."),this):this},openShare:function(t,e,i,n){return this._share("SHARE",t,e,i,n)},openInvite:function(t,e,i,n){return this._share("INVITE",t,e,i,n)},openRequest:function(t,e,i,n){return this._share("REQUEST",t,e,i,n)},openChallenge:function(t,e,i,n){return this._share("CHALLENGE",t,e,i,n)},_share:function(t,e,i,n,s){if(!this.checkAPI("shareAsync"))return this;if(void 0===s&&(s={}),i)var r=this.game.textures.getBase64(i,n);var o={intent:t,image:r,text:e,data:s},a=this;return FBInstant.shareAsync(o).then(function(){a.emit("resume")}),this},isSizeBetween:function(t,e){return this.checkAPI("contextIsSizeBetween")?FBInstant.context.isSizeBetween(t,e):this},switchContext:function(t){if(!this.checkAPI("contextSwitchAsync"))return this;if(t!==this.contextID){var e=this;FBInstant.context.switchAsync(t).then(function(){e.contextID=FBInstant.context.getID(),e.emit("switch",e.contextID)}).catch(function(t){e.emit("switchfail",t)})}return this},chooseContext:function(t){if(!this.checkAPI("contextChoseAsync"))return this;var e=this;return FBInstant.context.chooseAsync(t).then(function(){e.contextID=FBInstant.context.getID(),e.emit("choose",e.contextID)}).catch(function(t){e.emit("choosefail",t)}),this},createContext:function(t){if(!this.checkAPI("contextCreateAsync"))return this;var e=this;return FBInstant.context.createAsync(t).then(function(){e.contextID=FBInstant.context.getID(),e.emit("create",e.contextID)}).catch(function(t){e.emit("createfail",t)}),this},getPlayers:function(){if(!this.checkAPI("playerGetConnectedPlayersAsync"))return this;var t=this;return FBInstant.player.getConnectedPlayersAsync().then(function(e){t.emit("players",e)}).catch(function(e){t.emit("playersfail",e)}),this},getCatalog:function(){if(!this.paymentsReady)return this;var t=this,e=this.catalog;return FBInstant.payments.getCatalogAsync().then(function(i){e=[],i.forEach(function(t){e.push(h(t))}),t.emit("getcatalog",e)}).catch(function(e){t.emit("getcatalogfail",e)}),this},purchase:function(t,e){if(!this.paymentsReady)return this;var i={productID:t};e&&(i.developerPayload=e);var n=this;return FBInstant.payments.purchaseAsync(i).then(function(t){var e=l(t);n.emit("purchase",e)}).catch(function(t){n.emit("purchasefail",t)}),this},getPurchases:function(){if(!this.paymentsReady)return this;var t=this,e=this.purchases;return FBInstant.payments.getPurchasesAsync().then(function(i){e=[],i.forEach(function(t){e.push(l(t))}),t.emit("getpurchases",e)}).catch(function(e){t.emit("getpurchasesfail",e)}),this},consumePurchases:function(t){if(!this.paymentsReady)return this;var e=this;return FBInstant.payments.consumePurchaseAsync(t).then(function(){e.emit("consumepurchase",t)}).catch(function(t){e.emit("consumepurchasefail",t)}),this},update:function(t,e,i,n,s,r){return this._update("CUSTOM",t,e,i,n,s,r)},updateLeaderboard:function(t,e,i,n,s,r){return this._update("LEADERBOARD",t,e,i,n,s,r)},_update:function(t,e,i,n,s,r,o){if(!this.checkAPI("shareAsync"))return this;if(void 0===e&&(e=""),"string"==typeof i&&(i={default:i}),void 0===o&&(o={}),n)var a=this.game.textures.getBase64(n,s);var h={action:t,cta:e,image:a,text:i,template:r,data:o,strategy:"IMMEDIATE",notification:"NO_PUSH"},l=this;return FBInstant.updateAsync(h).then(function(){l.emit("update")}).catch(function(t){l.emit("updatefail",t)}),this},switchGame:function(t,e){if(!this.checkAPI("switchGameAsync"))return this;if(e&&JSON.stringify(e).length>1e3)return console.warn("Switch Game data too long. Max 1000 chars."),this;var i=this;return FBInstant.switchGameAsync(t,e).then(function(){i.emit("switchgame",t)}).catch(function(t){i.emit("switchgamefail",t)}),this},createShortcut:function(){var t=this;return FBInstant.canCreateShortcutAsync().then(function(e){e&&FBInstant.createShortcutAsync().then(function(){t.emit("shortcutcreated")}).catch(function(e){t.emit("shortcutfailed",e)})}),this},quit:function(){FBInstant.quit()},log:function(t,e,i){return this.checkAPI("logEvent")?(void 0===i&&(i={}),t.length>=2&&t.length<=40&&FBInstant.logEvent(t,parseFloat(e),i),this):this},preloadAds:function(t){if(!this.checkAPI("getInterstitialAdAsync"))return this;var e;Array.isArray(t)||(t=[t]);var i=this,s=0;for(e=0;e=3)return console.warn("Too many AdInstances. Show an ad before loading more"),this;for(e=0;e=3)return console.warn("Too many AdInstances. Show an ad before loading more"),this;for(e=0;e=r.x&&t=r.y&&e=r.x&&t=r.y&&e0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit("resume",this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit("stop",this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,"rate",t)||(this.calculateRate(),this.emit("rate",this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,"detune",t)||(this.calculateRate(),this.emit("detune",this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit("loop",this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(125),s=i(0),r=i(353),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var n=0;n-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit("transitioninit",n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once("complete",this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},resize:function(t,e){for(var i=0;i=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e,i){var n=i(0),s=i(11),r=i(7),o=i(14),a=i(5),h=i(1),l=i(15),u=i(360),c=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once("boot",this.boot,this)},boot:function(){var t,e,i,n,s,r,o,a=this.game.config,l=a.installGlobalPlugins;for(l=l.concat(this._pendingGlobal),t=0;t10&&(t=10-this.pointersTotal);for(var i=0;i0},queueTouchStart:function(t){if(this.queue.push(s.TOUCH_START,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueTouchMove:function(t){if(this.queue.push(s.TOUCH_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueTouchEnd:function(t){if(this.queue.push(s.TOUCH_END,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},queueMouseDown:function(t){if(this.queue.push(s.MOUSE_DOWN,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueMouseMove:function(t){if(this.queue.push(s.MOUSE_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueMouseUp:function(t){if(this.queue.push(s.MOUSE_UP,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},addUpCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.upOnce.push(t):this.domCallbacks.up.push(t),this._hasUpCallback=!0,this},addDownCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.downOnce.push(t):this.domCallbacks.down.push(t),this._hasDownCallback=!0,this},addMoveCallback:function(t,e){return void 0===e&&(e=!1),e?this.domCallbacks.moveOnce.push(t):this.domCallbacks.move.push(t),this._hasMoveCallback=!0,this},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var n=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){n=!1;break}s=s.parentContainer}while(s);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;1!==i.resolution&&(a+=i._x,h+=i._y),i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this._tempMatrix,d=this._tempMatrix2,f=0;f0&&n>0&&s.scissor(t,this.drawingBufferHeight-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},setBlendMode:function(t){var e=this.gl,i=this.blendModes[t];return t!==r.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),i.func.length>2?e.blendFuncSeparate(i.func[0],i.func[1],i.func[2],i.func[3]):e.blendFunc(i.func[0],i.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>16&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e){var i=this.gl;return t!==this.currentTextures[e]&&(this.flush(),this.currentActiveTextureUnit!==e&&(i.activeTexture(i.TEXTURE0+e),this.currentActiveTextureUnit=e),i.bindTexture(i.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t){var e=this.gl,i=this.width,n=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(i=t.renderTexture.width,n=t.renderTexture.height):this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),e.viewport(0,0,i,n),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,a=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,o(e,i)&&(h=s.REPEAT),n===r.ScaleModes.LINEAR&&this.config.antialias&&(a=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,a,h,h,s.RGBA,t):this.createTexture2D(0,a,a,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&a(this.nativeTextures,e),this.gl.deleteTexture(t),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,s=t._ch,r=this.pipelines.TextureTintPipeline,o=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-s),this.setFramebuffer(t.framebuffer);var a=this.gl;a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),r.projOrtho(e,n+e,i,s+i,-1e3,1e3),o.alphaGL>0&&r.drawFillRect(e,i,n+e,s+i,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL),t.emit("prerender",t)}else o.alphaGL>0?(this.pushScissor(e,i,n,s),r.drawFillRect(e,i,n,s,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL)):this.pushScissor(e,i,n,s)},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,l.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,l.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit("postrender",t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=l.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n in this.config.clearBeforeRender&&(t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)),t.enable(t.SCISSOR_TEST),i)i[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,o=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=0;l=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===m&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(y,m),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=u},function(t,e,i){var n,s,r,o=i(26),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e,i){t.exports={os:i(101),browser:i(128),features:i(186),input:i(973),audio:i(972),video:i(971),fullscreen:i(970),canvasFeatures:i(375)}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(i){t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(101);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova&&!n.cocoonJS?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e,i){var n=i(41);n.ColorToRGBA=i(986),n.ComponentToHex=i(382),n.GetColor=i(196),n.GetColor32=i(412),n.HexStringToColor=i(413),n.HSLToColor=i(985),n.HSVColorWheel=i(984),n.HSVToRGB=i(195),n.HueToComponent=i(381),n.IntegerToColor=i(410),n.IntegerToRGB=i(409),n.Interpolate=i(983),n.ObjectToColor=i(408),n.RandomRGB=i(982),n.RGBStringToColor=i(407),n.RGBToHSV=i(411),n.RGBToString=i(981),n.ValueToColor=i(197),t.exports=n},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(189),s=i(0),r=i(80),o=i(3),a=new s({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;ei;)n-=i;n16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(41),s=i(409);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(ef.right&&(p=u(p,p+(v-f.right),this.lerp.x)),yf.bottom&&(g=u(g,g+(y-f.bottom),this.lerp.y))):(p=u(p,v-l,this.lerp.x),g=u(g,y-c,this.lerp.y))}this.useBounds&&(p=this.clampX(p),g=this.clampY(g)),this.roundPixels&&(l=Math.round(l),c=Math.round(c)),this.scrollX=p,this.scrollY=g;var m=p+s,x=g+o;this.midPoint.set(m,x);var w=i/a,b=n/a;this.worldView.setTo(m-w/2,x-b/2,w,b),h.loadIdentity(),h.scale(e,e),h.translate(this.x+l,this.y+c),h.rotate(this.rotation),h.scale(a,a),h.translate(-l,-c),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(416),s=new(i(0))({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once("destroy",this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","text","html","obj","tilemap","xml"],e=0;ee.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=i(24),s=i(0),r=i(419),o=i(418),a=i(4),h=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,a(i,"frames",[]),a(i,"defaultTextureKey",null)),this.frameRate=a(i,"frameRate",null),this.duration=a(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=a(i,"skipMissedFrames",!0),this.delay=a(i,"delay",0),this.repeat=a(i,"repeat",0),this.repeatDelay=a(i,"repeatDelay",0),this.yoyo=a(i,"yoyo",!1),this.showOnStart=a(i,"showOnStart",!1),this.hideOnComplete=a(i,"hideOnComplete",!1),this.paused=!1,this.manager.on("pauseall",this.pause,this),this.manager.on("resumeall",this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=l[0],l[0].prevFrame=s;var v=1/(l.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),r(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);t._repeatDelay>0&&!1===t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay):(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter)))},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off("pauseall",this.pause,this),this.manager.off("resumeall",this.resume,this),this.manager.remove(this.key);for(var t=0;t-h&&(c-=h,n+=l),f=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(18),s=i(59),r=i(206),o=i(205),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t}};t.exports=a},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){this.geometryMask=t},preRenderWebGL:function(t,e,i){var n=t.gl,s=this.geometryMask;t.flush(),n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.NOTEQUAL,1,1),n.stencilOp(n.REPLACE,n.REPLACE,n.REPLACE),s.renderWebGL(t,s,0,i),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilFunc(n.EQUAL,1,1),n.stencilOp(n.KEEP,n.KEEP,n.KEEP)},postRenderWebGL:function(t){var e=t.gl;t.flush(),e.disable(e.STENCIL_TEST)},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){var i=t.sys.game.renderer;if(this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,i&&i.gl){var n=i.width,s=i.height,r=0==(n&n-1)&&0==(s&s-1),o=i.gl,a=r?o.REPEAT:o.CLAMP_TO_EDGE,h=o.LINEAR;this.mainTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.maskTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.mainFramebuffer=i.createFramebuffer(n,s,this.mainTexture,!1),this.maskFramebuffer=i.createFramebuffer(n,s,this.maskTexture,!1),i.onContextRestored(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,o=s.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!1),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!1)},this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t){t.pipelines.BitmapMaskPipeline.endMask(this)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null;var t=this.renderer;t&&t.gl&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer)),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null,this.renderer=null}});t.exports=n},function(t,e,i){var n=i(430),s=i(429),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&this.texture&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*s-a*r+e,t.y=o*r+a*s+i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var n=i(210),s=i(133);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once("remove",this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,this._timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this._delay=0,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this.forward=!0,this._reverse=!1,this.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},setDelay:function(t){return void 0===t&&(t=0),this._delay=t,this.parent},getDelay:function(){return this._delay},delayedPlay:function(t,e,i){return this.play(e,!0,i),this.nextTick+=t,this.parent},getCurrentKey:function(){if(this.currentAnim)return this.currentAnim.key},load:function(t,e){return void 0===e&&(e=0),this.isPlaying&&this.stop(),this.animationManager.load(this,t,e),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.updateFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.updateFrame(t),this.parent},isPaused:{get:function(){return this._paused}},play:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!0,this._reverse=!1,this._startAnimation(t,i))},playReverse:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!1,this._reverse=!0,this._startAnimation(t,i))},_startAnimation:function(t,e){this.load(t,e);var i=this.currentAnim,n=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,i.showOnStart&&(n.visible=!0),n.emit("animationstart",this.currentAnim,this.currentFrame),n},reverse:function(t){return this.isPlaying&&this.currentAnim.key===t?(this._reverse=!this._reverse,this.forward=!this.forward,this.parent):this.parent},getProgress:function(){var t=this.currentFrame.progress;return this.forward||(t=1-t),t},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},remove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},getRepeat:function(){return this._repeat},setRepeat:function(t){return this._repeat=t,this.repeatCounter=0,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){return void 0===t&&(t=!1),this.currentAnim.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(this.currentAnim.frames[0]),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent;return t.emit("animationcomplete",this.currentAnim,this.currentFrame),t},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopOnRepeat:function(){return this._pendingStop=2,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},setTimeScale:function(t){return void 0===t&&(t=1),this._timeScale=t,this.parent},getTimeScale:function(){return this._timeScale},getTotalFrames:function(){return this.currentAnim.frames.length},update:function(t,e){if(this.currentAnim&&this.isPlaying&&!this.currentAnim.paused){if(this.accumulator+=e*this._timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.currentAnim.completeAnimation(this);this.accumulator>=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit("animationupdate",i,t),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off("remove",this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=n},function(t,e,i){var n=i(24),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var n=i(439),s=i(212),r=i(103),o=i(18);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;i--){var n=Math.floor(this.frac()*(e+1)),s=t[n];t[n]=t[i],t[i]=s}return t}});t.exports=n},function(t,e,i){var n=i(212),s=i(103),r=i(18),o=i(6);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(47),s=i(45),r=i(46),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(49),s=i(45),r=i(48),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(85),s=i(45),r=i(84),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(82),s=i(47),r=i(83),o=i(46);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(82),s=i(49),r=i(83),o=i(48);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(84),s=i(83);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(448),s=i(85),r=i(82);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(51),s=i(47),r=i(50),o=i(46);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(51),s=i(49),r=i(50),o=i(48);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(51),s=i(85),r=i(50),o=i(84);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(213),s=[];s[n.BOTTOM_CENTER]=i(452),s[n.BOTTOM_LEFT]=i(451),s[n.BOTTOM_RIGHT]=i(450),s[n.CENTER]=i(449),s[n.LEFT_CENTER]=i(447),s[n.RIGHT_CENTER]=i(446),s[n.TOP_CENTER]=i(445),s[n.TOP_LEFT]=i(444),s[n.TOP_RIGHT]=i(443);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){t.exports={Angle:i(1121),Call:i(1120),GetFirst:i(1119),GetLast:i(1118),GridAlign:i(1117),IncAlpha:i(1106),IncX:i(1105),IncXY:i(1104),IncY:i(1103),PlaceOnCircle:i(1102),PlaceOnEllipse:i(1101),PlaceOnLine:i(1100),PlaceOnRectangle:i(1099),PlaceOnTriangle:i(1098),PlayAnimation:i(1097),PropertyValueInc:i(37),PropertyValueSet:i(27),RandomCircle:i(1096),RandomEllipse:i(1095),RandomLine:i(1094),RandomRectangle:i(1093),RandomTriangle:i(1092),Rotate:i(1091),RotateAround:i(1090),RotateAroundDistance:i(1089),ScaleX:i(1088),ScaleXY:i(1087),ScaleY:i(1086),SetAlpha:i(1085),SetBlendMode:i(1084),SetDepth:i(1083),SetHitArea:i(1082),SetOrigin:i(1081),SetRotation:i(1080),SetScale:i(1079),SetScaleX:i(1078),SetScaleY:i(1077),SetTint:i(1076),SetVisible:i(1075),SetX:i(1074),SetXY:i(1073),SetY:i(1072),ShiftPosition:i(1071),Shuffle:i(1070),SmootherStep:i(1069),SmoothStep:i(1068),Spread:i(1067),ToggleVisible:i(1066),WrapInRectangle:i(1065)}},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,function(t,i){return e[Number(i)-1]})}},function(t,e,i){t.exports={Format:i(456),Pad:i(198),Reverse:i(455),UppercaseFirst:i(357),UUID:i(324)}},function(t,e,i){var n=i(69);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)&&(i[s]=e[s]);return i}},function(t,e){t.exports=function(t,e){for(var i=0;i-1&&(e.state=a.REMOVED,s.splice(r,1)):(e.state=a.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t0){var s=t.gl,r=this.pipeline,o=r.vertexBuffer,a=e.tileset.glTexture;t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer,t.setPipeline(r),t.setTexture2D(a,0),s.drawArrays(r.topology,0,e.vertexCount),r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}}},function(t,e,i){var n=i(2),s=i(2);n=i(472),s=i(471),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.tileset,c=t.currentContext,d=u.image.getSourceImage();c.save(),l.copyToContext(c);for(var f=n.alpha*e.alpha,p=0;p-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(21);t.exports=function(t){for(var e,i,s,r,o,a=0;a>>0;return n}},function(t,e,i){var n=i(485),s=i(1),r=i(87),o=i(228),a=i(61);t.exports=function(t,e){for(var i=[],h=0;h0){var y=new a(u,v.gid,c,f.length,t.tilewidth,t.tileheight);y.rotation=v.rotation,y.flipX=v.flipped,d.push(y)}else{var m=e?null:new a(u,-1,c,f.length,t.tilewidth,t.tileheight);d.push(m)}++c===l.width&&(f.push(d),c=0,d=[])}u.data=f,i.push(u)}}return i}},function(t,e,i){t.exports={Parse:i(231),Parse2DArray:i(141),ParseCSV:i(230),Impact:i(224),Tiled:i(229)}},function(t,e,i){var n=i(53),s=i(52),r=i(3);t.exports=function(t,e,i,o,a,h){return void 0===o&&(o=new r(0,0)),o.x=n(t,i,a,h),o.y=s(e,i,a,h),o}},function(t,e,i){var n=i(19);t.exports=function(t,e,i,s,r,o){if(void 0!==r){var a,h=n(t,e,i,s,null,o),l=0;for(a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e,i){var n=i(62),s=i(38),r=i(77);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;ae)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(62),s=i(38),r=i(142);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=m;a--)for(o=v;o=m;a--)for(o=y;o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(109),s=i(108),r=i(19),o=i(234);t.exports=function(t,e,i,a,h,l){void 0===i&&(i={}),Array.isArray(t)||(t=[t]);var u=l.tilemapLayer;void 0===a&&(a=u.scene),void 0===h&&(h=a.cameras.main);var c,d=r(0,0,l.width,l.height,null,l),f=[];for(c=0;c=0&&p=0&&g=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("update",this.step,this),t.events.emit("transitioncomplete",this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i){return this.manager.add(t,e,i),this},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off("shutdown",this.shutdown,this),t.off("postupdate",this.step,this),t.off("transitionout")},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",a,"scenePlugin"),t.exports=a},function(t,e,i){var n=i(126),s=i(21),r={SceneManager:i(359),ScenePlugin:i(522),Settings:i(356),Systems:i(181)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={BitmapMaskPipeline:i(369),ForwardDiffuseLightPipeline:i(183),TextureTintPipeline:i(182)}},function(t,e,i){t.exports={Utils:i(9),WebGLPipeline:i(184),WebGLRenderer:i(371),Pipelines:i(524),BYTE:0,SHORT:1,UNSIGNED_BYTE:2,UNSIGNED_SHORT:3,FLOAT:4}},function(t,e,i){t.exports={Canvas:i(373),WebGL:i(370)}},function(t,e,i){t.exports={CanvasRenderer:i(374),GetBlendModes:i(372),SetTransform:i(23)}},function(t,e,i){t.exports={Canvas:i(527),Snapshot:i(526),WebGL:i(525)}},function(t,e,i){var n=i(235),s=new(i(0))({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=s},function(t,e,i){t.exports={BasePlugin:i(235),DefaultPlugins:i(185),PluginCache:i(15),PluginManager:i(361),ScenePlugin:i(529)}},function(t,e,i){var n=i(147),s={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Engine.update",function(){s.Engine.update(this)})},Engine:{update:function(t){for(var e=t.world,i=n.Composite.allBodies(e),r=n.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y0)for(var a=s+1;a1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),y=f+t,m=p+e}},w=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":y=t.x,m=t.y;break;case"H":y=t.x;break;case"V":m=t.y}x(y,m,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i1?1:0;n0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e){t.exports=function(t,e,i,n){var s=e.pos.x+e.size.x-i.pos.x;if(n){var r=e===n?i:e;n.vel.x=-n.vel.x*n.bounciness+r.vel.x;var o=t.collisionMap.trace(n.pos.x,n.pos.y,n===e?-s:s,0,n.size.x,n.size.y);n.pos.x=o.pos.x}else{var a=(e.vel.x-i.vel.x)/2;e.vel.x=-a,i.vel.x=a;var h=t.collisionMap.trace(e.pos.x,e.pos.y,-s/2,0,e.size.x,e.size.y);e.pos.x=Math.floor(h.pos.x);var l=t.collisionMap.trace(i.pos.x,i.pos.y,s/2,0,i.size.x,i.size.y);i.pos.x=Math.ceil(l.pos.x)}}},function(t,e,i){var n=i(91),s=i(554),r=i(553);t.exports=function(t,e,i){var o=null;e.collides===n.LITE||i.collides===n.FIXED?o=e:i.collides!==n.LITE&&e.collides!==n.FIXED||(o=i),e.last.x+e.size.x>i.last.x&&e.last.xi.last.y&&e.last.y0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&o0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e,i){t.exports={Body:i(253),COLLIDES:i(91),CollisionMap:i(252),Factory:i(251),Image:i(249),ImpactBody:i(250),ImpactPhysics:i(556),Sprite:i(248),TYPE:i(90),World:i(247)}},function(t,e,i){var n=i(258);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){var n=i(259);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(575);t.exports=function(t,e,i,s,r){var o=0;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y0&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom>i&&(o=t.bottom-i)>r&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:n(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(577);t.exports=function(t,e,i,s,r){var o=0;return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x0&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right>i&&(o=t.right-i)>r&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:n(t,o)),o}},function(t,e,i){var n=i(578),s=i(576),r=i(255);t.exports=function(t,e,i,o,a,h){var l=o.left,u=o.top,c=o.right,d=o.bottom,f=i.faceLeft||i.faceRight,p=i.faceTop||i.faceBottom;if(!f&&!p)return!1;var g=0,v=0,y=0,m=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l>i&&(n=h,i=l)}return n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(t,e)},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});u.register("ArcadePhysics",f,"arcadePhysics"),t.exports=f},function(t,e,i){var n=i(39),s=i(21),r={ArcadePhysics:i(593),Body:i(261),Collider:i(260),Factory:i(267),Group:i(264),Image:i(266),Sprite:i(114),StaticBody:i(254),StaticGroup:i(263),World:i(262)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Arcade:i(594),Impact:i(572),Matter:i(552)}},function(t,e,i){var n=i(153),s=i(269),r=i(268),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o1?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t){for(var e=0,i=0;i0&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(323),IsSize:i(127),IsValue:i(616)}},function(t,e,i){var n=i(201);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(129);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return e<0?n(t[0],t[1],s):e>1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(189);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return t[0]===t[i]?(e<0&&(r=Math.floor(s=i*(1+e))),n(s-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(n(-s,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("update",this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit("progress",this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e,i){var n=i(0),s=i(11),r=i(4),o=i(116),a=i(285),h=i(158),l=i(284),u=i(669),c=i(668),d=i(667),f=i(157),p=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.keys=[],this.combos=[],this.queue=[],this.onKeyHandler,this.time=0,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.settings.input,e=this.scene.sys.game.config;this.enabled=r(t,"keyboard",e.inputKeyboard),this.target=r(t,"keyboard.target",e.inputKeyboardEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=function(e){if(!e.defaultPrevented&&t.isActive()){t.queue.push(e);var i=t.keys[e.keyCode];i&&i.preventDefault&&e.preventDefault()}};this.onKeyHandler=e,this.target.addEventListener("keydown",e,!1),this.target.addEventListener("keyup",e,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("keydown",this.onKeyHandler),this.target.removeEventListener("keyup",this.onKeyHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},createCursorKeys:function(){return this.addKeys({up:h.UP,down:h.DOWN,left:h.LEFT,right:h.RIGHT,space:h.SPACE,shift:h.SHIFT})},addKeys:function(t){var e={};if("string"==typeof t){t=t.split(",");for(var i=0;i-1?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new a(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);i>-1&&(this.keys[i]=void 0)}else"string"==typeof t&&(t=h[t.toUpperCase()]);e[t]&&(e[t]=void 0)},createCombo:function(t,e){return new l(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=f(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(t){this.time=t;var e=this.queue.length;if(this.enabled&&0!==e)for(var i=this.queue.splice(0,e),n=this.keys,s=0;s=e}}},function(t,e,i){var n=i(81),s=i(43),r=i(0),o=i(289),a=i(675),h=i(57),l=i(99),u=i(98),c=i(11),d=i(1),f=i(116),p=i(8),g=i(15),v=i(10),y=i(42),m=i(66),x=i(76),w=new r({Extends:c,initialize:function(t){c.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new c,this.enabled=!0,this.displayList,this.cameras,f.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once("destroy",this.destroy,this),this.pluginEvents.emit("boot")},start:function(){var t=this.systems.events;t.on("transitionstart",this.transitionIn,this),t.on("transitionout",this.transitionOut,this),t.on("transitioncomplete",this.transitionComplete,this),t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.enabled=!0,this.pluginEvents.emit("start")},preUpdate:function(){this.pluginEvents.emit("preUpdate");var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r-1&&(s.splice(a,1),this.clear(o))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},update:function(t,e){if(this.isActive()){this.pluginEvents.emit("update",t,e);var i=this.manager;if(!i.globalTopOnly||!i.ignoreEvents){var n=i.dirty||0===this.pollRate;if(this.pollRate>-1&&(this._pollTimer-=e,this._pollTimer<0&&(n=!0,this._pollTimer=this.pollRate)),n)for(var s=this.manager.pointers,r=0;r0&&i.globalTopOnly&&(i.ignoreEvents=!0)}}}},clear:function(t){var e=t.input;if(e){this.queueForRemoval(t),e.gameObject=void 0,e.target=void 0,e.hitArea=void 0,e.hitAreaCallback=void 0,e.callbackContext=void 0,this.manager.resetCursor(e),t.input=null;var i=this._draggable.indexOf(t);return i>-1&&this._draggable.splice(i,1),(i=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(i,1),(i=this._over[0].indexOf(t))>-1&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0?t.dragState=1:t.dragState>0&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i1&&(this.sortGameObjects(a),this.topOnly&&a.splice(1)),this._drag[t.id]=a,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(this.dragDistanceThreshold>0&&h(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),this.dragTimeThreshold>0&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(s=this._drag[t.id],i=0;i0?(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),l[0]?(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):r.target=null)}else!r.target&&l[0]&&(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target));var c=t.x-n.input.dragX,d=t.y-n.input.dragY;n.emit("drag",t,c,d),this.emit("drag",t,n,c,d)}return s.length}if(5===t.dragState){for(s=this._drag[t.id],i=0;i0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return a(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,a=!1;if(p(e)){var h=e;e=d(h,"hitArea",null),i=d(h,"hitAreaCallback",null),n=d(h,"draggable",!1),s=d(h,"dropZone",!1),r=d(h,"cursor",!1),a=d(h,"useHandCursor",!1);var l=d(h,"pixelPerfect",!1),u=d(h,"alphaTolerance",1);l&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)e.x&&t.ye.y}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),s=Math.max(t.right,e);t.x=n,t.width=s-n;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var s=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=s,t.height=r-s,t}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;on(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){var n=i(160);t.exports=function(t,e){var i=n(t);return ii&&(i=h.x),h.xr&&(r=h.y),h.ye.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e,i){var n=i(76),s=i(117);t.exports=function(t,e){return!!(n(t,e.getPointA())||n(t,e.getPointB())||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},function(t,e,i){var n=i(301),s=i(76);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottomt.right+r||it.bottom+r||st.right||e.rightt.bottom||e.bottom0}},function(t,e,i){var n=i(300);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(10),s=i(163);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){var n=i(57);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(98);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(98);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(99);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(99);n.Area=i(778),n.Circumference=i(335),n.CircumferencePoint=i(171),n.Clone=i(777),n.Contains=i(98),n.ContainsPoint=i(776),n.ContainsRect=i(775),n.CopyFrom=i(774),n.Equals=i(773),n.GetBounds=i(772),n.GetPoint=i(337),n.GetPoints=i(336),n.Offset=i(771),n.OffsetPoint=i(770),n.Random=i(204),t.exports=n},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e,i){var n=i(43);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(43);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(81);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(81);n.Area=i(788),n.Circumference=i(439),n.CircumferencePoint=i(212),n.Clone=i(787),n.Contains=i(43),n.ContainsPoint=i(786),n.ContainsRect=i(785),n.CopyFrom=i(784),n.Equals=i(783),n.GetBounds=i(782),n.GetPoint=i(442),n.GetPoints=i(440),n.Offset=i(781),n.OffsetPoint=i(780),n.Random=i(211),t.exports=n},function(t,e,i){var n=i(0),s=i(304),r=i(15),o=new n({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once("boot",this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on("shutdown",this.shutdown,this),t.on("destroy",this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},function(t,e,i){var n=i(31),s=i(14),r=i(13),o=i(164);s.register("quad",function(t,e){void 0===t&&(t={});var i=r(t,"x",0),s=r(t,"y",0),a=r(t,"key",null),h=r(t,"frame",null),l=new o(this.scene,i,s,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l})},function(t,e,i){var n=i(31),s=i(14),r=i(13),o=i(4),a=i(118);s.register("mesh",function(t,e){void 0===t&&(t={});var i=r(t,"key",null),s=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"colors",[]),u=o(t,"alphas",[]),c=o(t,"uv",[]),d=new a(this.scene,0,0,h,c,l,u,i,s);return void 0!==e&&(t.add=e),n(this.scene,d,t),d})},function(t,e,i){var n=i(164);i(5).register("quad",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(118);i(5).register("mesh",function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))})},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=this.pipeline;t.setPipeline(o,e);var a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.frame.glTexture,c=e.vertices,d=e.uv,f=e.colors,p=e.alphas,g=c.length,v=Math.floor(.5*g);o.vertexCount+v>=o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var y=o.vertexViewF32,m=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,w=0,b=e.tintFill,T=0;T0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0){var F=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(F.TL=L,F.TR=L,F.BL=L,F.BR=L,C=1;Cr;h--){for(l=0;l0&&r.maxLines1&&(d+=f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(4);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,y={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},m=0,x=0;x?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(879),s=i(21),r={Parse:i(878)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r),t.setBlankTexture(!0)}},function(t,e,i){var n=i(2),s=i(2);n=i(882),s=i(881),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(330),EdgeZone:i(329),RandomZone:i(326)}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.emitters.list,o=r.length;if(0!==o){var a=t._tempMatrix1.copyFrom(n.matrix),h=t._tempMatrix2,l=t._tempMatrix3,u=t._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);a.multiply(u);var c=n.roundPixels,d=t.currentContext;d.save();for(var f=0;f0&&(Y=Y%T-T):Y>T?Y=T:Y<0&&(Y=T+Y%T),null===C&&(C=new o(O+Math.cos(D)*B,I+Math.sin(D)*B,v),S.push(C),R+=.01);R<1+z;)b=Y*R+D,x=O+Math.cos(b)*B,w=I+Math.sin(b)*B,C.points.push(new r(x,w,v)),R+=.01;b=Y+D,x=O+Math.cos(b)*B,w=I+Math.sin(b)*B,C.points.push(new r(x,w,v));break;case n.FILL_RECT:u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==C?C.points.push(new r(p[++P],p[++P],v)):(C=new o(p[++P],p[++P],v),S.push(C));break;case n.MOVE_TO:C=new o(p[++P],p[++P],v),S.push(C);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:O=p[++P],I=p[++P],f.translate(O,I);break;case n.SCALE:O=p[++P],I=p[++P],f.scale(O,I);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var N=p[++P],U=p[++P];u.currentFrame=N,t.setTexture2D(N.glTexture,0),u.tintEffect=U;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,t.setTexture2D(t.blankTexture.glTexture,0),u.tintEffect=2}}}},function(t,e,i){var n=i(2),s=i(2);n=i(896),s=i(334),s=i(334),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(23);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length,h=t.currentContext;if(0!==a&&n(t,h,e,s,r)){var l=e.frame,u=e.displayCallback,c=s.scrollX*e.scrollFactorX,d=s.scrollY*e.scrollFactorY,f=e.fontData.chars,p=e.fontData.lineHeight,g=0,v=0,y=0,m=0,x=null,w=0,b=0,T=0,S=0,A=0,_=0,C=null,M=0,P=e.frame.source.image,E=l.cutX,k=l.cutY,F=0,L=e.fontSize/e.fontData.size;e.cropWidth>0&&e.cropHeight>0&&(h.save(),h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var R=0;R0&&e.cropHeight>0&&h.restore(),h.restore()}}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length;if(0!==a){var h=this.pipeline;t.setPipeline(h,e);var l=e.cropWidth>0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,y=p.cutY,m=g.width,x=g.height,w=e._isTinted&&e.tintFill,b=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),T=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),A=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var _,C,M=0,P=0,E=0,k=0,F=e.letterSpacing,L=0,R=0,O=0,I=0,B=e.scrollX,D=e.scrollY,Y=e.fontData,X=Y.chars,z=Y.lineHeight,N=e.fontSize/Y.size,U=0,V=e._align,G=0,W=0;e.getTextBounds(!1);var H=e._bounds.lines;1===V?W=(H.longest-H.lengths[0])/2:2===V&&(W=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;Jv&&(r=v),o>y&&(o=y);var k=v+g.xAdvance,F=y+u;a_&&(_=M),M_&&(_=M),M-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;i0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e,i){var n=i(100);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return n(t,s)}},function(t,e,i){var n=i(68);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(s)for(var h=0;ht.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){var n=i(343);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],r=Math.max(n((e-t)/(i||1)),0),o=0;o=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e,i){var n=i(68);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var o=s;o0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t},tick:function(){this.step(window.performance.now())},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime=window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step(window.performance.now())},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e){var i=0,n=function(t,e,n,s){var r=i-s.y-s.height;t.add(n,e,s.x,r,s.width,s.height)};t.exports=function(t,e,s){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height),i=r.height;for(var o=s.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;cx||a<-x)&&(a=0),a<0&&(a=x+a),-1!==h&&(x=a+(h+1));for(var C=l,M=l,P=0,E=e.sourceIndex,k=0;kg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,y=f,m=0,x=0,w=0;wr&&(m=b-r),T>o&&(x=T-o),t.add(w,e,i+v,s+y,h-m,l-x),(v+=h+p)+h>r&&(v=f,y+=l+p)}return t}},function(t,e,i){var n=i(69);t.exports=function(t,e,i){if(i.frames){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);var r,o=i.frames;for(var a in o){var h=o[a];r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted()),r.customData=n(h)}for(var l in i)"frames"!==l&&(Array.isArray(i[l])?t.customData[l]=i[l].slice(0):t.customData[l]=i[l]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var n=i(69);t.exports=function(t,e,i){if(i.frames||i.textures){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e,i){var n=i(101),s=i(128),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),n.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},function(t,e,i){var n=i(0),s=i(28),r=i(376),o=i(1),a=i(4),h=i(8),l=i(18),u=i(2),c=i(185),d=i(197),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",null),this.scaleMode=a(t,"scaleMode",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND.init(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.autoResize=a(i,"autoResize",!0),this.antialias=a(i,"antialias",!0),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",!1),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){var n=i(187),s=i(417),r=i(415),o=i(26),a=i(0),h=i(974),l=i(969),u=i(102),c=i(962),d=i(376),f=i(380),p=i(11),g=i(368),v=i(15),y=i(361),m=i(359),x=i(355),w=i(348),b=i(949),T=i(948),S=i(345),A=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new p,this.anims=new s(this),this.textures=new w(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new m(this,this.config.sceneConfig),this.device=d,this.sound=x.create(this),this.loop=new b(this,this.config.fps),this.plugins=new y(this,this.config),this.facebook=new S(this),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){v.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),l(this),c(this),n(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("texturesready",this.texturesReady,this)):console.warn("Core Phaser Plugins missing. Cannot start.")},texturesReady:function(){this.events.emit("ready"),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),T(this);var t=this.events;t.on("hidden",this.onHidden,this),t.on("visible",this.onVisible,this),t.on("blur",this.onBlur,this),t.on("focus",this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e);var n=this.renderer;n.preRender(),i.emit("prerender",n,t,e),this.scene.render(n),n.postRender(),i.emit("postrender",n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e),i.emit("prerender"),i.emit("postrender")},onHidden:function(){this.loop.pause(),this.events.emit("pause")},onVisible:function(){this.loop.resume(),this.events.emit("resume")},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},resize:function(t,e){this.config.width=t,this.config.height=e,this.renderer.resize(t,e),this.input.resize(),this.scene.resize(t,e),this.events.emit("resize",t,e)},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit("destroy"),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=A},function(t,e,i){var n=i(0),s=i(11),r=i(15),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){t.exports={EventEmitter:i(976)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c1)for(var i=1;i>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e){t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(i){t.style[i+"user-select"]=e}),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e,i){t.exports={CanvasInterpolation:i(384),CanvasPool:i(26),Smoothing:i(194),TouchAction:i(988),UserSelect:i(987)}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e,i){t.exports={CenterOn:i(448),GetBottom:i(51),GetCenterX:i(85),GetCenterY:i(82),GetLeft:i(49),GetOffsetX:i(991),GetOffsetY:i(990),GetRight:i(47),GetTop:i(45),SetBottom:i(50),SetCenterX:i(84),SetCenterY:i(83),SetLeft:i(48),SetRight:i(46),SetTop:i(44)}},function(t,e,i){var n=i(47),s=i(45),r=i(50),o=i(46);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(49),s=i(45),r=i(50),o=i(48);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)-a),t}},function(t,e,i){var n=i(85),s=i(45),r=i(50),o=i(84);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(47),s=i(45),r=i(48),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(82),s=i(47),r=i(83),o=i(48);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(51),s=i(47),r=i(50),o=i(48);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(49),s=i(45),r=i(46),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(82),s=i(49),r=i(83),o=i(46);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(51),s=i(49),r=i(50),o=i(46);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(51),s=i(47),r=i(46),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){var n=i(51),s=i(49),r=i(48),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)+a),t}},function(t,e,i){var n=i(51),s=i(85),r=i(84),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){t.exports={BottomCenter:i(1004),BottomLeft:i(1003),BottomRight:i(1002),LeftBottom:i(1001),LeftCenter:i(1e3),LeftTop:i(999),RightBottom:i(998),RightCenter:i(997),RightTop:i(996),TopCenter:i(995),TopLeft:i(994),TopRight:i(993)}},function(t,e,i){t.exports={BottomCenter:i(452),BottomLeft:i(451),BottomRight:i(450),Center:i(449),LeftCenter:i(447),QuickSet:i(453),RightCenter:i(446),TopCenter:i(445),TopLeft:i(444),TopRight:i(443)}},function(t,e,i){var n=i(213),s=i(21),r={In:i(1006),To:i(1005)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(1007),Bounds:i(992),Canvas:i(989),Color:i(383),Masks:i(980)}},function(t,e,i){var n=i(0),s=i(102),r=i(15),o=new n({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.events=this.systems.events,this.events.once("destroy",this.destroy,this)},start:function(){this.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},function(t,e,i){t.exports={DataManager:i(102),DataManagerPlugin:i(1009)}},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},function(t,e,i){var n=i(0),s=i(391),r=i(389),o=i(5),a=i(388),h=i(1011),l=i(387),u=i(10),c=i(385),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e0&&(h.preRender(r,o),t.render(n,e,i,h))}},resetAll:function(){for(var t=0;t=1?1:1/e*(1+(e*t|0))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e,i){var n=i(24),s=i(0),r=i(3),o=i(192),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new r,this.current=new r,this.destination=new r,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,a){void 0===i&&(i=1e3),void 0===n&&(n=o.Linear),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning?h:(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(h.scrollX,h.scrollY),this.destination.set(t,e),h.getScroll(t,e,this.current),"string"==typeof n&&o.hasOwnProperty(n)?this.ease=o[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=a,this.camera.emit("camerapanstart",this.camera,this,i,t,e),h)},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=s(t,"speed.x",0),this.speedY=s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={FixedKeyControl:i(1060),SmoothedKeyControl:i(1059)}},function(t,e,i){t.exports={Controls:i(1061),Scene2D:i(1058)}},function(t,e,i){t.exports={BaseCache:i(416),CacheManager:i(415)}},function(t,e,i){t.exports={Animation:i(420),AnimationFrame:i(418),AnimationManager:i(417)}},function(t,e,i){var n=i(58);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){var i={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=i},function(t,e){var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.frame.realWidth},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return this.scaleY*this.frame.realHeight},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){var n=i(104),s={_scaleMode:n.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==n.LINEAR&&t!==n.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=s},function(t,e){var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=Math.round(this.originX*this.width),this._displayOriginY=Math.round(this.originY*this.height),this}};t.exports=i},function(t,e,i){var n=i(10),s=i(432),r=i(3),o={getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getTopRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBounds:function(t){var e,i,s,r,o,a,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),s=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,s,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,s,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e,i){var n=i(453),s=i(213),r=i(1),o=i(2),a=new(i(134))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=r(e,"width",-1),o=r(e,"height",-1),h=r(e,"cellWidth",1),l=r(e,"cellHeight",h),u=r(e,"position",s.TOP_LEFT),c=r(e,"x",0),d=r(e,"y",0),f=0,p=0,g=i*h,v=o*l;a.setPosition(c,d),a.setSize(h,l);for(var y=0;y>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,t.exports=n},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,s="~";function r(){}function o(t,e,i,n,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new function(t,e,i){this.fn=t,this.context=e,this.once=i||!1}(i,n||t,r),a=s?s+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function h(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),h.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(s?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},h.prototype.listeners=function(t){var e=s?s+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,r=i.length,o=new Array(r);n0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i0&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit("destroy",this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});a.RENDER_MASK=15,t.exports=a},function(t,e,i){var n=i(441),s={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:new n};t.exports=s},function(t,e,i){var n=i(1);t.exports=function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===s&&(s=o.height);var a=n(r,"isNotEmpty",!1),h=n(r,"isColliding",!1),l=n(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit("filecomplete",e,i,t),this.loader.emit("filecomplete-"+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){t.exports=function(t,e,i,n,s){var r=n.alpha*i.alpha;if(r<=0)return!1;var o=t._tempMatrix1.copyFromArray(n.matrix.matrix),a=t._tempMatrix2.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),h=t._tempMatrix3;return s?(o.multiplyWithOffset(s,-n.scrollX*i.scrollFactorX,-n.scrollY*i.scrollFactorY),a.e=i.x,a.f=i.y,o.multiply(a,h)):(a.e-=n.scrollX*i.scrollFactorX,a.f-=n.scrollY*i.scrollFactorY,o.multiply(a,h)),e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=r,e.save(),h.setToContext(e),!0}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n={};t.exports=n;var s=i(29),r=i(34),o=i(89),a=i(12),h=i(33),l=i(151);!function(){n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",gameObject:null,parts:[],plugin:{},angle:0,vertices:s.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,ignoreGravity:!1,ignorePointer:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0},lineWidth:0},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,_original:null},n=a.extend(i,e);return t(n,e),n},n.nextGroup=function(t){return t?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var t=function(t,e){e=e||{},n.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),s.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),n.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var i=t.isStatic?"#2e2b44":a.choose(["#006BA6","#0496FF","#FFBC42","#D81159","#8F2D56"]);t.render.fillStyle=t.render.fillStyle||i,t.render.strokeStyle=t.render.strokeStyle||"#000",t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};n.set=function(t,e,i){var s;for(s in"string"==typeof e&&(s=e,(e={})[s]=i),e)if(e.hasOwnProperty(s))switch(i=e[s],s){case"isStatic":n.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":n.setMass(t,i);break;case"density":n.setDensity(t,i);break;case"inertia":n.setInertia(t,i);break;case"vertices":n.setVertices(t,i);break;case"position":n.setPosition(t,i);break;case"angle":n.setAngle(t,i);break;case"velocity":n.setVelocity(t,i);break;case"angularVelocity":n.setAngularVelocity(t,i);break;case"parts":n.setParts(t,i);break;default:t[s]=i}},n.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n={VERSION:"3.14.0",BlendModes:i(72),ScaleModes:i(104),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){var n={};t.exports=n;var s=i(34),r=i(12);n.create=function(t,e){for(var i=[],n=0;n0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n=i(0),s=i(16),r=i(17),o=i(60),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e,i){var n=i(72),s=i(13),r=i(104);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),e.blendMode=s(i,"blendMode",n.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){var i={};t.exports=i,i.create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;nt.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){var i={};t.exports=i,i.create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i||(i={});var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e){t.exports=function(t,e,i){var n=i||e.fillColor,s=e.fillAlpha,r=(16711680&n)>>>16,o=(65280&n)>>>8,a=255&n;t.fillStyle="rgba("+r+","+o+","+a+","+s+")"}},function(t,e,i){var n=i(18);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(110),s=i(19);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;d>>16,r=(65280&i)>>>8,o=255&i;t.strokeStyle="rgba("+s+","+r+","+o+","+n+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),s=i(196),r=i(412),o=i(195),a=i(411),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,n,s,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},scaleY:{get:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[5]=s*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,s,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*i,a=n*n,h=s*s,l=r*r,u=Math.sqrt(o+h),c=Math.sqrt(a+l);return t.translateX=e[4],t.translateY=e[5],t.scaleX=u,t.scaleY=c,t.rotation=Math.acos(i/u)*(Math.atan(-s/i)<0?-1:1),t},applyITRS:function(t,e,i,n,s){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=r*c*e+-o*c*t+(-u*r+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=r},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e,i){var n={};t.exports=n;var s=i(29),r=i(12),o=i(25),a=i(33),h=i(34),l=i(245);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-n+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},n.circle=function(t,e,i,s,o){s=s||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,r.extend({},a,s))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&s.area(A)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e,i){var n=i(0),s=i(20),r=i(22),o=i(7),a=i(1),h=i(4),l=i(8),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;sthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=h},function(t,e,i){var n=i(0),s=i(16),r=i(294),o=new n({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=null,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return this.getLeft(t)+this.width/2},getCenterY:function(t){return this.getTop(t)+this.height/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight-(this.height-this.baseHeight),this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.tilemapLayer;return t?t.tileset:null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n={};t.exports=n;var s=i(74),r=i(12),o=i(33),a=i(25);n.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},n.setModified=function(t,e,i,s){if(t.isModified=e,i&&t.parent&&n.setModified(t.parent,e,i,s),s)for(var r=0;r=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;ps||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,a,h,l,u,f,g,v=e&&e.length,y=v?e[0]*i:t.length,m=s(t,0,y,i,!0),x=[];if(!m)return x;if(v&&(m=function(t,e,i,n){var o,a,h,l,u,f=[];for(o=0,a=e.length;o80*i){n=h=t[0],a=l=t[1];for(var w=i;wh&&(h=u),f>l&&(l=f);g=Math.max(h-n,l-a)}return o(m,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===_(t,e,i,n)>0)for(r=e;r=e;r-=n)o=T(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!m(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),S(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(y(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&y(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(y(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!m(s,r)&&x(s,n,n.next,r)&&w(s,r)&&w(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),S(n),S(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&w(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=b(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&w(t,e)&&w(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(m(t,e)&&m(i,n)||m(t,n)&&m(i,e))||y(t,e,i)>0!=y(t,e,n)>0&&y(i,n,t)>0!=y(i,n,e)>0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function T(t,e,i,n){var s=new A(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={SKIP_CHECK:-1,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}},function(t,e,i){var n={};t.exports=n;var s=i(29),r=i(34),o=i(89),a=i(33),h=i(151),l=i(12);n._warming=.4,n._torqueDampen=1,n._minLength=1e-6,n.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,s=r.magnitude(r.sub(i,n));e.length=void 0!==e.length?e.length:s,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e,i){var n={};t.exports=n;var s=i(12);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r0){i||(i={}),n=e.split(" ");for(var l=0;l=0&&y>=0&&v+y<1}},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,i){var n=i(0),s=i(16),r=i(17),o=i(892),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,s){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},function(t,e,i){var n=i(69);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e,i){var n=i(0),s=i(191),r=i(10),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){var n=i(0),s=i(44),r=i(442),o=i(440),a=i(211),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation","orthogonal"),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[])}});t.exports=r},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",{}),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null)}});t.exports=r},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e0&&r.motion=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;sn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r,o){for(var a=n.getTintAppendFloatAlphaAndSwap(i.fillColor,i.fillAlpha*s),h=i.pathData,l=i.pathIndexes,u=0;u-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i=t.length)){for(var i=t.length-1,n=t[e],s=e;s=this.firstgid&&t=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e,i){var n=i(0),s=i(16),r=i(17),o=i(797),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,o],initialize:function(t,e,i,n,s,o,a,h,l){if(r.call(this,t,"Mesh"),n.length!==s.length)throw new Error("Mesh Vertex count must match UV count");var u,c=n.length/2|0;if(o.length>0&&o.length0&&a.lengthl&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(0),s=i(24),r=i(21),o=new n({initialize:function(t,e,i,n,s,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,d)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),y=r=s(r,0,f-i),m=this.data;if(m.trim){var x=m.spriteSourceSize,w=e+(n=s(n,0,u-e)),b=i+(r=s(r,0,c-i));if(!(x.rw||x.y>b)){var T=Math.max(x.x,e),S=Math.max(x.y,i),A=Math.min(x.r,w)-T,_=Math.min(x.b,b)-S;v=A,y=_,p=o?h+(u-(T-x.x)-A):h+(T-x.x),g=a?l+(c-(S-x.y)-_):l+(S-x.y),e=T,i=S,n=A,r=_}else p=0,g=0,v=0,y=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var C=this.source.width,M=this.source.height;return t.u0=Math.max(0,p/C),t.v0=Math.max(0,g/M),t.u1=Math.min(1,(p+v)/C),t.v1=Math.min(1,(g+y)/M),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=y,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){var n=i(0),s=i(11),r=i(21),o=i(2),a=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=r(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=r(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=r(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=r(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit("destroy",this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=a},function(t,e,i){var n=i(0),s=i(69),r=i(11),o=i(2),a=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on("blur",function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on("focus",function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on("prestep",this.update,this),t.events.once("destroy",this.destroy,this)},add:o,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once("ended",i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once("ended",n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("pauseall",this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit("resumeall",this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit("stopall",this)},unlock:o,onBlur:o,onFocus:o,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("rate",this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("detune",this,t)}}});t.exports=a},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){var n,s=i(101),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){var n=i(0),s=i(16),r=i(36),o=i(11),a=i(10),h=i(42),l=i(197),u=i(3),c=new n({Extends:o,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.config,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new a,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new a,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new h,this.transparent=!0,this.backgroundColor=l("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new u(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new u);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOn:function(t,e){var i=.5*this.width,n=.5*this.height;return this.midPoint.set(t,e),this.scrollX=t-i,this.scrollY=e-n,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;g-y&&T>-m&&b<_&&T-y&&A>-m&&S<_&&As&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=l(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.config=t.sys.game.config,this.sceneManager=t.sys.game.scene;var e=this.config.resolution;return this.resolution=e,this._cx=this._x*e,this._cy=this._y*e,this._cw=this._width*e,this._ch=this._height*e,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.config){var t=0!==this._x||0!==this._y||this.config.width!==this._width||this.config.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit("cameradestroy",this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.config=null,this.sceneManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=c},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e){var i={defaultPipeline:null,pipeline:null,initPipeline:function(t){void 0===t&&(t="TextureTintPipeline");var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return e&&e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t)),this},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=i},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e,i){var n=i(72),s=i(81),r=i(44),o=i(0),a=i(16),h=i(17),l=i(10),u=i(43),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.ScaleMode,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,s,r){void 0===s&&(s=1),void 0===r&&(r=s),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=s,this.height=r,this.blendMode=n.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){return void 0===i&&(i=!0),this.width=t,this.height=e,i&&this.input&&this.input.hitArea instanceof l&&(this.input.hitArea.width=t,this.input.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new s(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return void 0===t?this.setRectangleDropZone(this.width,this.height):this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},renderCanvas:function(){},renderWebGL:function(){}});t.exports=c},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e,i){var n=i(0),s=i(14),r=i(5),o=i(93),a=new n({initialize:function(t,e,i){this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onRepeat:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(){return this.data[0].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},isPaused:function(){return this.state===o.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){for(var n=0;n0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){if(this.state!==o.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this},play:function(t){if(this.state!==o.ACTIVE){this.state!==o.PENDING_REMOVE&&this.state!==o.REMOVED||(this.init(),this.parent.makeActive(this),t=!0);var e=this.callbacks.onStart;this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this))}},resetTweenData:function(t){for(var e=this.data,i=0;i0?(n.elapsed=n.delay,n.state=o.DELAY):n.state=o.PENDING_RENDER}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&ns.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},stop:function(t){this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parent._destroy.push(this),this.parent._toProcess++),this.state=o.PENDING_REMOVE)},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e){function i(t){return!!t.getStart&&"function"==typeof t.getStart}function n(t){return!!t.getEnd&&"function"==typeof t.getEnd}var s=function(t,e){var r,o,a=function(t,e,i){return i},h=function(t,e,i){return i},l=typeof e;if("number"===l)a=function(){return e};else if("string"===l){var u=e[0],c=parseFloat(e.substr(2));switch(u){case"+":a=function(t,e,i){return i+c};break;case"-":a=function(t,e,i){return i-c};break;case"*":a=function(t,e,i){return i*c};break;case"/":a=function(t,e,i){return i/c};break;default:a=function(){return parseFloat(e)}}}else"function"===l?a=e:"object"===l&&(i(o=e)||n(o))?(n(e)&&(a=e.getEnd),i(e)&&(h=e.getStart)):e.hasOwnProperty("value")&&(r=s(t,e.value));return r||(r={getEnd:a,getStart:h}),r};t.exports=s},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"targets",null);return null===e?e:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(30),s=i(86),r=i(231),o=i(223);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",n.ARRAY_2D,u,i,a,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new s({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){var n=i(30),s=i(87),r=i(86),o=i(61);t.exports=function(t,e,i,a,h){for(var l=new s({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;pr?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n=i(241);n.Body=i(25),n.Composite=i(63),n.World=i(145),n.Detector=i(149),n.Grid=i(240),n.Pairs=i(239),n.Pair=i(112),n.Query=i(536),n.Resolver=i(238),n.SAT=i(148),n.Constraint=i(73),n.Common=i(12),n.Engine=i(237),n.Events=i(74),n.Sleeping=i(89),n.Plugin=i(146),n.Bodies=i(55),n.Composites=i(244),n.Axes=i(151),n.Bounds=i(33),n.Svg=i(534),n.Vector=i(34),n.Vertices=i(29),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,t.exports=n},function(t,e,i){var n={};t.exports=n;var s=i(29),r=i(34);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlaps?s=a:a=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n=i(55),s=i(25),r=i(0),o=i(113),a=i(1),h=i(77),l=i(29),u=new r({Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var n=a(i,"body",null),s=a(i,"addToWorld",!0);if(n)this.setBody(n,s);else{var r=e.getCollisionGroup();a(r,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(34),r=i(12);n.fromVertices=function(t){for(var e={},i=0;i0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],y=s[12],m=s[13],x=s[14],w=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+y)*w,this.y=(e*o+i*u+n*p+m)*w,this.z=(e*a+i*c+n*g+x)*w,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});t.exports=n},function(t,e,i){var n=i(0),s=i(20),r=i(22),o=i(7),a=i(1),h=i(8),l=i(379),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n=0&&r>=0&&s+r<1&&(n.push({x:e[b].x,y:e[b].y}),i)));b++);return n}},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.righte.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),s=i(118),r=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,1,1,1,0],[16777215,16777215,16777215,16777215,16777215,16777215],[1,1,1,1,1,1],n,r),this.resetPosition()},setFrame:function(t){return this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,t=this.frame,this.uv[0]=t.u0,this.uv[1]=t.v0,this.uv[2]=t.u0,this.uv[3]=t.v1,this.uv[4]=t.u1,this.uv[5]=t.v1,this.uv[6]=t.u0,this.uv[7]=t.v0,this.uv[8]=t.u1,this.uv[9]=t.v1,this.uv[10]=t.u1,this.uv[11]=t.v0,this},topLeftX:{get:function(){return this.x+this.vertices[0]},set:function(t){this.vertices[0]=t-this.x,this.vertices[6]=t-this.x}},topLeftY:{get:function(){return this.y+this.vertices[1]},set:function(t){this.vertices[1]=t-this.y,this.vertices[7]=t-this.y}},topRightX:{get:function(){return this.x+this.vertices[10]},set:function(t){this.vertices[10]=t-this.x}},topRightY:{get:function(){return this.y+this.vertices[11]},set:function(t){this.vertices[11]=t-this.y}},bottomLeftX:{get:function(){return this.x+this.vertices[2]},set:function(t){this.vertices[2]=t-this.x}},bottomLeftY:{get:function(){return this.y+this.vertices[3]},set:function(t){this.vertices[3]=t-this.y}},bottomRightX:{get:function(){return this.x+this.vertices[4]},set:function(t){this.vertices[4]=t-this.x,this.vertices[8]=t-this.x}},bottomRightY:{get:function(){return this.y+this.vertices[5]},set:function(t){this.vertices[5]=t-this.y,this.vertices[9]=t-this.y}},topLeftAlpha:{get:function(){return this.alphas[0]},set:function(t){this.alphas[0]=t,this.alphas[3]=t}},topRightAlpha:{get:function(){return this.alphas[5]},set:function(t){this.alphas[5]=t}},bottomLeftAlpha:{get:function(){return this.alphas[1]},set:function(t){this.alphas[1]=t}},bottomRightAlpha:{get:function(){return this.alphas[2]},set:function(t){this.alphas[2]=t,this.alphas[4]=t}},topLeftColor:{get:function(){return this.colors[0]},set:function(t){this.colors[0]=t,this.colors[3]=t}},topRightColor:{get:function(){return this.colors[5]},set:function(t){this.colors[5]=t}},bottomLeftColor:{get:function(){return this.colors[1]},set:function(t){this.colors[1]=t}},bottomRightColor:{get:function(){return this.colors[2]},set:function(t){this.colors[2]=t,this.colors[4]=t}},setTopLeft:function(t,e){return this.topLeftX=t,this.topLeftY=e,this},setTopRight:function(t,e){return this.topRightX=t,this.topRightY=e,this},setBottomLeft:function(t,e){return this.bottomLeftX=t,this.bottomLeftY=e,this},setBottomRight:function(t,e){return this.bottomRightX=t,this.bottomRightY=e,this},resetPosition:function(){var t=this.x,e=this.y,i=Math.floor(this.width/2),n=Math.floor(this.height/2);return this.setTopLeft(t-i,e-n),this.setTopRight(t+i,e-n),this.setBottomLeft(t-i,e+n),this.setBottomRight(t+i,e+n),this},resetAlpha:function(){var t=this.alphas;return t[0]=1,t[1]=1,t[2]=1,t[3]=1,t[4]=1,t[5]=1,this},resetColors:function(){var t=this.colors;return t[0]=16777215,t[1]=16777215,t[2]=16777215,t[3]=16777215,t[4]=16777215,t[5]=16777215,this},reset:function(){return this.resetPosition(),this.resetAlpha(),this.resetColors()}});t.exports=r},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++sl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var y=u[c].length?c:c+1,m=u.slice(y).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=m+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h0&&(a+=u.lineSpacing*p),i.rtl?o=d-o:"right"===i.align?o+=u.width-u.lineWidths[p]:"center"===i.align&&(o+=(u.width-u.lineWidths[p])/2),this.autoRound&&(o=Math.round(o),a=Math.round(a)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[p],o,a)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[p],o,a));return e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(130),s=i(26),r=i(0),o=i(16),a=i(28),h=i(123),l=i(17),u=i(883),c=i(324),d=new r({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,r,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===o&&(o=32),l.call(this,t,"RenderTexture"),this.renderer=t.sys.game.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=s.create2D(this,r,o),this.context=this.canvas.getContext("2d"),this.framebuffer=null,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(c(),this.canvas),this.frame=this.texture.get(),this._saved=!1,this.camera=new n(0,0,r,o),this.dirty=!1,this.gl=null;var h=this.renderer;if(h.type===a.WEBGL){var u=h.gl;this.gl=u,this.drawGameObject=this.batchGameObjectWebGL,this.framebuffer=h.createFramebuffer(r,o,this.frame.source.glTexture,!1)}else h.type===a.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas);this.camera.setScene(t),this.setPosition(e,i),this.setSize(r,o),this.setOrigin(0,0),this.initPipeline()},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas.width=t,this.canvas.height=e,this.gl){var i=this.gl;this.renderer.deleteTexture(this.frame.source.glTexture),this.renderer.deleteFramebuffer(this.framebuffer),this.frame.source.glTexture=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1),this.framebuffer=this.renderer.createFramebuffer(t,e,this.frame.source.glTexture,!1),this.frame.glTexture=this.frame.source.glTexture}this.frame.source.width=t,this.frame.source.height=e,this.camera.setSize(t,e),this.frame.setSize(t,e),this.width=t,this.height=e}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e){void 0===e&&(e=1);var i=255&(t>>16|0),n=255&(t>>8|0),s=255&(0|t);if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var r=this.gl;r.clearColor(i/255,n/255,s/255,e),r.clear(r.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else this.context.fillStyle="rgb("+i+","+n+","+s+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height);return this},clear:function(){if(this.dirty){if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.restore()}this.dirty=!1}return this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1,1),r){this.renderer.setFramebuffer(this.framebuffer);var o=this.pipeline;o.projOrtho(0,this.width,0,this.height,-1e3,1e3),this.batchList(t,e,i,n,s),o.flush(),this.renderer.setFramebuffer(null),o.projOrtho(0,o.width,o.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1,1),o){this.renderer.setFramebuffer(this.framebuffer);var h=this.pipeline;h.projOrtho(0,this.width,0,this.height,-1e3,1e3),h.batchTextureFrame(a,i,n,r,s,this.camera.matrix,null),h.flush(),this.renderer.setFramebuffer(null),h.projOrtho(0,h.width,h.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i,n,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;r0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e,i){var n=i(119),s=i(0),r=i(900),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(179),s=i(72),r=i(0),o=i(16),a=i(17),h=i(10),l=i(903),u=i(338),c=i(3),d=new r({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.ScrollFactor,o.Transform,o.Visible,l],initialize:function(t,e,i,n){a.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new h),t.setTo(this.x,this.y,0,0),this.list.length>0)for(var e=this.list,i=new h,n=0;n-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=d},function(t,e,i){var n=i(907),s=i(904),r=i(0),o=i(16),a=i(123),h=i(17),l=i(122),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(t,e,i,n,s){h.call(this,t,"Blitter"),this.setTexture(n,s),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,r){void 0===n&&(n=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new s(this,t,e,i,n);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,n){for(var s=this.createMultiple(e,i,n),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit("start",this),this.events.emit("ready",this,t)},resize:function(t,e){this.events.emit("resize",t,e)},shutdown:function(t){this.events.off("transitioninit"),this.events.off("transitionstart"),this.events.off("transitioncomplete"),this.events.off("transitionout"),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit("destroy",this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;ethis.vertexCapacity&&(this.flush(),y=!0);var m=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.vertexComponentCount-1;return m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=i,m[++w]=n,m[++w]=h,m[++w]=c,m[++w]=v,x[++w]=p,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=o,m[++w]=a,m[++w]=u,m[++w]=l,m[++w]=v,x[++w]=f,this.vertexCount+=6,y},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f){var p=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),p=!0);var g=this.vertexViewF32,v=this.vertexViewU32,y=this.vertexCount*this.vertexComponentCount-1;return g[++y]=t,g[++y]=e,g[++y]=o,g[++y]=a,g[++y]=f,v[++y]=u,g[++y]=i,g[++y]=n,g[++y]=o,g[++y]=l,g[++y]=f,v[++y]=c,g[++y]=s,g[++y]=r,g[++y]=h,g[++y]=l,g[++y]=f,v[++y]=d,this.vertexCount+=3,p},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,A,_,C,M,P,E,F){this.renderer.setPipeline(this,t);var k=this._tempMatrix1,L=this._tempMatrix2,R=this._tempMatrix3,O=y/i+C,I=m/n+M,D=(y+x)/i+C,B=(m+w)/n+M,Y=o,X=a,z=-g,N=-v;if(t.isCropped){var U=t._crop;Y=U.width,X=U.height,o=U.width,a=U.height;var V=y=U.x,G=m=U.y;c&&(V=x-U.x-U.width),d&&!e.isRenderTexture&&(G=w-U.y-U.height),O=V/i+C,I=G/n+M,D=(V+U.width)/i+C,B=(G+U.height)/n+M,z=-g+y,N=-v+m}d^=!F&&e.isRenderTexture?1:0,c&&(Y*=-1,z+=o),d&&(X*=-1,N+=a);var W=z+Y,H=N+X;L.applyITRS(s,r,u,h,l),k.copyFrom(P.matrix),E?(k.multiplyWithOffset(E,-P.scrollX*f,-P.scrollY*p),L.e=s,L.f=r,k.multiply(L,R)):(L.e-=P.scrollX*f,L.f-=P.scrollY*p,k.multiply(L,R));var j=R.getX(z,N),q=R.getY(z,N),K=R.getX(z,H),J=R.getY(z,H),Z=R.getX(W,H),Q=R.getY(W,H),$=R.getX(W,N),tt=R.getY(W,N);P.roundPixels&&(j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0,tt|=0),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,O,I,D,B,b,T,S,A,_)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),y=h.getY(l,c),m=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,y,m,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n,h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),y=this.currentFrame,m=y.u0,x=y.v0,w=y.u1,b=y.v1;this.batchQuad(l,u,c,d,f,p,g,v,m,x,w,b,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,y=g.v0,m=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,y,m,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(R,O,E,F,H[0],H[1],H[2],H[3],U,V,G,W,B,Y,X,z,D):(j[0]=R,j[1]=O,j[2]=E,j[3]=F,j[4]=1),h&&j[4]?this.batchQuad(M,P,k,L,j[0],j[1],j[2],j[3],U,V,G,W,B,Y,X,z,D):(H[0]=M,H[1]=P,H[2]=k,H[3]=L,H[4]=1)}}});t.exports=d},function(t,e,i){var n=i(0),s=i(966),r=i(182),o=new n({Extends:r,initialize:function(t){t.fragShader=s.replace("%LIGHT_COUNT%",10..toString()),r.call(this,t),this.defaultNormalMap},boot:function(){this.defaultNormalMap=this.game.textures.getFrame("__DEFAULT")},onBind:function(t){r.prototype.onBind.call(this);var e=this.renderer,i=this.program;return this.mvpUpdate(),e.setInt1(i,"uNormSampler",1),e.setFloat2(i,"uResolution",this.width,this.height),t&&this.setNormalMap(t),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,10);if(0===s)return this;this.active=!0;var r,o=this.renderer,a=this.program,h=e.matrix,l={x:0,y:0},u=o.height;for(r=0;r<10;++r)o.setFloat1(a,"uLights["+r+"].radius",0);for(o.setFloat4(a,"uCamera",e.x,e.y,e.rotation,e.zoom),o.setFloat3(a,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n={Global:["game","anims","cache","plugins","registry","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};n.Global.push("facebook"),t.exports=n},function(t,e,i){var n=i(101),s=i(128),r=i(26),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D||n.cocoonJS;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this);n.cocoonJS&&(t.screencanvas=!1);var e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d").createImageData(1,1);return a=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,s.firefox&&s.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(s.ie||s.firefox||s.chrome)&&(o.canvasBitBltShift=!0),(s.safari||s.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e){t.exports=function(t,e,i){var n;if(void 0===i&&(i=!0),e)"string"==typeof e?n=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(n=e);else if(t.parentElement)return t;return n||(n=document.body),i&&n.style&&(n.style.overflow="hidden"),n.appendChild(t),t}},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e){t.exports=function(t,e,i,n,s){var r=.5*(n-e),o=.5*(s-i),a=t*t;return(2*i-2*n+r+o)*(t*a)+(-3*i+3*n-2*r-o)*a+r*t+i}},function(t,e,i){var n=i(18);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){var n=i(10);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,s=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return e.x=t.x+s*Math.cos(i)*t.width/2,e.y=t.y+s*Math.sin(i)*t.height/2,e}},function(t,e,i){var n=i(59);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(59);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var n=i(71),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),r=s>1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e){t.exports={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}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(0),s=i(11),r=i(105),o=i(93),a=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},add:function(t){return this.queue(r(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=o.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit("loop",this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit("complete",this),this.state=o.PENDING_REMOVE}},update:function(t,e){if(this.state!==o.PAUSED){var i=e;switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var n=this.totalData,s=0;s0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var y=0;y0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(0),s=i(16),r=i(28),o=i(17),a=i(473),h=i(111),l=i(42),u=i(9),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===y?(y=i.createVertexBuffer(m,n.STATIC_DRAW),this.vertexBuffer[e]=y):(i.setVertexBuffer(y),n.bufferSubData(n.ARRAY_BUFFER,0,m))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=a.x/n,l=a.y/s,c=(a.x+e.width)/n,d=(a.y+e.height)/s,f=this._tempMatrix,p=e.width,g=e.height,v=p/2,y=g/2,m=-v,x=-y;e.flipX&&(p*=-1,m+=e.width),e.flipY&&(g*=-1,x+=e.height);var w=m+p,b=x+g;f.applyITRS(v+e.pixelX,y+e.pixelY,e.rotation,1,1);var T=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),S=f.getX(m,x),A=f.getY(m,x),_=f.getX(m,b),C=f.getY(m,b),M=f.getX(w,b),P=f.getY(w,b),E=f.getX(w,x),F=f.getY(w,x);r.roundPixels&&(S|=0,A|=0,_|=0,C|=0,M|=0,P|=0,E|=0,F|=0);var k=this.vertexViewF32[o],L=this.vertexViewU32[o];return k[++t]=S,k[++t]=A,k[++t]=h,k[++t]=l,k[++t]=0,L[++t]=T,k[++t]=_,k[++t]=C,k[++t]=h,k[++t]=d,k[++t]=0,L[++t]=T,k[++t]=M,k[++t]=P,k[++t]=c,k[++t]=d,k[++t]=0,L[++t]=T,k[++t]=S,k[++t]=A,k[++t]=h,k[++t]=l,k[++t]=0,L[++t]=T,k[++t]=M,k[++t]=P,k[++t]=c,k[++t]=d,k[++t]=0,L[++t]=T,k[++t]=E,k[++t]=F,k[++t]=c,k[++t]=l,k[++t]=0,L[++t]=T,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(36),r=i(222),o=i(21),a=i(30),h=i(87),l=i(271),u=i(221),c=i(61),d=i(111),f=i(107),p=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new f(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new u(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:(null!==a&&d.Copy(t,e,i,n,s,r,o,a),this)},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===a&&(a=e.tileWidth),void 0===l&&(l=e.tileHeight),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===i&&(i=0),void 0===n&&(n=0),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,d=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;fa&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[])}});t.exports=r},function(t,e,i){var n=i(482),s=i(228),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=n(t,o);if(a.x+=e,a.y+=i,t.gid){var h=s(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?(a.ellipse=t.ellipse,a.width=t.width,a.height=t.height):t.text?(a.width=t.width,a.height=t.height,a.text=t.text):(a.rectangle=!0,a.width=t.width,a.height=t.height);return a}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|s,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t-1}return!1}},function(t,e,i){var n=i(19);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionstart",e,i,n)}),d.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionactive",e,i,n)}),d.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionend",e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&p.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&p.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return p.add(this.localWorld,o),o},add:function(t){return p.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return o.removeBody(this.localWorld,i,e),this},removeConstraint:function(t,e){return o.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i1?1:0;r1?1:0;s0&&u.trigger(t,"collisionStart",{pairs:w.collisionStart}),o.preSolvePosition(w.list),s=0;s0&&u.trigger(t,"collisionActive",{pairs:w.collisionActive}),w.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:w.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(y),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;sf.friction*f.frictionStatic*O*i&&(D=k,I=o.clamp(f.friction*L*i,-D,D));var B=r.cross(A,y),Y=r.cross(_,y),X=w/(g.inverseMass+v.inverseMass+g.inverseInertia*B*B+v.inverseInertia*Y*Y);if(R*=X,I*=X,E<0&&E*E>n._restingThresh*i)T.normalImpulse=0;else{var z=T.normalImpulse;T.normalImpulse=Math.min(T.normalImpulse+R,0),R=T.normalImpulse-z}if(F*F>n._restingThreshTangent*i)T.tangentImpulse=0;else{var N=T.tangentImpulse;T.tangentImpulse=o.clamp(T.tangentImpulse+I,-D,D),I=T.tangentImpulse-N}s.x=y.x*R+m.x*I,s.y=y.y*R+m.y*I,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(A,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(_,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(112),r=i(12);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;ou.bounds.max.x||p.bounds.max.yu.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var y=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,m=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!y&&m&&m&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||y&&!m||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(146),r=i(12);n.name="matter-js",n.version="0.14.2",n.uses=[],n.used=[],n.use=function(){s.use(n,Array.prototype.slice.call(arguments))},n.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(n,t,e)},n.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(n,t,e)}},function(t,e,i){var n=i(437),s=i(0),r=i(113),o=i(17),a=i(1),h=i(132),l=i(57),u=i(3),c=new s({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,s,r,h){o.call(this,t.scene,"Image"),this.anims=new n(this),this.setTexture(s,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=c},function(t,e,i){var n=i(0),s=i(113),r=i(17),o=i(1),a=i(78),h=i(132),l=i(3),u=new n({Extends:a,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,h],initialize:function(t,e,i,n,s,a){r.call(this,t.scene,"Image"),this.setTexture(n,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(63),r=i(73),o=i(12),a=i(25),h=i(55);n.stack=function(t,e,i,n,r,o,h){for(var l,u=s.create({label:"Stack"}),c=t,d=e,f=0,p=0;pg&&(g=m),a.translate(y,{x:.5*x,y:.5*m}),c=y.bounds.max.x+r,s.addBody(u,y),l=y,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;l=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;L_&&(_+=e.length),A=Number.MAX_VALUE,_3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],s=i-1;s>=0;--s)S(n,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);return!r(f(t,e-1),f(t,e),f(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))r.ACTIVE&&c(this,t,e))},setCollidesNever:function(t){for(var e=0;e1)for(var h=i/a,l=n/a,u=0;u0?r:0,y=n<0?f:0,m=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var w=Math.floor((e+v)/f);if((l>0||u===w||w<0||w>=p)&&(w=-1),u>=0&&u1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,w,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+y,e=t.pos.x,a=0;break}}if(s){var b=s>0?o:0,T=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),A=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+b)/f);var _=Math.floor((i+b)/f);if((l>0||c===_||_<0||_>=g)&&(_=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,_));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-b+T;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],y=i+s+(g<0?o:0)-d,m=n+r+(p>0?a:0)-f;if(p*m-g*y>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),w=g/x,b=-p/x,T=y*w+m*b,S=w*T,A=b*T;return S*S+A*A>=s*s+r*r?v||p*(m-r)-g*(y-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-A,t.collision.slope={x:p,y:g,nx:w,ny:b},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(91),r=i(571),o=i(90),a=i(570),h=new n({initialize:function(t,e,i,n,r){void 0===n&&(n=16),void 0===r&&(r=n),this.world=t,this.gameObject=null,this.enabled=!0,this.parent,this.id=t.getNextID(),this.name="",this.size={x:n,y:r},this.offset={x:0,y:0},this.pos={x:e,y:i},this.last={x:e,y:i},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:t.defaults.maxVelocityX,y:t.defaults.maxVelocityY},this.standing=!1,this.gravityFactor=t.defaults.gravityFactor,this.bounciness=t.defaults.bounciness,this.minBounceVelocity=t.defaults.minBounceVelocity,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER,this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.updateCallback,this.slopeStanding={min:.767944870877505,max:2.3736477827122884}},reset:function(t,e){this.pos={x:t,y:e},this.last={x:t,y:e},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:100,y:100},this.standing=!1,this.gravityFactor=1,this.bounciness=0,this.minBounceVelocity=40,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER},update:function(t){var e=this.pos;this.last.x=e.x,this.last.y=e.y,this.vel.y+=this.world.gravity*t*this.gravityFactor,this.vel.x=r(t,this.vel.x,this.accel.x,this.friction.x,this.maxVel.x),this.vel.y=r(t,this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var i=this.vel.x*t,n=this.vel.y*t,s=this.world.collisionMap.trace(e.x,e.y,i,n,this.size.x,this.size.y);this.handleMovementTrace(s)&&a(this,s);var o=this.gameObject;o&&(o.x=e.x-this.offset.x+o.displayOriginX*o.scaleX,o.y=e.y-this.offset.y+o.displayOriginY*o.scaleY),this.updateCallback&&this.updateCallback(this)},drawDebug:function(t){var e=this.pos;if(this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.size.x,this.size.y)),this.debugShowVelocity){var i=e.x+this.size.x/2,n=e.y+this.size.y/2;t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.vel.x,n+this.vel.y)}},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},skipHash:function(){return!this.enabled||0===this.type&&0===this.checkAgainst&&0===this.collides},touches:function(t){return!(this.pos.x>=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},function(t,e,i){var n=i(44),s=i(0),r=i(39),o=i(43),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i,n){void 0===i&&(i=this.offset.x),void 0===n&&(n=this.offset.y);var s=this.gameObject;return!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),this.offset.set(i,n),this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(342);function s(t){if(!(this instanceof s))return new s(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,y,m;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),y=Math.min(f.maxX,p.maxX),m=Math.min(f.maxY,p.maxY),o=Math.max(0,y-g)*Math.max(0,m-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;te._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=i(39);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(44),s=i(0),r=i(39),o=i(190),a=i(10),h=i(43),l=i(3),u=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x,e.y),this.prev=new l(e.x,e.y),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.physicsType=r.DYNAMIC_BODY,this._reset=!0,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var n=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,n=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},update:function(t){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds();var e=this.transform;if(this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter(),this.rotation=e.rotation,this.preRotation=this.rotation,this._reset&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves){this.world.updateMotion(this,t);var i=this.velocity.x,n=this.velocity.y;this.newVelocity.set(i*t,n*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(n,i),this.speed=Math.sqrt(i*i+n*n),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit("worldbounds",this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y,this.moves&&(0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.gameObject.x+=this._dx,this.gameObject.y+=this._dy,this._reset=!0),this._dx<0?this.facing=r.FACING_LEFT:this._dx>0&&(this.facing=r.FACING_RIGHT),this._dy<0?this.facing=r.FACING_UP:this._dy>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft(this.position),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height)),this.debugShowVelocity&&(t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t){return void 0===t&&(t=!0),this.collideWorldBounds=t,this},setVelocity:function(t,e){return this.velocity.set(t,e),this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},function(t,e,i){var n=i(261),s=i(24),r=i(0),o=i(260),a=i(39),h=i(58),l=i(11),u=i(277),c=i(276),d=i(275),f=i(259),p=i(258),g=i(4),v=i(257),y=i(580),m=i(10),x=i(256),w=i(579),b=i(574),T=i(573),S=i(96),A=i(254),_=i(255),C=i(42),M=i(3),P=i(59),E=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.bodies=new S,this.staticBodies=new S,this.pendingDestroy=new S,this.colliders=new v,this.gravity=new M(g(e,"gravity.x",0),g(e,"gravity.y",0)),this.bounds=new m(g(e,"x",0),g(e,"y",0),g(e,"width",t.sys.game.config.width),g(e,"height",t.sys.game.config.height)),this.checkCollision={up:g(e,"checkCollision.up",!0),down:g(e,"checkCollision.down",!0),left:g(e,"checkCollision.left",!0),right:g(e,"checkCollision.right",!0)},this.fps=g(e,"fps",60),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=g(e,"timeScale",1),this.OVERLAP_BIAS=g(e,"overlapBias",4),this.TILE_BIAS=g(e,"tileBias",16),this.forceX=g(e,"forceX",!1),this.isPaused=g(e,"isPaused",!1),this._total=0,this.drawDebug=g(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:g(e,"debugShowBody",!0),debugShowStaticBody:g(e,"debugShowStaticBody",!0),debugShowVelocity:g(e,"debugShowVelocity",!0),bodyDebugColor:g(e,"debugBodyColor",16711935),staticBodyDebugColor:g(e,"debugStaticBodyColor",255),velocityDebugColor:g(e,"debugVelocityColor",65280)},this.maxEntries=g(e,"maxEntries",16),this.useTree=g(e,"useTree",!0),this.tree=new x(this.maxEntries),this.staticTree=new x(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new C,this._tempMatrix2=new C,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=a.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=s;)this._elapsed-=s,i++,this.step(n);this.stepsLastFrame=i}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(o=(r=s.entries).length,t=0;ta.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,u=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)l.right&&(a=h(u.x,u.y,l.right,l.y)-u.radius):u.y>l.bottom&&(u.xl.right&&(a=h(u.x,u.y,l.right,l.bottom)-u.radius)),a*=-1}else a=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===a||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==a&&(t.onOverlap||e.onOverlap)&&this.emit("overlap",t.gameObject,e.gameObject,t,e),0!==a;var c=t.velocity.x,d=t.velocity.y,g=t.mass,v=e.velocity.x,y=e.velocity.y,m=e.mass,x=c*Math.cos(o)+d*Math.sin(o),w=c*Math.sin(o)-d*Math.cos(o),b=v*Math.cos(o)+y*Math.sin(o),T=v*Math.sin(o)-y*Math.cos(o),S=((g-m)*x+2*m*b)/(g+m),A=(2*g*x+(m-g)*b)/(g+m);t.immovable||(t.velocity.x=(S*Math.cos(o)-w*Math.sin(o))*t.bounce.x,t.velocity.y=(w*Math.cos(o)+S*Math.sin(o))*t.bounce.y,c=t.velocity.x,d=t.velocity.y),e.immovable||(e.velocity.x=(A*Math.cos(o)-T*Math.sin(o))*e.bounce.x,e.velocity.y=(T*Math.cos(o)+A*Math.sin(o))*e.bounce.y,v=e.velocity.x,y=e.velocity.y),Math.abs(o)0&&!t.immovable&&v>c?t.velocity.x*=-1:v<0&&!e.immovable&&c0&&!t.immovable&&y>d?t.velocity.y*=-1:y<0&&!e.immovable&&dMath.PI/2&&(c<0&&!t.immovable&&v0&&!e.immovable&&c>v?e.velocity.x*=-1:d<0&&!t.immovable&&y0&&!e.immovable&&c>y&&(e.velocity.y*=-1));var _=this._frameTime;return t.immovable||(t.x+=t.velocity.x*_-a*Math.cos(o),t.y+=t.velocity.y*_-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*_+a*Math.cos(o),e.y+=e.velocity.y*_+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),t.postUpdate(),e.postUpdate(),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f,p=e.getTilesWithinWorldXY(a,h,l,u);if(0===p.length)return!1;for(var g={left:0,right:0,top:0,bottom:0},v=0;v0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=o[s],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],y=e*o-i*r,m=e*a-n*r,x=e*h-s*r,w=i*a-n*o,b=i*h-s*o,T=n*h-s*a,S=l*p-u*f,A=l*g-c*f,_=l*v-d*f,C=u*g-c*p,M=u*v-d*p,P=c*v-d*g,E=y*P-m*M+x*C+w*_-b*A+T*S;return E?(E=1/E,t[0]=(o*P-a*M+h*C)*E,t[1]=(n*M-i*P-s*C)*E,t[2]=(p*T-g*b+v*w)*E,t[3]=(c*b-u*T-d*w)*E,t[4]=(a*_-r*P-h*A)*E,t[5]=(e*P-n*_+s*A)*E,t[6]=(g*x-f*T-v*m)*E,t[7]=(l*T-c*x+d*m)*E,t[8]=(r*M-o*_+h*S)*E,t[9]=(i*_-e*M-s*S)*E,t[10]=(f*b-p*x+v*y)*E,t[11]=(u*x-l*b-d*y)*E,t[12]=(o*A-r*C-a*S)*E,t[13]=(e*C-i*A+n*S)*E,t[14]=(p*m-f*w-g*y)*E,t[15]=(l*w-u*m+c*y)*E,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=t.val,x=m[0],w=m[1],b=m[2],T=m[3];return e[0]=x*i+w*o+b*u+T*p,e[1]=x*n+w*a+b*c+T*g,e[2]=x*s+w*h+b*d+T*v,e[3]=x*r+w*l+b*f+T*y,x=m[4],w=m[5],b=m[6],T=m[7],e[4]=x*i+w*o+b*u+T*p,e[5]=x*n+w*a+b*c+T*g,e[6]=x*s+w*h+b*d+T*v,e[7]=x*r+w*l+b*f+T*y,x=m[8],w=m[9],b=m[10],T=m[11],e[8]=x*i+w*o+b*u+T*p,e[9]=x*n+w*a+b*c+T*g,e[10]=x*s+w*h+b*d+T*v,e[11]=x*r+w*l+b*f+T*y,x=m[12],w=m[13],b=m[14],T=m[15],e[12]=x*i+w*o+b*u+T*p,e[13]=x*n+w*a+b*c+T*g,e[14]=x*s+w*h+b*d+T*v,e[15]=x*r+w*l+b*f+T*y,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],y=i[7],m=i[8],x=i[9],w=i[10],b=i[11],T=n*n*l+h,S=s*n*l+r*a,A=r*n*l-s*a,_=n*s*l-r*a,C=s*s*l+h,M=r*s*l+n*a,P=n*r*l+s*a,E=s*r*l-n*a,F=r*r*l+h;return i[0]=u*T+p*S+m*A,i[1]=c*T+g*S+x*A,i[2]=d*T+v*S+w*A,i[3]=f*T+y*S+b*A,i[4]=u*_+p*C+m*M,i[5]=c*_+g*C+x*M,i[6]=d*_+v*C+w*M,i[7]=f*_+y*C+b*M,i[8]=u*P+p*E+m*F,i[9]=c*P+g*E+x*F,i[10]=d*P+v*E+w*F,i[11]=f*P+y*E+b*F,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,y=o*h,m=o*l;return i[0]=1-(f+g),i[1]=c+m,i[2]=d-y,i[3]=0,i[4]=c-m,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+y,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,y=r*h;return e[0]=1-(d+p),e[1]=u+y,e[2]=c-v,e[3]=0,e[4]=u-y,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),y=h*(g*=v)-l*(p*=v),m=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(y*y+m*m+x*x))?(y*=v=1/v,m*=v,x*=v):(y=0,m=0,x=0);var w=p*x-g*m,b=g*y-f*x,T=f*m-p*y;return(v=Math.sqrt(w*w+b*b+T*T))?(w*=v=1/v,b*=v,T*=v):(w=0,b=0,T=0),n[0]=y,n[1]=w,n[2]=f,n[3]=0,n[4]=m,n[5]=b,n[6]=p,n[7]=0,n[8]=x,n[9]=T,n[10]=g,n[11]=0,n[12]=-(y*s+m*r+x*o),n[13]=-(w*s+b*r+T*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],y=c[5],m=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+y*h,e[4]=g*n+v*o+y*l,e[5]=g*s+v*a+y*u,e[6]=m*i+x*r+w*h,e[7]=m*n+x*o+w*l,e[8]=m*s+x*a+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,y=this.val;return y[0]=1-(c+f),y[3]=l+v,y[6]=u-g,y[1]=l-v,y[4]=1-(h+f),y[7]=d+p,y[2]=u+g,y[5]=d-p,y[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],x=n*h-s*a,w=n*l-r*a,b=n*u-o*a,T=s*l-r*h,S=s*u-o*h,A=r*u-o*l,_=c*v-d*g,C=c*y-f*g,M=c*m-p*g,P=d*y-f*v,E=d*m-p*v,F=f*m-p*y,k=x*F-w*E+b*P+T*M-S*C+A*_;return k?(k=1/k,i[0]=(h*F-l*E+u*P)*k,i[1]=(l*M-a*F-u*C)*k,i[2]=(a*E-h*M+u*_)*k,i[3]=(r*E-s*F-o*P)*k,i[4]=(n*F-r*M+o*C)*k,i[5]=(s*M-n*E-o*_)*k,i[6]=(v*A-y*S+m*T)*k,i[7]=(y*b-g*A-m*w)*k,i[8]=(g*S-v*b+m*x)*k,this):null}});t.exports=n},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e,i){var n=i(273);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),te-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)=0?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(20),r=i(22),o=i(7),a=i(1),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="txt";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"text",cache:t.cacheManager.text,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",function(t,e,i){if(Array.isArray(t))for(var n=0;n=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=this.threshold?this.pressed||(this.pressed=!0,this.events.emit("down",e,this,t),this.pad.emit("down",i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit("up",e,this,t),this.pad.emit("up",i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){t.exports={CircleToCircle:i(769),CircleToRectangle:i(768),GetRectangleIntersection:i(767),LineToCircle:i(301),LineToLine:i(117),LineToRectangle:i(766),PointToLine:i(300),PointToLineSegment:i(765),RectangleToRectangle:i(163),RectangleToTriangle:i(764),RectangleToValues:i(763),TriangleToCircle:i(762),TriangleToLine:i(761),TriangleToTriangle:i(760)}},function(t,e,i){t.exports={Circle:i(789),Ellipse:i(779),Intersects:i(302),Line:i(759),Point:i(741),Polygon:i(727),Rectangle:i(294),Triangle:i(698)}},function(t,e,i){var n=i(0),s=i(305),r=i(183),o=i(9),a=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1},enable:function(){return this.active=!0,this},disable:function(){return this.active=!1,this},cull:function(t){var e=this.lights,i=this.culledLights,n=e.length,s=t.x+t.width/2,o=t.y+t.height/2,a=(t.width+t.height)/2,h={x:0,y:0},l=t.matrix,u=this.systems.game.config.height;i.length=0;for(var c=0;c0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],r):h=new s(t,e,i,a[0],a[1],a[2],r),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=a},function(t,e,i){var n=i(0),s=i(9),r=new n({initialize:function(t,e,i,n,s,r,o){this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1},set:function(t,e,i,n,s,r,o){return this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1,this},setScrollFactor:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this},setColor:function(t){var e=s.getFloatsFromUintRGB(t);return this.r=e[0],this.g=e[1],this.b=e[2],this},setIntensity:function(t){return this.intensity=t,this},setPosition:function(t,e){return this.x=t,this.y=e,this},setRadius:function(t){return this.radius=t,this}});t.exports=r},function(t,e,i){var n=i(71),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e,i){var n=i(6),s=i(71);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(0),s=i(31),r=i(66),o=i(838),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),s.call(this,t,"Triangle",new r(n,o,a,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,s,r){return this.geom.setTo(t,e,i,n,s,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(841),s=i(0),r=i(70),o=i(31),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(71),s=i(60);t.exports=function(t){for(var e=t.points,i=0,r=0;rc+v)){var y=g.getPoint((u-c)/v);o.push(y);break}c+=v}return o}},function(t,e,i){var n=i(10);t.exports=function(t,e){void 0===e&&(e=new n);for(var i,s=1/0,r=1/0,o=-s,a=-r,h=0;h0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=i(72),s=i(0),r=i(16),o=i(330),a=i(329),h=i(888),l=i(1),u=i(177),c=i(327),d=i(77),f=i(332),p=i(326),g=i(10),v=i(120),y=i(3),m=i(59),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0),this.y=new h(e,"y",0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3),this.angle=new h(e,"angle",{min:0,max:360}),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new y,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0?n.pop():new this.particleClass(this)).fire(e,i),this.particleBringToTop?this.alive.push(r):this.alive.unshift(r),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,r,this),this.atLimit())break}return r}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);for(var n=this.manager.getProcessors(),s=this.alive,r=s.length,o=0;o0){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y},indexSortCallback:function(t,e){return t.index-e.index}});t.exports=x},function(t,e,i){var n=i(0),s=i(36),r=i(58),o=new n({initialize:function(t){this.emitter=t,this.frame=null,this.index=0,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint"),this.index=i.alive.length},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s>>16,m=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+y+","+m+","+x+","+d+")",c.lineWidth=v,w+=3;break;case n.FILL_STYLE:g=l[w+1],f=l[w+2],y=(16711680&g)>>>16,m=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+y+","+m+","+x+","+f+")",w+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[w+1],l[w+2],l[w+3],l[w+4]):c.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.fill(),w+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.stroke(),w+=6;break;case n.LINE_TO:c.lineTo(l[w+1],l[w+2]),w+=2;break;case n.MOVE_TO:c.moveTo(l[w+1],l[w+2]),w+=2;break;case n.LINE_FX_TO:c.lineTo(l[w+1],l[w+2]),w+=5;break;case n.MOVE_FX_TO:c.moveTo(l[w+1],l[w+2]),w+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[w+1],l[w+2]),w+=2;break;case n.SCALE:c.scale(l[w+1],l[w+2]),w+=2;break;case n.ROTATE:c.rotate(l[w+1]),w+=1;break;case n.GRADIENT_FILL_STYLE:w+=5;break;case n.GRADIENT_LINE_STYLE:w+=6;break;case n.SET_TEXTURE:w+=2}c.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var n=i(335),s=i(171),r=i(103),o=i(18);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(4),s=i(131),r=function(t,e,i){for(var n=[],s=0;sr;){if(o-r>600){var h=o-r+1,l=e-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*c/h+d)),p=Math.min(o,Math.floor(e+(h-l)*c/h+d));i(t,e,f,p,a)}var g=t[e],v=r,y=o;for(n(t,r,e),a(t[o],g)>0&&n(t,r,o);v0;)y--}0===a(t[r],g)?n(t,r,y):n(t,++y,o),y<=e&&(r=y+1),e<=y&&(o=y-1)}};function n(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function s(t,e){return te?1:0}t.exports=i},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s-1;r--)n[s][r]=t[r][s]}return n}},function(t,e,i){var n=i(947),s=i(0),r=i(102),o=i(11),a=i(946),h=i(944),l=i(943),u=new s({Extends:o,initialize:function(t){o.call(this),this.game=t,this.data=new r(this),this.on("setdata",this.setDataHandler,this),this.on("changedata",this.changeDataHandler,this),this.hasLoaded=!1,this.dataLocked=!1,this.supportedAPIs=[],this.entryPoint="",this.entryPointData=null,this.contextID=null,this.contextType=null,this.locale=null,this.platform=null,this.version=null,this.playerID=null,this.playerName=null,this.playerPhotoURL=null,this.playerCanSubscribeBot=!1,this.paymentsReady=!1,this.catalog=[],this.purchases=[],this.leaderboards={},this.ads=[]},setDataHandler:function(t,e,i){if(!this.dataLocked){var n={};n[e]=i;var s=this;FBInstant.player.setDataAsync(n).then(function(){s.emit("savedata",n)})}},changeDataHandler:function(t,e,i){if(!this.dataLocked){var n={};n[e]=i;var s=this;FBInstant.player.setDataAsync(n).then(function(){s.emit("savedata",n)})}},showLoadProgress:function(t){return t.load.on("progress",function(t){this.hasLoaded||FBInstant.setLoadingProgress(100*t)},this),t.load.on("complete",function(){this.hasLoaded||(this.hasLoaded=!0,FBInstant.startGameAsync().then(this.gameStarted.bind(this)))},this),this},gameStarted:function(){var t={},e=function(t){return t[1].toUpperCase()};FBInstant.getSupportedAPIs().forEach(function(i){i=i.replace(/\../g,e),t[i]=!0}),this.supportedAPIs=t,this.getID(),this.getType(),this.getLocale(),this.getPlatform(),this.getSDKVersion(),this.getPlayerID(),this.getPlayerName(),this.getPlayerPhotoURL();var i=this;FBInstant.onPause(function(){i.emit("pause")}),FBInstant.getEntryPointAsync().then(function(t){i.entryPoint=t,i.entryPointData=FBInstant.getEntryPointData(),i.emit("startgame")}).catch(function(t){console.warn(t)}),this.supportedAPIs.paymentsPurchaseAsync&&FBInstant.payments.onReady(function(){i.paymentsReady=!0}).catch(function(t){console.warn(t)})},checkAPI:function(t){return!!this.supportedAPIs[t]},getID:function(){return!this.contextID&&this.supportedAPIs.contextGetID&&(this.contextID=FBInstant.context.getID()),this.contextID},getType:function(){return!this.contextType&&this.supportedAPIs.contextGetType&&(this.contextType=FBInstant.context.getType()),this.contextType},getLocale:function(){return!this.locale&&this.supportedAPIs.getLocale&&(this.locale=FBInstant.getLocale()),this.locale},getPlatform:function(){return!this.platform&&this.supportedAPIs.getPlatform&&(this.platform=FBInstant.getPlatform()),this.platform},getSDKVersion:function(){return!this.version&&this.supportedAPIs.getSDKVersion&&(this.version=FBInstant.getSDKVersion()),this.version},getPlayerID:function(){return!this.playerID&&this.supportedAPIs.playerGetID&&(this.playerID=FBInstant.player.getID()),this.playerID},getPlayerName:function(){return!this.playerName&&this.supportedAPIs.playerGetName&&(this.playerName=FBInstant.player.getName()),this.playerName},getPlayerPhotoURL:function(){return!this.playerPhotoURL&&this.supportedAPIs.playerGetPhoto&&(this.playerPhotoURL=FBInstant.player.getPhoto()),this.playerPhotoURL},loadPlayerPhoto:function(t,e){return this.playerPhotoURL&&(t.load.setCORS("anonymous"),t.load.image(e,this.playerPhotoURL),t.load.once("filecomplete_image_"+e,function(){this.emit("photocomplete",e)},this),t.load.start()),this},canSubscribeBot:function(){if(this.supportedAPIs.playerCanSubscribeBotAsync){var t=this;FBInstant.player.canSubscribeBotAsync().then(function(){t.playerCanSubscribeBot=!0,t.emit("cansubscribebot")}).catch(function(e){t.emit("cansubscribebotfail",e)})}else this.emit("cansubscribebotfail");return this},subscribeBot:function(){if(this.playerCanSubscribeBot){var t=this;FBInstant.player.subscribeBotAsync().then(function(){t.emit("subscribebot")}).catch(function(e){t.emit("subscribebotfail",e)})}else this.emit("subscribebotfail");return this},getData:function(t){if(!this.checkAPI("playerGetDataAsync"))return this;Array.isArray(t)||(t=[t]);var e=this;return FBInstant.player.getDataAsync(t).then(function(t){for(var i in e.dataLocked=!0,t)e.data.set(i,t[i]);e.dataLocked=!1,e.emit("getdata",t)}),this},saveData:function(t){if(!this.checkAPI("playerSetDataAsync"))return this;var e=this;return FBInstant.player.setDataAsync(t).then(function(){e.emit("savedata",t)}).catch(function(t){e.emit("savedatafail",t)}),this},flushData:function(){if(!this.checkAPI("playerFlushDataAsync"))return this;var t=this;return FBInstant.player.flushDataAsync().then(function(){t.emit("flushdata")}).catch(function(e){t.emit("flushdatafail",e)}),this},getStats:function(t){if(!this.checkAPI("playerGetStatsAsync"))return this;var e=this;return FBInstant.player.getStatsAsync(t).then(function(t){e.emit("getstats",t)}).catch(function(t){e.emit("getstatsfail",t)}),this},saveStats:function(t){if(!this.checkAPI("playerSetStatsAsync"))return this;var e={};for(var i in t)"number"==typeof t[i]&&(e[i]=t[i]);var n=this;return FBInstant.player.setStatsAsync(e).then(function(){n.emit("savestats",e)}).catch(function(t){n.emit("savestatsfail",t)}),this},incStats:function(t){if(!this.checkAPI("playerIncrementStatsAsync"))return this;var e={};for(var i in t)"number"==typeof t[i]&&(e[i]=t[i]);var n=this;return FBInstant.player.incrementStatsAsync(e).then(function(t){n.emit("incstats",t)}).catch(function(t){n.emit("incstatsfail",t)}),this},saveSession:function(t){return this.checkAPI("setSessionData")?(JSON.stringify(t).length<=1e3?FBInstant.setSessionData(t):console.warn("Session data too long. Max 1000 chars."),this):this},openShare:function(t,e,i,n){return this._share("SHARE",t,e,i,n)},openInvite:function(t,e,i,n){return this._share("INVITE",t,e,i,n)},openRequest:function(t,e,i,n){return this._share("REQUEST",t,e,i,n)},openChallenge:function(t,e,i,n){return this._share("CHALLENGE",t,e,i,n)},_share:function(t,e,i,n,s){if(!this.checkAPI("shareAsync"))return this;if(void 0===s&&(s={}),i)var r=this.game.textures.getBase64(i,n);var o={intent:t,image:r,text:e,data:s},a=this;return FBInstant.shareAsync(o).then(function(){a.emit("resume")}),this},isSizeBetween:function(t,e){return this.checkAPI("contextIsSizeBetween")?FBInstant.context.isSizeBetween(t,e):this},switchContext:function(t){if(!this.checkAPI("contextSwitchAsync"))return this;if(t!==this.contextID){var e=this;FBInstant.context.switchAsync(t).then(function(){e.contextID=FBInstant.context.getID(),e.emit("switch",e.contextID)}).catch(function(t){e.emit("switchfail",t)})}return this},chooseContext:function(t){if(!this.checkAPI("contextChoseAsync"))return this;var e=this;return FBInstant.context.chooseAsync(t).then(function(){e.contextID=FBInstant.context.getID(),e.emit("choose",e.contextID)}).catch(function(t){e.emit("choosefail",t)}),this},createContext:function(t){if(!this.checkAPI("contextCreateAsync"))return this;var e=this;return FBInstant.context.createAsync(t).then(function(){e.contextID=FBInstant.context.getID(),e.emit("create",e.contextID)}).catch(function(t){e.emit("createfail",t)}),this},getPlayers:function(){if(!this.checkAPI("playerGetConnectedPlayersAsync"))return this;var t=this;return FBInstant.player.getConnectedPlayersAsync().then(function(e){t.emit("players",e)}).catch(function(e){t.emit("playersfail",e)}),this},getCatalog:function(){if(!this.paymentsReady)return this;var t=this,e=this.catalog;return FBInstant.payments.getCatalogAsync().then(function(i){e=[],i.forEach(function(t){e.push(h(t))}),t.emit("getcatalog",e)}).catch(function(e){t.emit("getcatalogfail",e)}),this},purchase:function(t,e){if(!this.paymentsReady)return this;var i={productID:t};e&&(i.developerPayload=e);var n=this;return FBInstant.payments.purchaseAsync(i).then(function(t){var e=l(t);n.emit("purchase",e)}).catch(function(t){n.emit("purchasefail",t)}),this},getPurchases:function(){if(!this.paymentsReady)return this;var t=this,e=this.purchases;return FBInstant.payments.getPurchasesAsync().then(function(i){e=[],i.forEach(function(t){e.push(l(t))}),t.emit("getpurchases",e)}).catch(function(e){t.emit("getpurchasesfail",e)}),this},consumePurchases:function(t){if(!this.paymentsReady)return this;var e=this;return FBInstant.payments.consumePurchaseAsync(t).then(function(){e.emit("consumepurchase",t)}).catch(function(t){e.emit("consumepurchasefail",t)}),this},update:function(t,e,i,n,s,r){return this._update("CUSTOM",t,e,i,n,s,r)},updateLeaderboard:function(t,e,i,n,s,r){return this._update("LEADERBOARD",t,e,i,n,s,r)},_update:function(t,e,i,n,s,r,o){if(!this.checkAPI("shareAsync"))return this;if(void 0===e&&(e=""),"string"==typeof i&&(i={default:i}),void 0===o&&(o={}),n)var a=this.game.textures.getBase64(n,s);var h={action:t,cta:e,image:a,text:i,template:r,data:o,strategy:"IMMEDIATE",notification:"NO_PUSH"},l=this;return FBInstant.updateAsync(h).then(function(){l.emit("update")}).catch(function(t){l.emit("updatefail",t)}),this},switchGame:function(t,e){if(!this.checkAPI("switchGameAsync"))return this;if(e&&JSON.stringify(e).length>1e3)return console.warn("Switch Game data too long. Max 1000 chars."),this;var i=this;return FBInstant.switchGameAsync(t,e).then(function(){i.emit("switchgame",t)}).catch(function(t){i.emit("switchgamefail",t)}),this},createShortcut:function(){var t=this;return FBInstant.canCreateShortcutAsync().then(function(e){e&&FBInstant.createShortcutAsync().then(function(){t.emit("shortcutcreated")}).catch(function(e){t.emit("shortcutfailed",e)})}),this},quit:function(){FBInstant.quit()},log:function(t,e,i){return this.checkAPI("logEvent")?(void 0===i&&(i={}),t.length>=2&&t.length<=40&&FBInstant.logEvent(t,parseFloat(e),i),this):this},preloadAds:function(t){if(!this.checkAPI("getInterstitialAdAsync"))return this;var e;Array.isArray(t)||(t=[t]);var i=this,s=0;for(e=0;e=3)return console.warn("Too many AdInstances. Show an ad before loading more"),this;for(e=0;e=3)return console.warn("Too many AdInstances. Show an ad before loading more"),this;for(e=0;e=r.x&&t=r.y&&e=r.x&&t=r.y&&e0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit("resume",this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit("stop",this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,"rate",t)||(this.calculateRate(),this.emit("rate",this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,"detune",t)||(this.calculateRate(),this.emit("detune",this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit("loop",this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(125),s=i(0),r=i(353),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var n=0;n-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit("transitioninit",n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once("complete",this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},resize:function(t,e){for(var i=0;i=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e,i){var n=i(0),s=i(11),r=i(7),o=i(14),a=i(5),h=i(1),l=i(15),u=i(360),c=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once("boot",this.boot,this)},boot:function(){var t,e,i,n,s,r,o,a=this.game.config,l=a.installGlobalPlugins;for(l=l.concat(this._pendingGlobal),t=0;t10&&(t=10-this.pointersTotal);for(var i=0;i0},queueTouchStart:function(t){if(this.queue.push(s.TOUCH_START,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueTouchMove:function(t){if(this.queue.push(s.TOUCH_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueTouchEnd:function(t){if(this.queue.push(s.TOUCH_END,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},queueMouseDown:function(t){if(this.queue.push(s.MOUSE_DOWN,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueMouseMove:function(t){if(this.queue.push(s.MOUSE_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueMouseUp:function(t){if(this.queue.push(s.MOUSE_UP,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},addUpCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.upOnce.push(t):this.domCallbacks.up.push(t),this._hasUpCallback=!0,this},addDownCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.downOnce.push(t):this.domCallbacks.down.push(t),this._hasDownCallback=!0,this},addMoveCallback:function(t,e){return void 0===e&&(e=!1),e?this.domCallbacks.moveOnce.push(t):this.domCallbacks.move.push(t),this._hasMoveCallback=!0,this},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var n=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){n=!1;break}s=s.parentContainer}while(s);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;1!==i.resolution&&(a+=i._x,h+=i._y),i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this._tempMatrix,d=this._tempMatrix2,f=0;f0&&n>0&&s.scissor(t,this.drawingBufferHeight-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},setBlendMode:function(t){var e=this.gl,i=this.blendModes[t];return t!==r.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),i.func.length>2?e.blendFuncSeparate(i.func[0],i.func[1],i.func[2],i.func[3]):e.blendFunc(i.func[0],i.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>16&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e){var i=this.gl;return t!==this.currentTextures[e]&&(this.flush(),this.currentActiveTextureUnit!==e&&(i.activeTexture(i.TEXTURE0+e),this.currentActiveTextureUnit=e),i.bindTexture(i.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t){var e=this.gl,i=this.width,n=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(i=t.renderTexture.width,n=t.renderTexture.height):this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),e.viewport(0,0,i,n),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,a=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,o(e,i)&&(h=s.REPEAT),n===r.ScaleModes.LINEAR&&this.config.antialias&&(a=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,a,h,h,s.RGBA,t):this.createTexture2D(0,a,a,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&a(this.nativeTextures,e),this.gl.deleteTexture(t),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,s=t._ch,r=this.pipelines.TextureTintPipeline,o=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-s),this.setFramebuffer(t.framebuffer);var a=this.gl;a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),r.projOrtho(e,n+e,i,s+i,-1e3,1e3),o.alphaGL>0&&r.drawFillRect(e,i,n+e,s+i,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL),t.emit("prerender",t)}else this.pushScissor(e,i,n,s),o.alphaGL>0&&r.drawFillRect(e,i,n,s,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL)},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,l.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,l.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit("postrender",t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=l.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n in this.config.clearBeforeRender&&(t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)),t.enable(t.SCISSOR_TEST),i)i[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,o=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=0;l=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===m&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(y,m),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=u},function(t,e,i){var n,s,r,o=i(26),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e,i){t.exports={os:i(101),browser:i(128),features:i(186),input:i(973),audio:i(972),video:i(971),fullscreen:i(970),canvasFeatures:i(375)}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(i){t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(101);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova&&!n.cocoonJS?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e,i){var n=i(41);n.ColorToRGBA=i(986),n.ComponentToHex=i(382),n.GetColor=i(196),n.GetColor32=i(412),n.HexStringToColor=i(413),n.HSLToColor=i(985),n.HSVColorWheel=i(984),n.HSVToRGB=i(195),n.HueToComponent=i(381),n.IntegerToColor=i(410),n.IntegerToRGB=i(409),n.Interpolate=i(983),n.ObjectToColor=i(408),n.RandomRGB=i(982),n.RGBStringToColor=i(407),n.RGBToHSV=i(411),n.RGBToString=i(981),n.ValueToColor=i(197),t.exports=n},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(189),s=i(0),r=i(80),o=i(3),a=new s({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;ei;)n-=i;n16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(41),s=i(409);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(ef.right&&(p=u(p,p+(v-f.right),this.lerp.x)),yf.bottom&&(g=u(g,g+(y-f.bottom),this.lerp.y))):(p=u(p,v-l,this.lerp.x),g=u(g,y-c,this.lerp.y))}this.useBounds&&(p=this.clampX(p),g=this.clampY(g)),this.roundPixels&&(l=Math.round(l),c=Math.round(c)),this.scrollX=p,this.scrollY=g;var m=p+s,x=g+o;this.midPoint.set(m,x);var w=i/a,b=n/a;this.worldView.setTo(m-w/2,x-b/2,w,b),h.loadIdentity(),h.scale(e,e),h.translate(this.x+l,this.y+c),h.rotate(this.rotation),h.scale(a,a),h.translate(-l,-c),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(416),s=new(i(0))({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once("destroy",this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","text","html","obj","tilemap","xml"],e=0;ee.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=i(24),s=i(0),r=i(419),o=i(418),a=i(4),h=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,a(i,"frames",[]),a(i,"defaultTextureKey",null)),this.frameRate=a(i,"frameRate",null),this.duration=a(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=a(i,"skipMissedFrames",!0),this.delay=a(i,"delay",0),this.repeat=a(i,"repeat",0),this.repeatDelay=a(i,"repeatDelay",0),this.yoyo=a(i,"yoyo",!1),this.showOnStart=a(i,"showOnStart",!1),this.hideOnComplete=a(i,"hideOnComplete",!1),this.paused=!1,this.manager.on("pauseall",this.pause,this),this.manager.on("resumeall",this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=l[0],l[0].prevFrame=s;var v=1/(l.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),r(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);t._repeatDelay>0&&!1===t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay):(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter,t.parent)))},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off("pauseall",this.pause,this),this.manager.off("resumeall",this.resume,this),this.manager.remove(this.key);for(var t=0;t-h&&(c-=h,n+=l),f=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(18),s=i(42),r=i(206),o=i(205),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t}};t.exports=a},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){this.geometryMask=t},preRenderWebGL:function(t,e,i){var n=t.gl,s=this.geometryMask;t.flush(),n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.NOTEQUAL,1,1),n.stencilOp(n.REPLACE,n.REPLACE,n.REPLACE),s.renderWebGL(t,s,0,i),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilFunc(n.EQUAL,1,1),n.stencilOp(n.KEEP,n.KEEP,n.KEEP)},postRenderWebGL:function(t){var e=t.gl;t.flush(),e.disable(e.STENCIL_TEST)},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){var i=t.sys.game.renderer;if(this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,i&&i.gl){var n=i.width,s=i.height,r=0==(n&n-1)&&0==(s&s-1),o=i.gl,a=r?o.REPEAT:o.CLAMP_TO_EDGE,h=o.LINEAR;this.mainTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.maskTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.mainFramebuffer=i.createFramebuffer(n,s,this.mainTexture,!1),this.maskFramebuffer=i.createFramebuffer(n,s,this.maskTexture,!1),i.onContextRestored(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,o=s.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!1),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!1)},this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t){t.pipelines.BitmapMaskPipeline.endMask(this)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null;var t=this.renderer;t&&t.gl&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer)),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null,this.renderer=null}});t.exports=n},function(t,e,i){var n=i(430),s=i(429),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&this.texture&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*s-a*r+e,t.y=o*r+a*s+i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var n=i(210),s=i(133);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once("remove",this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,this._timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this._delay=0,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this.forward=!0,this._reverse=!1,this.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},setDelay:function(t){return void 0===t&&(t=0),this._delay=t,this.parent},getDelay:function(){return this._delay},delayedPlay:function(t,e,i){return this.play(e,!0,i),this.nextTick+=t,this.parent},getCurrentKey:function(){if(this.currentAnim)return this.currentAnim.key},load:function(t,e){return void 0===e&&(e=0),this.isPlaying&&this.stop(),this.animationManager.load(this,t,e),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.updateFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.updateFrame(t),this.parent},isPaused:{get:function(){return this._paused}},play:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!0,this._reverse=!1,this._startAnimation(t,i))},playReverse:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!1,this._reverse=!0,this._startAnimation(t,i))},_startAnimation:function(t,e){this.load(t,e);var i=this.currentAnim,n=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,i.showOnStart&&(n.visible=!0),n.emit("animationstart",this.currentAnim,this.currentFrame,n),n},reverse:function(t){return this.isPlaying&&this.currentAnim.key===t?(this._reverse=!this._reverse,this.forward=!this.forward,this.parent):this.parent},getProgress:function(){var t=this.currentFrame.progress;return this.forward||(t=1-t),t},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},remove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},getRepeat:function(){return this._repeat},setRepeat:function(t){return this._repeat=t,this.repeatCounter=0,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){void 0===t&&(t=!1),this.currentAnim.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(this.currentAnim.frames[0]);var e=this.parent;return e.emit("animationrestart",this.currentAnim,this.currentFrame,e),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent;return t.emit("animationcomplete",this.currentAnim,this.currentFrame,t),t},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopOnRepeat:function(){return this._pendingStop=2,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},setTimeScale:function(t){return void 0===t&&(t=1),this._timeScale=t,this.parent},getTimeScale:function(){return this._timeScale},getTotalFrames:function(){return this.currentAnim.frames.length},update:function(t,e){if(this.currentAnim&&this.isPlaying&&!this.currentAnim.paused){if(this.accumulator+=e*this._timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.currentAnim.completeAnimation(this);this.accumulator>=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit("animationupdate",i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off("remove",this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=n},function(t,e,i){var n=i(24),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var n=i(439),s=i(212),r=i(103),o=i(18);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;i--){var n=Math.floor(this.frac()*(e+1)),s=t[n];t[n]=t[i],t[i]=s}return t}});t.exports=n},function(t,e,i){var n=i(212),s=i(103),r=i(18),o=i(6);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(48),s=i(46),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(50),s=i(46),r=i(49),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(85),s=i(46),r=i(84),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(82),s=i(48),r=i(83),o=i(47);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(82),s=i(50),r=i(83),o=i(49);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(84),s=i(83);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(448),s=i(85),r=i(82);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(52),s=i(48),r=i(51),o=i(47);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(52),s=i(50),r=i(51),o=i(49);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(52),s=i(85),r=i(51),o=i(84);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(213),s=[];s[n.BOTTOM_CENTER]=i(452),s[n.BOTTOM_LEFT]=i(451),s[n.BOTTOM_RIGHT]=i(450),s[n.CENTER]=i(449),s[n.LEFT_CENTER]=i(447),s[n.RIGHT_CENTER]=i(446),s[n.TOP_CENTER]=i(445),s[n.TOP_LEFT]=i(444),s[n.TOP_RIGHT]=i(443);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){t.exports={Angle:i(1121),Call:i(1120),GetFirst:i(1119),GetLast:i(1118),GridAlign:i(1117),IncAlpha:i(1106),IncX:i(1105),IncXY:i(1104),IncY:i(1103),PlaceOnCircle:i(1102),PlaceOnEllipse:i(1101),PlaceOnLine:i(1100),PlaceOnRectangle:i(1099),PlaceOnTriangle:i(1098),PlayAnimation:i(1097),PropertyValueInc:i(37),PropertyValueSet:i(27),RandomCircle:i(1096),RandomEllipse:i(1095),RandomLine:i(1094),RandomRectangle:i(1093),RandomTriangle:i(1092),Rotate:i(1091),RotateAround:i(1090),RotateAroundDistance:i(1089),ScaleX:i(1088),ScaleXY:i(1087),ScaleY:i(1086),SetAlpha:i(1085),SetBlendMode:i(1084),SetDepth:i(1083),SetHitArea:i(1082),SetOrigin:i(1081),SetRotation:i(1080),SetScale:i(1079),SetScaleX:i(1078),SetScaleY:i(1077),SetTint:i(1076),SetVisible:i(1075),SetX:i(1074),SetXY:i(1073),SetY:i(1072),ShiftPosition:i(1071),Shuffle:i(1070),SmootherStep:i(1069),SmoothStep:i(1068),Spread:i(1067),ToggleVisible:i(1066),WrapInRectangle:i(1065)}},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,function(t,i){return e[Number(i)-1]})}},function(t,e,i){t.exports={Format:i(456),Pad:i(198),Reverse:i(455),UppercaseFirst:i(357),UUID:i(324)}},function(t,e,i){var n=i(69);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)&&(i[s]=e[s]);return i}},function(t,e){t.exports=function(t,e){for(var i=0;i-1&&(e.state=a.REMOVED,s.splice(r,1)):(e.state=a.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e,i){var n=i(2),s=i(2);n=i(472),s=i(471),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,a.multiply(h,l));var u=t.currentContext,c=e.gidMap;u.save(),l.copyToContext(u);for(var d=n.alpha*e.alpha,f=0;f-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(21);t.exports=function(t){for(var e,i,s,r,o,a=0;a1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f>>0;return n}},function(t,e,i){var n=i(485),s=i(1),r=i(87),o=i(228),a=i(61);t.exports=function(t,e){for(var i=[],h=0;h0){var y=new a(u,v.gid,c,f.length,t.tilewidth,t.tileheight);y.rotation=v.rotation,y.flipX=v.flipped,d.push(y)}else{var m=e?null:new a(u,-1,c,f.length,t.tilewidth,t.tileheight);d.push(m)}++c===l.width&&(f.push(d),c=0,d=[])}u.data=f,i.push(u)}}return i}},function(t,e,i){t.exports={Parse:i(231),Parse2DArray:i(141),ParseCSV:i(230),Impact:i(224),Tiled:i(229)}},function(t,e,i){var n=i(54),s=i(53),r=i(3);t.exports=function(t,e,i,o,a,h){return void 0===o&&(o=new r(0,0)),o.x=n(t,i,a,h),o.y=s(e,i,a,h),o}},function(t,e,i){var n=i(19);t.exports=function(t,e,i,s,r,o){if(void 0!==r){var a,h=n(t,e,i,s,null,o),l=0;for(a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e,i){var n=i(62),s=i(38),r=i(77);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;ae)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(62),s=i(38),r=i(142);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=m;a--)for(o=v;o=m;a--)for(o=y;o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(109),s=i(108),r=i(19),o=i(234);t.exports=function(t,e,i,a,h,l){void 0===i&&(i={}),Array.isArray(t)||(t=[t]);var u=l.tilemapLayer;void 0===a&&(a=u.scene),void 0===h&&(h=a.cameras.main);var c,d=r(0,0,l.width,l.height,null,l),f=[];for(c=0;c=0&&p=0&&g=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("update",this.step,this),t.events.emit("transitioncomplete",this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i){return this.manager.add(t,e,i),this},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off("shutdown",this.shutdown,this),t.off("postupdate",this.step,this),t.off("transitionout")},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",a,"scenePlugin"),t.exports=a},function(t,e,i){var n=i(126),s=i(21),r={SceneManager:i(359),ScenePlugin:i(522),Settings:i(356),Systems:i(181)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={BitmapMaskPipeline:i(369),ForwardDiffuseLightPipeline:i(183),TextureTintPipeline:i(182)}},function(t,e,i){t.exports={Utils:i(9),WebGLPipeline:i(184),WebGLRenderer:i(371),Pipelines:i(524),BYTE:0,SHORT:1,UNSIGNED_BYTE:2,UNSIGNED_SHORT:3,FLOAT:4}},function(t,e,i){t.exports={Canvas:i(373),WebGL:i(370)}},function(t,e,i){t.exports={CanvasRenderer:i(374),GetBlendModes:i(372),SetTransform:i(23)}},function(t,e,i){t.exports={Canvas:i(527),Snapshot:i(526),WebGL:i(525)}},function(t,e,i){var n=i(235),s=new(i(0))({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=s},function(t,e,i){t.exports={BasePlugin:i(235),DefaultPlugins:i(185),PluginCache:i(15),PluginManager:i(361),ScenePlugin:i(529)}},function(t,e,i){var n=i(147),s={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Engine.update",function(){s.Engine.update(this)})},Engine:{update:function(t){for(var e=t.world,i=n.Composite.allBodies(e),r=n.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y0)for(var a=s+1;a1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),y=f+t,m=p+e}},w=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":y=t.x,m=t.y;break;case"H":y=t.x;break;case"V":m=t.y}x(y,m,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i1?1:0;n0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e){t.exports=function(t,e,i,n){var s=e.pos.x+e.size.x-i.pos.x;if(n){var r=e===n?i:e;n.vel.x=-n.vel.x*n.bounciness+r.vel.x;var o=t.collisionMap.trace(n.pos.x,n.pos.y,n===e?-s:s,0,n.size.x,n.size.y);n.pos.x=o.pos.x}else{var a=(e.vel.x-i.vel.x)/2;e.vel.x=-a,i.vel.x=a;var h=t.collisionMap.trace(e.pos.x,e.pos.y,-s/2,0,e.size.x,e.size.y);e.pos.x=Math.floor(h.pos.x);var l=t.collisionMap.trace(i.pos.x,i.pos.y,s/2,0,i.size.x,i.size.y);i.pos.x=Math.ceil(l.pos.x)}}},function(t,e,i){var n=i(91),s=i(554),r=i(553);t.exports=function(t,e,i){var o=null;e.collides===n.LITE||i.collides===n.FIXED?o=e:i.collides!==n.LITE&&e.collides!==n.FIXED||(o=i),e.last.x+e.size.x>i.last.x&&e.last.xi.last.y&&e.last.y0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&o0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e,i){t.exports={Body:i(253),COLLIDES:i(91),CollisionMap:i(252),Factory:i(251),Image:i(249),ImpactBody:i(250),ImpactPhysics:i(556),Sprite:i(248),TYPE:i(90),World:i(247)}},function(t,e,i){var n=i(258);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){var n=i(259);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(575);t.exports=function(t,e,i,s,r){var o=0;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y0&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom>i&&(o=t.bottom-i)>r&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:n(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(577);t.exports=function(t,e,i,s,r){var o=0;return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x0&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right>i&&(o=t.right-i)>r&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:n(t,o)),o}},function(t,e,i){var n=i(578),s=i(576),r=i(255);t.exports=function(t,e,i,o,a,h){var l=o.left,u=o.top,c=o.right,d=o.bottom,f=i.faceLeft||i.faceRight,p=i.faceTop||i.faceBottom;if(!f&&!p)return!1;var g=0,v=0,y=0,m=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l>i&&(n=h,i=l)}return n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(t,e)},shutdown:function(){if(this.world){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});u.register("ArcadePhysics",f,"arcadePhysics"),t.exports=f},function(t,e,i){var n=i(39),s=i(21),r={ArcadePhysics:i(593),Body:i(261),Collider:i(260),Factory:i(267),Group:i(264),Image:i(266),Sprite:i(114),StaticBody:i(254),StaticGroup:i(263),World:i(262)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Arcade:i(594),Impact:i(572),Matter:i(552)}},function(t,e,i){var n=i(153),s=i(269),r=i(268),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o1?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t){for(var e=0,i=0;i0&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(323),IsSize:i(127),IsValue:i(616)}},function(t,e,i){var n=i(201);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(129);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return e<0?n(t[0],t[1],s):e>1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(189);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return t[0]===t[i]?(e<0&&(r=Math.floor(s=i*(1+e))),n(s-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(n(-s,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("update",this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit("progress",this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e,i){var n=i(0),s=i(11),r=i(4),o=i(116),a=i(285),h=i(158),l=i(284),u=i(669),c=i(668),d=i(667),f=i(157),p=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.keys=[],this.combos=[],this.queue=[],this.onKeyHandler,this.time=0,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.settings.input,e=this.scene.sys.game.config;this.enabled=r(t,"keyboard",e.inputKeyboard),this.target=r(t,"keyboard.target",e.inputKeyboardEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=function(e){if(!e.defaultPrevented&&t.isActive()){t.queue.push(e);var i=t.keys[e.keyCode];i&&i.preventDefault&&e.preventDefault()}};this.onKeyHandler=e,this.target.addEventListener("keydown",e,!1),this.target.addEventListener("keyup",e,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("keydown",this.onKeyHandler),this.target.removeEventListener("keyup",this.onKeyHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},createCursorKeys:function(){return this.addKeys({up:h.UP,down:h.DOWN,left:h.LEFT,right:h.RIGHT,space:h.SPACE,shift:h.SHIFT})},addKeys:function(t){var e={};if("string"==typeof t){t=t.split(",");for(var i=0;i-1?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new a(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);i>-1&&(this.keys[i]=void 0)}else"string"==typeof t&&(t=h[t.toUpperCase()]);e[t]&&(e[t]=void 0)},createCombo:function(t,e){return new l(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=f(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(t){this.time=t;var e=this.queue.length;if(this.enabled&&0!==e)for(var i=this.queue.splice(0,e),n=this.keys,s=0;s=e}}},function(t,e,i){var n=i(81),s=i(44),r=i(0),o=i(289),a=i(675),h=i(58),l=i(99),u=i(98),c=i(11),d=i(1),f=i(116),p=i(8),g=i(15),v=i(10),y=i(43),m=i(66),x=i(76),w=new r({Extends:c,initialize:function(t){c.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new c,this.enabled=!0,this.displayList,this.cameras,f.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once("destroy",this.destroy,this),this.pluginEvents.emit("boot")},start:function(){var t=this.systems.events;t.on("transitionstart",this.transitionIn,this),t.on("transitionout",this.transitionOut,this),t.on("transitioncomplete",this.transitionComplete,this),t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.enabled=!0,this.pluginEvents.emit("start")},preUpdate:function(){this.pluginEvents.emit("preUpdate");var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r-1&&(s.splice(a,1),this.clear(o))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},update:function(t,e){if(this.isActive()){this.pluginEvents.emit("update",t,e);var i=this.manager;if(!i.globalTopOnly||!i.ignoreEvents){var n=i.dirty||0===this.pollRate;if(this.pollRate>-1&&(this._pollTimer-=e,this._pollTimer<0&&(n=!0,this._pollTimer=this.pollRate)),n)for(var s=this.manager.pointers,r=0;r0&&i.globalTopOnly&&(i.ignoreEvents=!0)}}}},clear:function(t){var e=t.input;if(e){this.queueForRemoval(t),e.gameObject=void 0,e.target=void 0,e.hitArea=void 0,e.hitAreaCallback=void 0,e.callbackContext=void 0,this.manager.resetCursor(e),t.input=null;var i=this._draggable.indexOf(t);return i>-1&&this._draggable.splice(i,1),(i=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(i,1),(i=this._over[0].indexOf(t))>-1&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0?t.dragState=1:t.dragState>0&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i1&&(this.sortGameObjects(a),this.topOnly&&a.splice(1)),this._drag[t.id]=a,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(this.dragDistanceThreshold>0&&h(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),this.dragTimeThreshold>0&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(s=this._drag[t.id],i=0;i0?(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),l[0]?(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):r.target=null)}else!r.target&&l[0]&&(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target));var c=t.x-n.input.dragX,d=t.y-n.input.dragY;n.emit("drag",t,c,d),this.emit("drag",t,n,c,d)}return s.length}if(5===t.dragState){for(s=this._drag[t.id],i=0;i0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return a(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,a=!1;if(p(e)){var h=e;e=d(h,"hitArea",null),i=d(h,"hitAreaCallback",null),n=d(h,"draggable",!1),s=d(h,"dropZone",!1),r=d(h,"cursor",!1),a=d(h,"useHandCursor",!1);var l=d(h,"pixelPerfect",!1),u=d(h,"alphaTolerance",1);l&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)e.x&&t.ye.y}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),s=Math.max(t.right,e);t.x=n,t.width=s-n;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var s=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=s,t.height=r-s,t}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;on(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){var n=i(160);t.exports=function(t,e){var i=n(t);return ii&&(i=h.x),h.xr&&(r=h.y),h.ye.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e,i){var n=i(76),s=i(117);t.exports=function(t,e){return!!(n(t,e.getPointA())||n(t,e.getPointB())||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},function(t,e,i){var n=i(301),s=i(76);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottomt.right+r||it.bottom+r||st.right||e.rightt.bottom||e.bottom0}},function(t,e,i){var n=i(300);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(10),s=i(163);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){var n=i(58);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(98);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(98);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(99);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(99);n.Area=i(778),n.Circumference=i(335),n.CircumferencePoint=i(171),n.Clone=i(777),n.Contains=i(98),n.ContainsPoint=i(776),n.ContainsRect=i(775),n.CopyFrom=i(774),n.Equals=i(773),n.GetBounds=i(772),n.GetPoint=i(337),n.GetPoints=i(336),n.Offset=i(771),n.OffsetPoint=i(770),n.Random=i(204),t.exports=n},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e,i){var n=i(44);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(44);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(81);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(81);n.Area=i(788),n.Circumference=i(439),n.CircumferencePoint=i(212),n.Clone=i(787),n.Contains=i(44),n.ContainsPoint=i(786),n.ContainsRect=i(785),n.CopyFrom=i(784),n.Equals=i(783),n.GetBounds=i(782),n.GetPoint=i(442),n.GetPoints=i(440),n.Offset=i(781),n.OffsetPoint=i(780),n.Random=i(211),t.exports=n},function(t,e,i){var n=i(0),s=i(304),r=i(15),o=new n({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once("boot",this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on("shutdown",this.shutdown,this),t.on("destroy",this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},function(t,e,i){var n=i(32),s=i(14),r=i(13),o=i(164);s.register("quad",function(t,e){void 0===t&&(t={});var i=r(t,"x",0),s=r(t,"y",0),a=r(t,"key",null),h=r(t,"frame",null),l=new o(this.scene,i,s,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l})},function(t,e,i){var n=i(32),s=i(14),r=i(13),o=i(4),a=i(118);s.register("mesh",function(t,e){void 0===t&&(t={});var i=r(t,"key",null),s=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"colors",[]),u=o(t,"alphas",[]),c=o(t,"uv",[]),d=new a(this.scene,0,0,h,c,l,u,i,s);return void 0!==e&&(t.add=e),n(this.scene,d,t),d})},function(t,e,i){var n=i(164);i(5).register("quad",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(118);i(5).register("mesh",function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))})},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=this.pipeline;t.setPipeline(o,e);var a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.frame.glTexture,c=e.vertices,d=e.uv,f=e.colors,p=e.alphas,g=c.length,v=Math.floor(.5*g);o.vertexCount+v>=o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var y=o.vertexViewF32,m=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,w=0,b=e.tintFill,T=0;T0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0){var k=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(k.TL=L,k.TR=L,k.BL=L,k.BR=L,C=1;Cr;h--){for(l=0;l0&&r.maxLines1&&(d+=f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(4);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,y={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},m=0,x=0;x?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(879),s=i(21),r={Parse:i(878)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r),t.setBlankTexture(!0)}},function(t,e,i){var n=i(2),s=i(2);n=i(882),s=i(881),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(330),EdgeZone:i(329),RandomZone:i(326)}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.emitters.list,o=r.length;if(0!==o){var a=t._tempMatrix1.copyFrom(n.matrix),h=t._tempMatrix2,l=t._tempMatrix3,u=t._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);a.multiply(u);var c=n.roundPixels,d=t.currentContext;d.save();for(var f=0;f0&&(Y=Y%T-T):Y>T?Y=T:Y<0&&(Y=T+Y%T),null===C&&(C=new o(O+Math.cos(B)*D,I+Math.sin(B)*D,v),S.push(C),R+=.01);R<1+z;)b=Y*R+B,x=O+Math.cos(b)*D,w=I+Math.sin(b)*D,C.points.push(new r(x,w,v)),R+=.01;b=Y+B,x=O+Math.cos(b)*D,w=I+Math.sin(b)*D,C.points.push(new r(x,w,v));break;case n.FILL_RECT:u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==C?C.points.push(new r(p[++P],p[++P],v)):(C=new o(p[++P],p[++P],v),S.push(C));break;case n.MOVE_TO:C=new o(p[++P],p[++P],v),S.push(C);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:O=p[++P],I=p[++P],f.translate(O,I);break;case n.SCALE:O=p[++P],I=p[++P],f.scale(O,I);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var N=p[++P],U=p[++P];u.currentFrame=N,t.setTexture2D(N.glTexture,0),u.tintEffect=U;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,t.setTexture2D(t.blankTexture.glTexture,0),u.tintEffect=2}}}},function(t,e,i){var n=i(2),s=i(2);n=i(896),s=i(334),s=i(334),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(23);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length,h=t.currentContext;if(0!==a&&n(t,h,e,s,r)){var l=e.frame,u=e.displayCallback,c=s.scrollX*e.scrollFactorX,d=s.scrollY*e.scrollFactorY,f=e.fontData.chars,p=e.fontData.lineHeight,g=0,v=0,y=0,m=0,x=null,w=0,b=0,T=0,S=0,A=0,_=0,C=null,M=0,P=e.frame.source.image,E=l.cutX,F=l.cutY,k=0,L=e.fontSize/e.fontData.size;e.cropWidth>0&&e.cropHeight>0&&(h.save(),h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var R=0;R0&&e.cropHeight>0&&h.restore(),h.restore()}}},function(t,e,i){var n=i(9);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length;if(0!==a){var h=this.pipeline;t.setPipeline(h,e);var l=e.cropWidth>0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,y=p.cutY,m=g.width,x=g.height,w=e._isTinted&&e.tintFill,b=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),T=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),A=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var _,C,M=0,P=0,E=0,F=0,k=e.letterSpacing,L=0,R=0,O=0,I=0,D=e.scrollX,B=e.scrollY,Y=e.fontData,X=Y.chars,z=Y.lineHeight,N=e.fontSize/Y.size,U=0,V=e._align,G=0,W=0;e.getTextBounds(!1);var H=e._bounds.lines;1===V?W=(H.longest-H.lengths[0])/2:2===V&&(W=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;Jv&&(r=v),o>y&&(o=y);var F=v+g.xAdvance,k=y+u;a_&&(_=M),M_&&(_=M),M-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;i0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e,i){var n=i(100);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return n(t,s)}},function(t,e,i){var n=i(68);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(s)for(var h=0;ht.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){var n=i(343);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],r=Math.max(n((e-t)/(i||1)),0),o=0;o=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e,i){var n=i(68);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var o=s;o0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t},tick:function(){this.step(window.performance.now())},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime=window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step(window.performance.now())},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e){var i=0,n=function(t,e,n,s){var r=i-s.y-s.height;t.add(n,e,s.x,r,s.width,s.height)};t.exports=function(t,e,s){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height),i=r.height;for(var o=s.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;cx||a<-x)&&(a=0),a<0&&(a=x+a),-1!==h&&(x=a+(h+1));for(var C=l,M=l,P=0,E=e.sourceIndex,F=0;Fg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,y=f,m=0,x=0,w=0;wr&&(m=b-r),T>o&&(x=T-o),t.add(w,e,i+v,s+y,h-m,l-x),(v+=h+p)+h>r&&(v=f,y+=l+p)}return t}},function(t,e,i){var n=i(69);t.exports=function(t,e,i){if(i.frames){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);var r,o=i.frames;for(var a in o){var h=o[a];r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted()),r.customData=n(h)}for(var l in i)"frames"!==l&&(Array.isArray(i[l])?t.customData[l]=i[l].slice(0):t.customData[l]=i[l]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var n=i(69);t.exports=function(t,e,i){if(i.frames||i.textures){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e,i){var n=i(101),s=i(128),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),n.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},function(t,e,i){var n=i(0),s=i(28),r=i(376),o=i(1),a=i(4),h=i(8),l=i(18),u=i(2),c=i(185),d=i(197),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",null),this.scaleMode=a(t,"scaleMode",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND.init(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.autoResize=a(i,"autoResize",!0),this.antialias=a(i,"antialias",!0),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",!1),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){var n=i(187),s=i(417),r=i(415),o=i(26),a=i(0),h=i(974),l=i(969),u=i(102),c=i(962),d=i(376),f=i(380),p=i(11),g=i(368),v=i(15),y=i(361),m=i(359),x=i(355),w=i(348),b=i(949),T=i(948),S=i(345),A=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new p,this.anims=new s(this),this.textures=new w(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new m(this,this.config.sceneConfig),this.device=d,this.sound=x.create(this),this.loop=new b(this,this.config.fps),this.plugins=new y(this,this.config),this.facebook=new S(this),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){v.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),l(this),c(this),n(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("texturesready",this.texturesReady,this)):console.warn("Core Phaser Plugins missing. Cannot start.")},texturesReady:function(){this.events.emit("ready"),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),T(this);var t=this.events;t.on("hidden",this.onHidden,this),t.on("visible",this.onVisible,this),t.on("blur",this.onBlur,this),t.on("focus",this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e);var n=this.renderer;n.preRender(),i.emit("prerender",n,t,e),this.scene.render(n),n.postRender(),i.emit("postrender",n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e),i.emit("prerender"),i.emit("postrender")},onHidden:function(){this.loop.pause(),this.events.emit("pause")},onVisible:function(){this.loop.resume(),this.events.emit("resume")},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},resize:function(t,e){this.config.width=t,this.config.height=e,this.renderer.resize(t,e),this.input.resize(),this.scene.resize(t,e),this.events.emit("resize",t,e)},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit("destroy"),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=A},function(t,e,i){var n=i(0),s=i(11),r=i(15),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){t.exports={EventEmitter:i(976)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c1)for(var i=1;i>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e){t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(i){t.style[i+"user-select"]=e}),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e,i){t.exports={CanvasInterpolation:i(384),CanvasPool:i(26),Smoothing:i(194),TouchAction:i(988),UserSelect:i(987)}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e,i){t.exports={CenterOn:i(448),GetBottom:i(52),GetCenterX:i(85),GetCenterY:i(82),GetLeft:i(50),GetOffsetX:i(991),GetOffsetY:i(990),GetRight:i(48),GetTop:i(46),SetBottom:i(51),SetCenterX:i(84),SetCenterY:i(83),SetLeft:i(49),SetRight:i(47),SetTop:i(45)}},function(t,e,i){var n=i(48),s=i(46),r=i(51),o=i(47);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(50),s=i(46),r=i(51),o=i(49);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)-a),t}},function(t,e,i){var n=i(85),s=i(46),r=i(51),o=i(84);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(49),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(82),s=i(48),r=i(83),o=i(49);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(52),s=i(48),r=i(51),o=i(49);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(50),s=i(46),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(82),s=i(50),r=i(83),o=i(47);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(52),s=i(50),r=i(51),o=i(47);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(52),s=i(48),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){var n=i(52),s=i(50),r=i(49),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)+a),t}},function(t,e,i){var n=i(52),s=i(85),r=i(84),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){t.exports={BottomCenter:i(1004),BottomLeft:i(1003),BottomRight:i(1002),LeftBottom:i(1001),LeftCenter:i(1e3),LeftTop:i(999),RightBottom:i(998),RightCenter:i(997),RightTop:i(996),TopCenter:i(995),TopLeft:i(994),TopRight:i(993)}},function(t,e,i){t.exports={BottomCenter:i(452),BottomLeft:i(451),BottomRight:i(450),Center:i(449),LeftCenter:i(447),QuickSet:i(453),RightCenter:i(446),TopCenter:i(445),TopLeft:i(444),TopRight:i(443)}},function(t,e,i){var n=i(213),s=i(21),r={In:i(1006),To:i(1005)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(1007),Bounds:i(992),Canvas:i(989),Color:i(383),Masks:i(980)}},function(t,e,i){var n=i(0),s=i(102),r=i(15),o=new n({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.events=this.systems.events,this.events.once("destroy",this.destroy,this)},start:function(){this.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},function(t,e,i){t.exports={DataManager:i(102),DataManagerPlugin:i(1009)}},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},function(t,e,i){var n=i(0),s=i(391),r=i(389),o=i(5),a=i(388),h=i(1011),l=i(387),u=i(10),c=i(385),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e0&&(h.preRender(r,o),t.render(n,e,i,h))}},resetAll:function(){for(var t=0;t=1?1:1/e*(1+(e*t|0))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e,i){var n=i(24),s=i(0),r=i(3),o=i(192),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new r,this.current=new r,this.destination=new r,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,a){void 0===i&&(i=1e3),void 0===n&&(n=o.Linear),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning?h:(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(h.scrollX,h.scrollY),this.destination.set(t,e),h.getScroll(t,e,this.current),"string"==typeof n&&o.hasOwnProperty(n)?this.ease=o[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=a,this.camera.emit("camerapanstart",this.camera,this,i,t,e),h)},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=s(t,"speed.x",0),this.speedY=s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={FixedKeyControl:i(1060),SmoothedKeyControl:i(1059)}},function(t,e,i){t.exports={Controls:i(1061),Scene2D:i(1058)}},function(t,e,i){t.exports={BaseCache:i(416),CacheManager:i(415)}},function(t,e,i){t.exports={Animation:i(420),AnimationFrame:i(418),AnimationManager:i(417)}},function(t,e,i){var n=i(59);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){var i={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=i},function(t,e){var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.frame.realWidth},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return this.scaleY*this.frame.realHeight},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){var n=i(104),s={_scaleMode:n.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==n.LINEAR&&t!==n.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=s},function(t,e){var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=Math.round(this.originX*this.width),this._displayOriginY=Math.round(this.originY*this.height),this}};t.exports=i},function(t,e,i){var n=i(10),s=i(432),r=i(3),o={getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getTopRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBounds:function(t){var e,i,s,r,o,a,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),s=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,s,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,s,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e,i){var n=i(453),s=i(213),r=i(1),o=i(2),a=new(i(134))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=r(e,"width",-1),o=r(e,"height",-1),h=r(e,"cellWidth",1),l=r(e,"cellHeight",h),u=r(e,"position",s.TOP_LEFT),c=r(e,"x",0),d=r(e,"y",0),f=0,p=0,g=i*h,v=o*l;a.setPosition(c,d),a.setSize(h,l);for(var y=0;y>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * [description] - * - * @function Phaser.Geom.Rectangle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {number} x - [description] - * @param {number} y - [description] - * - * @return {boolean} [description] - */ -var Contains = function (rect, x, y) -{ - if (rect.width <= 0 || rect.height <= 0) - { - return false; - } - - return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); -}; - -module.exports = Contains; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Check to see if the Circle contains the given x / y coordinates. - * - * @function Phaser.Geom.Circle.Contains - * @since 3.0.0 - * - * @param {Phaser.Geom.Circle} circle - The Circle to check. - * @param {number} x - The x coordinate to check within the circle. - * @param {number} y - The y coordinate to check within the circle. - * - * @return {boolean} True if the coordinates are within the circle, otherwise false. - */ -var Contains = function (circle, x, y) -{ - // Check if x/y are within the bounds first - if (circle.radius > 0 && x >= circle.left && x <= circle.right && y >= circle.top && y <= circle.bottom) - { - var dx = (circle.x - x) * (circle.x - x); - var dy = (circle.y - y) * (circle.y - y); - - return (dx + dy) <= (circle.radius * circle.radius); - } - else - { - return false; - } -}; - -module.exports = Contains; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the top of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetTop - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetTop = function (gameObject, value) -{ - gameObject.y = value + (gameObject.height * gameObject.originY); - - return gameObject; -}; - -module.exports = SetTop; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the top coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetTop - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The top coordinate of the bounds of the Game Object. - */ -var GetTop = function (gameObject) -{ - return gameObject.y - (gameObject.height * gameObject.originY); -}; - -module.exports = GetTop; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the left of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetRight - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetRight = function (gameObject, value) -{ - gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX); - - return gameObject; -}; - -module.exports = SetRight; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the right coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetRight - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The right coordinate of the bounds of the Game Object. - */ -var GetRight = function (gameObject) -{ - return (gameObject.x + gameObject.width) - (gameObject.width * gameObject.originX); -}; - -module.exports = GetRight; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the left of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetLeft - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetLeft = function (gameObject, value) -{ - gameObject.x = value + (gameObject.width * gameObject.originX); - - return gameObject; -}; - -module.exports = SetLeft; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the left coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetLeft - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The left coordinate of the bounds of the Game Object. - */ -var GetLeft = function (gameObject) -{ - return gameObject.x - (gameObject.width * gameObject.originX); -}; - -module.exports = GetLeft; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate. - * - * @function Phaser.Display.Bounds.SetBottom - * @since 3.0.0 - * - * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. - * @param {number} value - The coordinate to position the Game Object bounds on. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. - */ -var SetBottom = function (gameObject, value) -{ - gameObject.y = (value - gameObject.height) + (gameObject.height * gameObject.originY); - - return gameObject; -}; - -module.exports = SetBottom; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Returns the bottom coordinate from the bounds of the Game Object. - * - * @function Phaser.Display.Bounds.GetBottom - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. - * - * @return {number} The bottom coordinate of the bounds of the Game Object. - */ -var GetBottom = function (gameObject) -{ - return (gameObject.y + gameObject.height) - (gameObject.height * gameObject.originY); -}; - -module.exports = GetBottom; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.WorldToTileY - * @private - * @since 3.0.0 - * - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} The Y location in tile units. - */ -var WorldToTileY = function (worldY, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } - - var tileHeight = layer.baseTileHeight; - var tilemapLayer = layer.tilemapLayer; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's vertical scroll - worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); - - tileHeight *= tilemapLayer.scaleY; - } - - return snapToFloor - ? Math.floor(worldY / tileHeight) - : worldY / tileHeight; -}; - -module.exports = WorldToTileY; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.WorldToTileX - * @private - * @since 3.0.0 - * - * @param {number} worldX - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} The X location in tile units. - */ -var WorldToTileX = function (worldX, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } - - var tileWidth = layer.baseTileWidth; - var tilemapLayer = layer.tilemapLayer; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's horizontal scroll - worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); - - tileWidth *= tilemapLayer.scaleX; - } - - return snapToFloor - ? Math.floor(worldX / tileWidth) - : worldX / tileWidth; -}; - -module.exports = WorldToTileX; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var File = __webpack_require__(21); -var FileTypesManager = __webpack_require__(7); -var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(4); -var IsPlainObject = __webpack_require__(8); - -/** - * @typedef {object} Phaser.Loader.FileTypes.JSONFileConfig - * - * @property {string} key - The key of the file. Must be unique within both the Loader and the JSON Cache. - * @property {string|any} [url] - The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly added to the Cache. - * @property {string} [extension='json'] - The default file extension to use if no url is provided. - * @property {string} [dataKey] - If specified instead of the whole JSON file being parsed and added to the Cache, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. - * @property {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - */ - -/** - * @classdesc - * A single JSON File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. - * - * @class JSONFile - * @extends Phaser.Loader.File - * @memberOf Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - */ -var JSONFile = new Class({ - - Extends: File, - - initialize: - - // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object - // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing - - function JSONFile (loader, key, url, xhrSettings, dataKey) - { - var extension = 'json'; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - dataKey = GetFastValue(config, 'dataKey', dataKey); - } - - var fileConfig = { - type: 'json', - cache: loader.cacheManager.json, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings, - config: dataKey - }; - - File.call(this, loader, fileConfig); - - if (IsPlainObject(url)) - { - // Object provided instead of a URL, so no need to actually load it (populate data with value) - if (dataKey) - { - this.data = GetValue(url, dataKey); - } - else - { - this.data = url; - } - - this.state = CONST.FILE_POPULATED; - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.JSONFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - if (this.state !== CONST.FILE_POPULATED) - { - this.state = CONST.FILE_PROCESSING; - - var json = JSON.parse(this.xhrLoader.responseText); - - var key = this.config; - - if (typeof key === 'string') - { - this.data = GetValue(json, key, json); - } - else - { - this.data = json; - } - } - - this.onProcessComplete(); - } - -}); - -/** - * Adds a JSON file, or array of JSON files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the JSON Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.json({ - * key: 'wavedata', - * url: 'files/AlienWaveData.json' - * }); - * ``` - * - * See the documentation for `Phaser.Loader.FileTypes.JSONFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.json('wavedata', 'files/AlienWaveData.json'); - * // and later in your game ... - * var data = this.cache.json.get('wavedata'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and - * this is what you would use to retrieve the text from the JSON Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" - * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, - * rather than the whole file. For example, if your JSON data had a structure like this: - * - * ```json - * { - * "level1": { - * "baddies": { - * "aliens": {}, - * "boss": {} - * } - * }, - * "level2": {}, - * "level3": {} - * } - * ``` - * - * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. - * - * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#json - * @fires Phaser.Loader.LoaderPlugin#addFileEvent - * @since 3.0.0 - * - * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig|Phaser.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. - * @param {XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {Phaser.Loader.LoaderPlugin} The Loader instance. - */ -FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new JSONFile(this, key[i])); - } - } - else - { - this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); - } - - return this; -}); - -module.exports = JSONFile; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Calculate the distance between two sets of coordinates (points). - * - * @function Phaser.Math.Distance.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The distance between each point. - */ -var DistanceBetween = function (x1, y1, x2, y2) -{ - var dx = x1 - x2; - var dy = y1 - y2; - - return Math.sqrt(dx * dx + dy * dy); -}; - -module.exports = DistanceBetween; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -/** - * Wrap the given `value` between `min` and `max. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The wrapped value. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; - -module.exports = Wrap; - - -/***/ }), -/* 53 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -9020,6 +8314,734 @@ var TransformMatrix = new Class({ module.exports = TransformMatrix; +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * [description] + * + * @function Phaser.Geom.Rectangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {number} x - [description] + * @param {number} y - [description] + * + * @return {boolean} [description] + */ +var Contains = function (rect, x, y) +{ + if (rect.width <= 0 || rect.height <= 0) + { + return false; + } + + return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); +}; + +module.exports = Contains; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Check to see if the Circle contains the given x / y coordinates. + * + * @function Phaser.Geom.Circle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The Circle to check. + * @param {number} x - The x coordinate to check within the circle. + * @param {number} y - The y coordinate to check within the circle. + * + * @return {boolean} True if the coordinates are within the circle, otherwise false. + */ +var Contains = function (circle, x, y) +{ + // Check if x/y are within the bounds first + if (circle.radius > 0 && x >= circle.left && x <= circle.right && y >= circle.top && y <= circle.bottom) + { + var dx = (circle.x - x) * (circle.x - x); + var dy = (circle.y - y) * (circle.y - y); + + return (dx + dy) <= (circle.radius * circle.radius); + } + else + { + return false; + } +}; + +module.exports = Contains; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the top of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetTop + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetTop = function (gameObject, value) +{ + gameObject.y = value + (gameObject.height * gameObject.originY); + + return gameObject; +}; + +module.exports = SetTop; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the top coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetTop + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The top coordinate of the bounds of the Game Object. + */ +var GetTop = function (gameObject) +{ + return gameObject.y - (gameObject.height * gameObject.originY); +}; + +module.exports = GetTop; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetRight + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetRight = function (gameObject, value) +{ + gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX); + + return gameObject; +}; + +module.exports = SetRight; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the right coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetRight + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The right coordinate of the bounds of the Game Object. + */ +var GetRight = function (gameObject) +{ + return (gameObject.x + gameObject.width) - (gameObject.width * gameObject.originX); +}; + +module.exports = GetRight; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetLeft + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetLeft = function (gameObject, value) +{ + gameObject.x = value + (gameObject.width * gameObject.originX); + + return gameObject; +}; + +module.exports = SetLeft; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the left coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetLeft + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The left coordinate of the bounds of the Game Object. + */ +var GetLeft = function (gameObject) +{ + return gameObject.x - (gameObject.width * gameObject.originX); +}; + +module.exports = GetLeft; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetBottom + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetBottom = function (gameObject, value) +{ + gameObject.y = (value - gameObject.height) + (gameObject.height * gameObject.originY); + + return gameObject; +}; + +module.exports = SetBottom; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Returns the bottom coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetBottom + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The bottom coordinate of the bounds of the Game Object. + */ +var GetBottom = function (gameObject) +{ + return (gameObject.y + gameObject.height) - (gameObject.height * gameObject.originY); +}; + +module.exports = GetBottom; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileY + * @private + * @since 3.0.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var WorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return snapToFloor + ? Math.floor(worldY / tileHeight) + : worldY / tileHeight; +}; + +module.exports = WorldToTileY; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileX + * @private + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The X location in tile units. + */ +var WorldToTileX = function (worldX, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileWidth = layer.baseTileWidth; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + return snapToFloor + ? Math.floor(worldX / tileWidth) + : worldX / tileWidth; +}; + +module.exports = WorldToTileX; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(18); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(7); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(4); +var IsPlainObject = __webpack_require__(8); + +/** + * @typedef {object} Phaser.Loader.FileTypes.JSONFileConfig + * + * @property {string} key - The key of the file. Must be unique within both the Loader and the JSON Cache. + * @property {string|any} [url] - The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly added to the Cache. + * @property {string} [extension='json'] - The default file extension to use if no url is provided. + * @property {string} [dataKey] - If specified instead of the whole JSON file being parsed and added to the Cache, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. + * @property {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ + +/** + * @classdesc + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * + * @class JSONFile + * @extends Phaser.Loader.File + * @memberOf Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var JSONFile = new Class({ + + Extends: File, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function JSONFile (loader, key, url, xhrSettings, dataKey) + { + var extension = 'json'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); + } + + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey + }; + + File.call(this, loader, fileConfig); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + var json = JSON.parse(this.xhrLoader.responseText); + + var key = this.config; + + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#json + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Loader.FileTypes.JSONFileConfig|Phaser.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new JSONFile(this, key[i])); + } + } + else + { + this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = JSONFile; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points). + * + * @function Phaser.Math.Distance.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var DistanceBetween = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetween; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */ + +/** + * Wrap the given `value` between `min` and `max. + * + * @function Phaser.Math.Wrap + * @since 3.0.0 + * + * @param {number} value - The value to wrap. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The wrapped value. + */ +var Wrap = function (value, min, max) +{ + var range = max - min; + + return (min + ((((value - min) % range) + range) % range)); +}; + +module.exports = Wrap; + + /***/ }), /* 54 */ /***/ (function(module, exports, __webpack_require__) { @@ -10185,8 +10207,8 @@ module.exports = Tile; * @private * @since 3.0.0 * - * @param {Phaser.Tilemaps.Tile} tile - [description] - * @param {boolean} [collides=true] - [description] + * @param {Phaser.Tilemaps.Tile} tile - The Tile to set the collision on. + * @param {boolean} [collides=true] - Should the tile index collide or not? */ var SetTileCollision = function (tile, collides) { @@ -10721,12 +10743,12 @@ var Random = __webpack_require__(184); * @constructor * @since 3.0.0 * - * @param {number} [x1=0] - [description] - * @param {number} [y1=0] - [description] - * @param {number} [x2=0] - [description] - * @param {number} [y2=0] - [description] - * @param {number} [x3=0] - [description] - * @param {number} [y3=0] - [description] + * @param {number} [x1=0] - `x` coordinate of the first point. + * @param {number} [y1=0] - `y` coordinate of the first point. + * @param {number} [x2=0] - `x` coordinate of the second point. + * @param {number} [y2=0] - `y` coordinate of the second point. + * @param {number} [x3=0] - `x` coordinate of the third point. + * @param {number} [y3=0] - `y` coordinate of the third point. */ var Triangle = new Class({ @@ -10742,7 +10764,7 @@ var Triangle = new Class({ if (y3 === undefined) { y3 = 0; } /** - * [description] + * `x` coordinate of the first point. * * @name Phaser.Geom.Triangle#x1 * @type {number} @@ -10752,7 +10774,7 @@ var Triangle = new Class({ this.x1 = x1; /** - * [description] + * `y` coordinate of the first point. * * @name Phaser.Geom.Triangle#y1 * @type {number} @@ -10762,7 +10784,7 @@ var Triangle = new Class({ this.y1 = y1; /** - * [description] + * `x` coordinate of the second point. * * @name Phaser.Geom.Triangle#x2 * @type {number} @@ -10772,7 +10794,7 @@ var Triangle = new Class({ this.x2 = x2; /** - * [description] + * `y` coordinate of the second point. * * @name Phaser.Geom.Triangle#y2 * @type {number} @@ -10782,7 +10804,7 @@ var Triangle = new Class({ this.y2 = y2; /** - * [description] + * `x` coordinate of the third point. * * @name Phaser.Geom.Triangle#x3 * @type {number} @@ -10792,7 +10814,7 @@ var Triangle = new Class({ this.x3 = x3; /** - * [description] + * `y` coordinate of the third point. * * @name Phaser.Geom.Triangle#y3 * @type {number} @@ -10803,15 +10825,15 @@ var Triangle = new Class({ }, /** - * [description] + * Checks whether a given points lies within the triangle. * * @method Phaser.Geom.Triangle#contains * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate of the point to check. + * @param {number} y - The y coordinate of the point to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the coordinate pair is within the triangle, otherwise `false`. */ contains: function (x, y) { @@ -10819,17 +10841,17 @@ var Triangle = new Class({ }, /** - * [description] + * Returns a specific point on the triangle. * * @method Phaser.Geom.Triangle#getPoint * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [output,$return] * - * @param {number} position - [description] - * @param {(Phaser.Geom.Point|object)} [output] - [description] + * @param {number} position - Position as float within `0` and `1`. `0` equals the first point. + * @param {(Phaser.Geom.Point|object)} [output] - Optional Point, or point-like object, that the calculated point will be written to. * - * @return {(Phaser.Geom.Point|object)} [description] + * @return {(Phaser.Geom.Point|object)} Calculated `Point` that represents the requested position. It is the same as `output` when this parameter has been given. */ getPoint: function (position, output) { @@ -10837,18 +10859,18 @@ var Triangle = new Class({ }, /** - * [description] + * Calculates a list of evenly distributed points on the triangle. It is either possible to pass an amount of points to be generated (`quantity`) or the distance between two points (`stepRate`). * * @method Phaser.Geom.Triangle#getPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - [description] - * @param {number} [stepRate] - [description] - * @param {(array|Phaser.Geom.Point[])} [output] - [description] + * @param {integer} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param {number} [stepRate] - Distance between two points. Will only be used when `quantity` is falsey. + * @param {(array|Phaser.Geom.Point[])} [output] - Optional Array for writing the calculated points into. Otherwise a new array will be created. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} Returns a list of calculated `Point` instances or the filled array passed as parameter `output`. */ getPoints: function (quantity, stepRate, output) { @@ -10856,16 +10878,16 @@ var Triangle = new Class({ }, /** - * [description] + * Returns a random point along the triangle. * * @method Phaser.Geom.Triangle#getRandomPoint * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [point,$return] * - * @param {Phaser.Geom.Point} [point] - [description] + * @param {Phaser.Geom.Point} [point] - Optional `Point` that should be modified. Otherwise a new one will be created. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} Random `Point`. When parameter `point` has been provided it will be returned. */ getRandomPoint: function (point) { @@ -10873,17 +10895,17 @@ var Triangle = new Class({ }, /** - * [description] + * Sets all three points of the triangle. Leaving out any coordinate sets it to be `0`. * * @method Phaser.Geom.Triangle#setTo * @since 3.0.0 * - * @param {number} [x1=0] - [description] - * @param {number} [y1=0] - [description] - * @param {number} [x2=0] - [description] - * @param {number} [y2=0] - [description] - * @param {number} [x3=0] - [description] - * @param {number} [y3=0] - [description] + * @param {number} [x1=0] - `x` coordinate of the first point. + * @param {number} [y1=0] - `y` coordinate of the first point. + * @param {number} [x2=0] - `x` coordinate of the second point. + * @param {number} [y2=0] - `y` coordinate of the second point. + * @param {number} [x3=0] - `x` coordinate of the third point. + * @param {number} [y3=0] - `y` coordinate of the third point. * * @return {Phaser.Geom.Triangle} This Triangle object. */ @@ -10972,7 +10994,7 @@ var Triangle = new Class({ }, /** - * [description] + * Left most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. * * @name Phaser.Geom.Triangle#left * @type {number} @@ -11010,7 +11032,7 @@ var Triangle = new Class({ }, /** - * [description] + * Right most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. * * @name Phaser.Geom.Triangle#right * @type {number} @@ -11048,7 +11070,7 @@ var Triangle = new Class({ }, /** - * [description] + * Top most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. * * @name Phaser.Geom.Triangle#top * @type {number} @@ -11086,7 +11108,7 @@ var Triangle = new Class({ }, /** - * [description] + * Bottom most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. * * @name Phaser.Geom.Triangle#bottom * @type {number} @@ -11360,6 +11382,20 @@ var Sprite = new Class({ // Extra Sprite data is added here return data; + }, + + /** + * Handles the pre-destroy step for the Sprite, which removes the Animation component. + * + * @method Phaser.GameObjects.Sprite#preDestroy + * @private + * @since 3.14.0 + */ + preDestroy: function () + { + this.anims.destroy(); + + this.anims = undefined; } }); @@ -12330,11 +12366,11 @@ var Body = {}; module.exports = Body; -var Vertices = __webpack_require__(94); -var Vector = __webpack_require__(80); +var Vertices = __webpack_require__(76); +var Vector = __webpack_require__(81); var Sleeping = __webpack_require__(223); var Common = __webpack_require__(33); -var Bounds = __webpack_require__(79); +var Bounds = __webpack_require__(80); var Axes = __webpack_require__(505); (function() { @@ -13807,9 +13843,9 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getEndPoint * @since 3.0.0 * - * @param {Phaser.Math.Vector2} out - [description] + * @param {Phaser.Math.Vector2} [out] - Optional Vector object to store the result in. * - * @return {Phaser.Math.Vector2} [description] + * @return {Phaser.Math.Vector2} Vector2 containing the coordinates of the curves end point. */ getEndPoint: function (out) { @@ -14013,7 +14049,7 @@ var Curve = new Class({ * @param {number} t - [description] * @param {Phaser.Math.Vector2} [out] - [description] * - * @return {Phaser.Math.Vector2} [description] + * @return {Phaser.Math.Vector2} Vector approximating the tangent line at the point t (delta +/- 0.0001) */ getTangent: function (t, out) { @@ -14195,7 +14231,7 @@ module.exports = Curve; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(39); +var Contains = __webpack_require__(40); var GetPoint = __webpack_require__(406); var GetPoints = __webpack_require__(404); var Random = __webpack_require__(191); @@ -14677,6 +14713,466 @@ module.exports = GetCenterX; /* 76 */ /***/ (function(module, exports, __webpack_require__) { +/** +* The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. +* A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. +* A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Vertices +*/ + +var Vertices = {}; + +module.exports = Vertices; + +var Vector = __webpack_require__(81); +var Common = __webpack_require__(33); + +(function() { + + /** + * Creates a new set of `Matter.Body` compatible vertices. + * The `points` argument accepts an array of `Matter.Vector` points orientated around the origin `(0, 0)`, for example: + * + * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }] + * + * The `Vertices.create` method returns a new array of vertices, which are similar to Matter.Vector objects, + * but with some additional references required for efficient collision detection routines. + * + * Vertices must be specified in clockwise order. + * + * Note that the `body` argument is not optional, a `Matter.Body` reference must be provided. + * + * @method create + * @param {vector[]} points + * @param {body} body + */ + Vertices.create = function(points, body) { + var vertices = []; + + for (var i = 0; i < points.length; i++) { + var point = points[i], + vertex = { + x: point.x, + y: point.y, + index: i, + body: body, + isInternal: false, + contact: null + }; + + vertex.contact = { + vertex: vertex, + normalImpulse: 0, + tangentImpulse: 0 + }; + + vertices.push(vertex); + } + + return vertices; + }; + + /** + * Parses a string containing ordered x y pairs separated by spaces (and optionally commas), + * into a `Matter.Vertices` object for the given `Matter.Body`. + * For parsing SVG paths, see `Svg.pathToVertices`. + * @method fromPath + * @param {string} path + * @param {body} body + * @return {vertices} vertices + */ + Vertices.fromPath = function(path, body) { + var pathPattern = /L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/ig, + points = []; + + path.replace(pathPattern, function(match, x, y) { + points.push({ x: parseFloat(x), y: parseFloat(y) }); + }); + + return Vertices.create(points, body); + }; + + /** + * Returns the centre (centroid) of the set of vertices. + * @method centre + * @param {vertices} vertices + * @return {vector} The centre point + */ + Vertices.centre = function(vertices) { + var area = Vertices.area(vertices, true), + centre = { x: 0, y: 0 }, + cross, + temp, + j; + + for (var i = 0; i < vertices.length; i++) { + j = (i + 1) % vertices.length; + cross = Vector.cross(vertices[i], vertices[j]); + temp = Vector.mult(Vector.add(vertices[i], vertices[j]), cross); + centre = Vector.add(centre, temp); + } + + return Vector.div(centre, 6 * area); + }; + + /** + * Returns the average (mean) of the set of vertices. + * @method mean + * @param {vertices} vertices + * @return {vector} The average point + */ + Vertices.mean = function(vertices) { + var average = { x: 0, y: 0 }; + + for (var i = 0; i < vertices.length; i++) { + average.x += vertices[i].x; + average.y += vertices[i].y; + } + + return Vector.div(average, vertices.length); + }; + + /** + * Returns the area of the set of vertices. + * @method area + * @param {vertices} vertices + * @param {bool} signed + * @return {number} The area + */ + Vertices.area = function(vertices, signed) { + var area = 0, + j = vertices.length - 1; + + for (var i = 0; i < vertices.length; i++) { + area += (vertices[j].x - vertices[i].x) * (vertices[j].y + vertices[i].y); + j = i; + } + + if (signed) + return area / 2; + + return Math.abs(area) / 2; + }; + + /** + * Returns the moment of inertia (second moment of area) of the set of vertices given the total mass. + * @method inertia + * @param {vertices} vertices + * @param {number} mass + * @return {number} The polygon's moment of inertia + */ + Vertices.inertia = function(vertices, mass) { + var numerator = 0, + denominator = 0, + v = vertices, + cross, + j; + + // find the polygon's moment of inertia, using second moment of area + // from equations at http://www.physicsforums.com/showthread.php?t=25293 + for (var n = 0; n < v.length; n++) { + j = (n + 1) % v.length; + cross = Math.abs(Vector.cross(v[j], v[n])); + numerator += cross * (Vector.dot(v[j], v[j]) + Vector.dot(v[j], v[n]) + Vector.dot(v[n], v[n])); + denominator += cross; + } + + return (mass / 6) * (numerator / denominator); + }; + + /** + * Translates the set of vertices in-place. + * @method translate + * @param {vertices} vertices + * @param {vector} vector + * @param {number} scalar + */ + Vertices.translate = function(vertices, vector, scalar) { + var i; + if (scalar) { + for (i = 0; i < vertices.length; i++) { + vertices[i].x += vector.x * scalar; + vertices[i].y += vector.y * scalar; + } + } else { + for (i = 0; i < vertices.length; i++) { + vertices[i].x += vector.x; + vertices[i].y += vector.y; + } + } + + return vertices; + }; + + /** + * Rotates the set of vertices in-place. + * @method rotate + * @param {vertices} vertices + * @param {number} angle + * @param {vector} point + */ + Vertices.rotate = function(vertices, angle, point) { + if (angle === 0) + return; + + var cos = Math.cos(angle), + sin = Math.sin(angle); + + for (var i = 0; i < vertices.length; i++) { + var vertice = vertices[i], + dx = vertice.x - point.x, + dy = vertice.y - point.y; + + vertice.x = point.x + (dx * cos - dy * sin); + vertice.y = point.y + (dx * sin + dy * cos); + } + + return vertices; + }; + + /** + * Returns `true` if the `point` is inside the set of `vertices`. + * @method contains + * @param {vertices} vertices + * @param {vector} point + * @return {boolean} True if the vertices contains point, otherwise false + */ + Vertices.contains = function(vertices, point) { + for (var i = 0; i < vertices.length; i++) { + var vertice = vertices[i], + nextVertice = vertices[(i + 1) % vertices.length]; + if ((point.x - vertice.x) * (nextVertice.y - vertice.y) + (point.y - vertice.y) * (vertice.x - nextVertice.x) > 0) { + return false; + } + } + + return true; + }; + + /** + * Scales the vertices from a point (default is centre) in-place. + * @method scale + * @param {vertices} vertices + * @param {number} scaleX + * @param {number} scaleY + * @param {vector} point + */ + Vertices.scale = function(vertices, scaleX, scaleY, point) { + if (scaleX === 1 && scaleY === 1) + return vertices; + + point = point || Vertices.centre(vertices); + + var vertex, + delta; + + for (var i = 0; i < vertices.length; i++) { + vertex = vertices[i]; + delta = Vector.sub(vertex, point); + vertices[i].x = point.x + delta.x * scaleX; + vertices[i].y = point.y + delta.y * scaleY; + } + + return vertices; + }; + + /** + * Chamfers a set of vertices by giving them rounded corners, returns a new set of vertices. + * The radius parameter is a single number or an array to specify the radius for each vertex. + * @method chamfer + * @param {vertices} vertices + * @param {number[]} radius + * @param {number} quality + * @param {number} qualityMin + * @param {number} qualityMax + */ + Vertices.chamfer = function(vertices, radius, quality, qualityMin, qualityMax) { + if (typeof radius === 'number') { + radius = [radius]; + } else { + radius = radius || [8]; + } + + // quality defaults to -1, which is auto + quality = (typeof quality !== 'undefined') ? quality : -1; + qualityMin = qualityMin || 2; + qualityMax = qualityMax || 14; + + var newVertices = []; + + for (var i = 0; i < vertices.length; i++) { + var prevVertex = vertices[i - 1 >= 0 ? i - 1 : vertices.length - 1], + vertex = vertices[i], + nextVertex = vertices[(i + 1) % vertices.length], + currentRadius = radius[i < radius.length ? i : radius.length - 1]; + + if (currentRadius === 0) { + newVertices.push(vertex); + continue; + } + + var prevNormal = Vector.normalise({ + x: vertex.y - prevVertex.y, + y: prevVertex.x - vertex.x + }); + + var nextNormal = Vector.normalise({ + x: nextVertex.y - vertex.y, + y: vertex.x - nextVertex.x + }); + + var diagonalRadius = Math.sqrt(2 * Math.pow(currentRadius, 2)), + radiusVector = Vector.mult(Common.clone(prevNormal), currentRadius), + midNormal = Vector.normalise(Vector.mult(Vector.add(prevNormal, nextNormal), 0.5)), + scaledVertex = Vector.sub(vertex, Vector.mult(midNormal, diagonalRadius)); + + var precision = quality; + + if (quality === -1) { + // automatically decide precision + precision = Math.pow(currentRadius, 0.32) * 1.75; + } + + precision = Common.clamp(precision, qualityMin, qualityMax); + + // use an even value for precision, more likely to reduce axes by using symmetry + if (precision % 2 === 1) + precision += 1; + + var alpha = Math.acos(Vector.dot(prevNormal, nextNormal)), + theta = alpha / precision; + + for (var j = 0; j < precision; j++) { + newVertices.push(Vector.add(Vector.rotate(radiusVector, theta * j), scaledVertex)); + } + } + + return newVertices; + }; + + /** + * Sorts the input vertices into clockwise order in place. + * @method clockwiseSort + * @param {vertices} vertices + * @return {vertices} vertices + */ + Vertices.clockwiseSort = function(vertices) { + var centre = Vertices.mean(vertices); + + vertices.sort(function(vertexA, vertexB) { + return Vector.angle(centre, vertexA) - Vector.angle(centre, vertexB); + }); + + return vertices; + }; + + /** + * Returns true if the vertices form a convex shape (vertices must be in clockwise order). + * @method isConvex + * @param {vertices} vertices + * @return {bool} `true` if the `vertices` are convex, `false` if not (or `null` if not computable). + */ + Vertices.isConvex = function(vertices) { + // http://paulbourke.net/geometry/polygonmesh/ + // Copyright (c) Paul Bourke (use permitted) + + var flag = 0, + n = vertices.length, + i, + j, + k, + z; + + if (n < 3) + return null; + + for (i = 0; i < n; i++) { + j = (i + 1) % n; + k = (i + 2) % n; + z = (vertices[j].x - vertices[i].x) * (vertices[k].y - vertices[j].y); + z -= (vertices[j].y - vertices[i].y) * (vertices[k].x - vertices[j].x); + + if (z < 0) { + flag |= 1; + } else if (z > 0) { + flag |= 2; + } + + if (flag === 3) { + return false; + } + } + + if (flag !== 0){ + return true; + } else { + return null; + } + }; + + /** + * Returns the convex hull of the input vertices as a new array of points. + * @method hull + * @param {vertices} vertices + * @return [vertex] vertices + */ + Vertices.hull = function(vertices) { + // http://geomalgorithms.com/a10-_hull-1.html + + var upper = [], + lower = [], + vertex, + i; + + // sort vertices on x-axis (y-axis for ties) + vertices = vertices.slice(0); + vertices.sort(function(vertexA, vertexB) { + var dx = vertexA.x - vertexB.x; + return dx !== 0 ? dx : vertexA.y - vertexB.y; + }); + + // build lower hull + for (i = 0; i < vertices.length; i += 1) { + vertex = vertices[i]; + + while (lower.length >= 2 + && Vector.cross3(lower[lower.length - 2], lower[lower.length - 1], vertex) <= 0) { + lower.pop(); + } + + lower.push(vertex); + } + + // build upper hull + for (i = vertices.length - 1; i >= 0; i -= 1) { + vertex = vertices[i]; + + while (upper.length >= 2 + && Vector.cross3(upper[upper.length - 2], upper[upper.length - 1], vertex) <= 0) { + upper.pop(); + } + + upper.push(vertex); + } + + // concatenation of the lower and upper hulls gives the convex hull + // omit last points because they are repeated at the beginning of the other list + upper.pop(); + lower.pop(); + + return upper.concat(lower); + }; + +})(); + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2018 Photon Storm Ltd. @@ -14885,7 +15381,7 @@ module.exports = MapData; /***/ }), -/* 77 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15105,7 +15601,7 @@ module.exports = LayerData; /***/ }), -/* 78 */ +/* 79 */ /***/ (function(module, exports) { /** @@ -15121,11 +15617,11 @@ module.exports = LayerData; * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {boolean} + * @return {boolean} `true` if the tile coordinates are within the bounds of the layer, otherwise `false`. */ var IsInLayerBounds = function (tileX, tileY, layer) { @@ -15136,7 +15632,7 @@ module.exports = IsInLayerBounds; /***/ }), -/* 79 */ +/* 80 */ /***/ (function(module, exports) { /** @@ -15262,7 +15758,7 @@ module.exports = Bounds; /***/ }), -/* 80 */ +/* 81 */ /***/ (function(module, exports) { /** @@ -15506,7 +16002,7 @@ module.exports = Vector; })(); /***/ }), -/* 81 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15568,7 +16064,7 @@ module.exports = FillPathWebGL; /***/ }), -/* 82 */ +/* 83 */ /***/ (function(module, exports) { /** @@ -15740,7 +16236,7 @@ module.exports = TWEEN_CONST; /***/ }), -/* 83 */ +/* 84 */ /***/ (function(module, exports) { /** @@ -15750,16 +16246,16 @@ module.exports = TWEEN_CONST; */ /** - * [description] + * Retrieves the value of the given key from an object. * * @function Phaser.Tweens.Builders.GetBoolean * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {*} defaultValue - [description] + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The key to look for in the `source` object. + * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. * - * @return {*} [description] + * @return {*} The retrieved value. */ var GetBoolean = function (source, key, defaultValue) { @@ -15781,7 +16277,7 @@ module.exports = GetBoolean; /***/ }), -/* 84 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -15810,7 +16306,7 @@ module.exports = HasValue; /***/ }), -/* 85 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15872,7 +16368,7 @@ module.exports = GetEaseFunction; /***/ }), -/* 86 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15975,7 +16471,7 @@ module.exports = Image; /***/ }), -/* 87 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16085,7 +16581,7 @@ var Sprite = __webpack_require__(61); * @constructor * @since 3.0.0 * @param {Phaser.Scene} scene - The scene this group belongs to. - * @param {(Phaser.GameObjects.GameObject[]|GroupConfig)} [children] - Game objects to add to this group; or the `config` argument. + * @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. * @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings. * * @see Phaser.Physics.Arcade.Group @@ -17197,7 +17693,7 @@ module.exports = Group; /***/ }), -/* 88 */ +/* 89 */ /***/ (function(module, exports) { /** @@ -17239,7 +17735,7 @@ module.exports = Contains; /***/ }), -/* 89 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17249,7 +17745,7 @@ module.exports = Contains; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(88); +var Contains = __webpack_require__(89); var GetPoint = __webpack_require__(309); var GetPoints = __webpack_require__(308); var Random = __webpack_require__(185); @@ -17607,7 +18103,7 @@ module.exports = Ellipse; /***/ }), -/* 90 */ +/* 91 */ /***/ (function(module, exports) { /** @@ -17653,7 +18149,7 @@ module.exports = SpliceOne; /***/ }), -/* 91 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -17792,7 +18288,7 @@ function init () OS.cordova = true; } - if (process && process.versions && process.versions.node) + if (typeof process !== 'undefined' && process.versions && process.versions.node) { OS.node = true; } @@ -17841,7 +18337,7 @@ module.exports = init(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(906))) /***/ }), -/* 92 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17875,7 +18371,7 @@ module.exports = FromPercent; /***/ }), -/* 93 */ +/* 94 */ /***/ (function(module, exports) { /** @@ -17920,466 +18416,6 @@ module.exports = { }; -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -/** -* The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. -* A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. -* A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). -* -* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). -* -* @class Vertices -*/ - -var Vertices = {}; - -module.exports = Vertices; - -var Vector = __webpack_require__(80); -var Common = __webpack_require__(33); - -(function() { - - /** - * Creates a new set of `Matter.Body` compatible vertices. - * The `points` argument accepts an array of `Matter.Vector` points orientated around the origin `(0, 0)`, for example: - * - * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }] - * - * The `Vertices.create` method returns a new array of vertices, which are similar to Matter.Vector objects, - * but with some additional references required for efficient collision detection routines. - * - * Vertices must be specified in clockwise order. - * - * Note that the `body` argument is not optional, a `Matter.Body` reference must be provided. - * - * @method create - * @param {vector[]} points - * @param {body} body - */ - Vertices.create = function(points, body) { - var vertices = []; - - for (var i = 0; i < points.length; i++) { - var point = points[i], - vertex = { - x: point.x, - y: point.y, - index: i, - body: body, - isInternal: false, - contact: null - }; - - vertex.contact = { - vertex: vertex, - normalImpulse: 0, - tangentImpulse: 0 - }; - - vertices.push(vertex); - } - - return vertices; - }; - - /** - * Parses a string containing ordered x y pairs separated by spaces (and optionally commas), - * into a `Matter.Vertices` object for the given `Matter.Body`. - * For parsing SVG paths, see `Svg.pathToVertices`. - * @method fromPath - * @param {string} path - * @param {body} body - * @return {vertices} vertices - */ - Vertices.fromPath = function(path, body) { - var pathPattern = /L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/ig, - points = []; - - path.replace(pathPattern, function(match, x, y) { - points.push({ x: parseFloat(x), y: parseFloat(y) }); - }); - - return Vertices.create(points, body); - }; - - /** - * Returns the centre (centroid) of the set of vertices. - * @method centre - * @param {vertices} vertices - * @return {vector} The centre point - */ - Vertices.centre = function(vertices) { - var area = Vertices.area(vertices, true), - centre = { x: 0, y: 0 }, - cross, - temp, - j; - - for (var i = 0; i < vertices.length; i++) { - j = (i + 1) % vertices.length; - cross = Vector.cross(vertices[i], vertices[j]); - temp = Vector.mult(Vector.add(vertices[i], vertices[j]), cross); - centre = Vector.add(centre, temp); - } - - return Vector.div(centre, 6 * area); - }; - - /** - * Returns the average (mean) of the set of vertices. - * @method mean - * @param {vertices} vertices - * @return {vector} The average point - */ - Vertices.mean = function(vertices) { - var average = { x: 0, y: 0 }; - - for (var i = 0; i < vertices.length; i++) { - average.x += vertices[i].x; - average.y += vertices[i].y; - } - - return Vector.div(average, vertices.length); - }; - - /** - * Returns the area of the set of vertices. - * @method area - * @param {vertices} vertices - * @param {bool} signed - * @return {number} The area - */ - Vertices.area = function(vertices, signed) { - var area = 0, - j = vertices.length - 1; - - for (var i = 0; i < vertices.length; i++) { - area += (vertices[j].x - vertices[i].x) * (vertices[j].y + vertices[i].y); - j = i; - } - - if (signed) - return area / 2; - - return Math.abs(area) / 2; - }; - - /** - * Returns the moment of inertia (second moment of area) of the set of vertices given the total mass. - * @method inertia - * @param {vertices} vertices - * @param {number} mass - * @return {number} The polygon's moment of inertia - */ - Vertices.inertia = function(vertices, mass) { - var numerator = 0, - denominator = 0, - v = vertices, - cross, - j; - - // find the polygon's moment of inertia, using second moment of area - // from equations at http://www.physicsforums.com/showthread.php?t=25293 - for (var n = 0; n < v.length; n++) { - j = (n + 1) % v.length; - cross = Math.abs(Vector.cross(v[j], v[n])); - numerator += cross * (Vector.dot(v[j], v[j]) + Vector.dot(v[j], v[n]) + Vector.dot(v[n], v[n])); - denominator += cross; - } - - return (mass / 6) * (numerator / denominator); - }; - - /** - * Translates the set of vertices in-place. - * @method translate - * @param {vertices} vertices - * @param {vector} vector - * @param {number} scalar - */ - Vertices.translate = function(vertices, vector, scalar) { - var i; - if (scalar) { - for (i = 0; i < vertices.length; i++) { - vertices[i].x += vector.x * scalar; - vertices[i].y += vector.y * scalar; - } - } else { - for (i = 0; i < vertices.length; i++) { - vertices[i].x += vector.x; - vertices[i].y += vector.y; - } - } - - return vertices; - }; - - /** - * Rotates the set of vertices in-place. - * @method rotate - * @param {vertices} vertices - * @param {number} angle - * @param {vector} point - */ - Vertices.rotate = function(vertices, angle, point) { - if (angle === 0) - return; - - var cos = Math.cos(angle), - sin = Math.sin(angle); - - for (var i = 0; i < vertices.length; i++) { - var vertice = vertices[i], - dx = vertice.x - point.x, - dy = vertice.y - point.y; - - vertice.x = point.x + (dx * cos - dy * sin); - vertice.y = point.y + (dx * sin + dy * cos); - } - - return vertices; - }; - - /** - * Returns `true` if the `point` is inside the set of `vertices`. - * @method contains - * @param {vertices} vertices - * @param {vector} point - * @return {boolean} True if the vertices contains point, otherwise false - */ - Vertices.contains = function(vertices, point) { - for (var i = 0; i < vertices.length; i++) { - var vertice = vertices[i], - nextVertice = vertices[(i + 1) % vertices.length]; - if ((point.x - vertice.x) * (nextVertice.y - vertice.y) + (point.y - vertice.y) * (vertice.x - nextVertice.x) > 0) { - return false; - } - } - - return true; - }; - - /** - * Scales the vertices from a point (default is centre) in-place. - * @method scale - * @param {vertices} vertices - * @param {number} scaleX - * @param {number} scaleY - * @param {vector} point - */ - Vertices.scale = function(vertices, scaleX, scaleY, point) { - if (scaleX === 1 && scaleY === 1) - return vertices; - - point = point || Vertices.centre(vertices); - - var vertex, - delta; - - for (var i = 0; i < vertices.length; i++) { - vertex = vertices[i]; - delta = Vector.sub(vertex, point); - vertices[i].x = point.x + delta.x * scaleX; - vertices[i].y = point.y + delta.y * scaleY; - } - - return vertices; - }; - - /** - * Chamfers a set of vertices by giving them rounded corners, returns a new set of vertices. - * The radius parameter is a single number or an array to specify the radius for each vertex. - * @method chamfer - * @param {vertices} vertices - * @param {number[]} radius - * @param {number} quality - * @param {number} qualityMin - * @param {number} qualityMax - */ - Vertices.chamfer = function(vertices, radius, quality, qualityMin, qualityMax) { - if (typeof radius === 'number') { - radius = [radius]; - } else { - radius = radius || [8]; - } - - // quality defaults to -1, which is auto - quality = (typeof quality !== 'undefined') ? quality : -1; - qualityMin = qualityMin || 2; - qualityMax = qualityMax || 14; - - var newVertices = []; - - for (var i = 0; i < vertices.length; i++) { - var prevVertex = vertices[i - 1 >= 0 ? i - 1 : vertices.length - 1], - vertex = vertices[i], - nextVertex = vertices[(i + 1) % vertices.length], - currentRadius = radius[i < radius.length ? i : radius.length - 1]; - - if (currentRadius === 0) { - newVertices.push(vertex); - continue; - } - - var prevNormal = Vector.normalise({ - x: vertex.y - prevVertex.y, - y: prevVertex.x - vertex.x - }); - - var nextNormal = Vector.normalise({ - x: nextVertex.y - vertex.y, - y: vertex.x - nextVertex.x - }); - - var diagonalRadius = Math.sqrt(2 * Math.pow(currentRadius, 2)), - radiusVector = Vector.mult(Common.clone(prevNormal), currentRadius), - midNormal = Vector.normalise(Vector.mult(Vector.add(prevNormal, nextNormal), 0.5)), - scaledVertex = Vector.sub(vertex, Vector.mult(midNormal, diagonalRadius)); - - var precision = quality; - - if (quality === -1) { - // automatically decide precision - precision = Math.pow(currentRadius, 0.32) * 1.75; - } - - precision = Common.clamp(precision, qualityMin, qualityMax); - - // use an even value for precision, more likely to reduce axes by using symmetry - if (precision % 2 === 1) - precision += 1; - - var alpha = Math.acos(Vector.dot(prevNormal, nextNormal)), - theta = alpha / precision; - - for (var j = 0; j < precision; j++) { - newVertices.push(Vector.add(Vector.rotate(radiusVector, theta * j), scaledVertex)); - } - } - - return newVertices; - }; - - /** - * Sorts the input vertices into clockwise order in place. - * @method clockwiseSort - * @param {vertices} vertices - * @return {vertices} vertices - */ - Vertices.clockwiseSort = function(vertices) { - var centre = Vertices.mean(vertices); - - vertices.sort(function(vertexA, vertexB) { - return Vector.angle(centre, vertexA) - Vector.angle(centre, vertexB); - }); - - return vertices; - }; - - /** - * Returns true if the vertices form a convex shape (vertices must be in clockwise order). - * @method isConvex - * @param {vertices} vertices - * @return {bool} `true` if the `vertices` are convex, `false` if not (or `null` if not computable). - */ - Vertices.isConvex = function(vertices) { - // http://paulbourke.net/geometry/polygonmesh/ - // Copyright (c) Paul Bourke (use permitted) - - var flag = 0, - n = vertices.length, - i, - j, - k, - z; - - if (n < 3) - return null; - - for (i = 0; i < n; i++) { - j = (i + 1) % n; - k = (i + 2) % n; - z = (vertices[j].x - vertices[i].x) * (vertices[k].y - vertices[j].y); - z -= (vertices[j].y - vertices[i].y) * (vertices[k].x - vertices[j].x); - - if (z < 0) { - flag |= 1; - } else if (z > 0) { - flag |= 2; - } - - if (flag === 3) { - return false; - } - } - - if (flag !== 0){ - return true; - } else { - return null; - } - }; - - /** - * Returns the convex hull of the input vertices as a new array of points. - * @method hull - * @param {vertices} vertices - * @return [vertex] vertices - */ - Vertices.hull = function(vertices) { - // http://geomalgorithms.com/a10-_hull-1.html - - var upper = [], - lower = [], - vertex, - i; - - // sort vertices on x-axis (y-axis for ties) - vertices = vertices.slice(0); - vertices.sort(function(vertexA, vertexB) { - var dx = vertexA.x - vertexB.x; - return dx !== 0 ? dx : vertexA.y - vertexB.y; - }); - - // build lower hull - for (i = 0; i < vertices.length; i += 1) { - vertex = vertices[i]; - - while (lower.length >= 2 - && Vector.cross3(lower[lower.length - 2], lower[lower.length - 1], vertex) <= 0) { - lower.pop(); - } - - lower.push(vertex); - } - - // build upper hull - for (i = vertices.length - 1; i >= 0; i -= 1) { - vertex = vertices[i]; - - while (upper.length >= 2 - && Vector.cross3(upper[upper.length - 2], upper[upper.length - 1], vertex) <= 0) { - upper.pop(); - } - - upper.push(vertex); - } - - // concatenation of the lower and upper hulls gives the convex hull - // omit last points because they are repeated at the beginning of the other list - upper.pop(); - lower.pop(); - - return upper.concat(lower); - }; - -})(); - - /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { @@ -18414,7 +18450,7 @@ var Class = __webpack_require__(0); * @generic T * @genericUse {T[]} - [elements] * - * @param {Array.<*>} [elements] - [description] + * @param {Array.<*>} [elements] - An optional array of elements to insert into this Set. */ var Set = new Class({ @@ -18423,7 +18459,7 @@ var Set = new Class({ function Set (elements) { /** - * [description] + * The entries of this Set. Stored internally as an array. * * @genericUse {T[]} - [$type] * @@ -18444,7 +18480,7 @@ var Set = new Class({ }, /** - * [description] + * Inserts the provided value into this Set. If the value is already contained in this Set this method will have no effect. * * @method Phaser.Structs.Set#set * @since 3.0.0 @@ -18452,7 +18488,7 @@ var Set = new Class({ * @genericUse {T} - [value] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {*} value - [description] + * @param {*} value - The value to insert into this Set. * * @return {Phaser.Structs.Set} This Set object. */ @@ -18467,17 +18503,18 @@ var Set = new Class({ }, /** - * [description] + * Get an element of this Set which has a property of the specified name, if that property is equal to the specified value. + * If no elements of this Set satisfy the condition then this method will return `null`. * * @method Phaser.Structs.Set#get * @since 3.0.0 * * @genericUse {T} - [value,$return] * - * @param {string} property - [description] - * @param {*} value - [description] + * @param {string} property - The property name to check on the elements of this Set. + * @param {*} value - The value to check for. * - * @return {*} [description] + * @return {*} The first element of this Set that meets the required condition, or `null` if this Set contains no elements that meet the condition. */ get: function (property, value) { @@ -18493,14 +18530,14 @@ var Set = new Class({ }, /** - * [description] + * Returns an array containing all the values in this Set. * * @method Phaser.Structs.Set#getArray * @since 3.0.0 * * @genericUse {T[]} - [$return] * - * @return {Array.<*>} [description] + * @return {Array.<*>} An array containing all the values in this Set. */ getArray: function () { @@ -18508,7 +18545,7 @@ var Set = new Class({ }, /** - * [description] + * Removes the given value from this Set if this Set contains that value. * * @method Phaser.Structs.Set#delete * @since 3.0.0 @@ -18516,7 +18553,7 @@ var Set = new Class({ * @genericUse {T} - [value] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {*} value - [description] + * @param {*} value - The value to remove from the Set. * * @return {Phaser.Structs.Set} This Set object. */ @@ -18533,7 +18570,7 @@ var Set = new Class({ }, /** - * [description] + * Dumps the contents of this Set to the console via `console.group`. * * @method Phaser.Structs.Set#dump * @since 3.0.0 @@ -18554,7 +18591,8 @@ var Set = new Class({ }, /** - * For when you know this Set will be modified during the iteration. + * Passes each value in this Set to the given callback. + * Use this function when you know this Set will be modified during the iteration, otherwise use `iterate`. * * @method Phaser.Structs.Set#each * @since 3.0.0 @@ -18562,8 +18600,8 @@ var Set = new Class({ * @genericUse {EachSetCallback.} - [callback] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {EachSetCallback} callback - [description] - * @param {*} callbackScope - [description] + * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains. + * @param {*} callbackScope - The scope of the callback. * * @return {Phaser.Structs.Set} This Set object. */ @@ -18598,6 +18636,7 @@ var Set = new Class({ }, /** + * Passes each value in this Set to the given callback. * For when you absolutely know this Set won't be modified during the iteration. * * @method Phaser.Structs.Set#iterate @@ -18606,8 +18645,8 @@ var Set = new Class({ * @genericUse {EachSetCallback.} - [callback] * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {EachSetCallback} callback - [description] - * @param {*} [callbackScope] - [description] + * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains. + * @param {*} callbackScope - The scope of the callback. * * @return {Phaser.Structs.Set} This Set object. */ @@ -18641,14 +18680,14 @@ var Set = new Class({ }, /** - * [description] + * Goes through each entry in this Set and invokes the given function on them, passing in the arguments. * * @method Phaser.Structs.Set#iterateLocal * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [$return] * - * @param {string} callbackKey - [description] + * @param {string} callbackKey - The key of the function to be invoked on each Set entry. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. * * @return {Phaser.Structs.Set} This Set object. @@ -18676,7 +18715,7 @@ var Set = new Class({ }, /** - * [description] + * Clears this Set so that it no longer contains any values. * * @method Phaser.Structs.Set#clear * @since 3.0.0 @@ -18693,16 +18732,16 @@ var Set = new Class({ }, /** - * [description] + * Returns `true` if this Set contains the given value, otherwise returns `false`. * * @method Phaser.Structs.Set#contains * @since 3.0.0 * * @genericUse {T} - [value] * - * @param {*} value - [description] + * @param {*} value - The value to check for in this Set. * - * @return {boolean} [description] + * @return {boolean} `true` if the given value was found in this Set, otherwise `false`. */ contains: function (value) { @@ -18710,16 +18749,16 @@ var Set = new Class({ }, /** - * [description] + * Returns a new Set containing all values that are either in this Set or in the Set provided as an argument. * * @method Phaser.Structs.Set#union * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [set,$return] * - * @param {Phaser.Structs.Set} set - [description] + * @param {Phaser.Structs.Set} set - The Set to perform the union with. * - * @return {Phaser.Structs.Set} [description] + * @return {Phaser.Structs.Set} A new Set containing all the values in this Set and the Set provided as an argument. */ union: function (set) { @@ -18739,16 +18778,16 @@ var Set = new Class({ }, /** - * [description] + * Returns a new Set that contains only the values which are in this Set and that are also in the given Set. * * @method Phaser.Structs.Set#intersect * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [set,$return] * - * @param {Phaser.Structs.Set} set - [description] + * @param {Phaser.Structs.Set} set - The Set to intersect this set with. * - * @return {Phaser.Structs.Set} [description] + * @return {Phaser.Structs.Set} The result of the intersection, as a new Set. */ intersect: function (set) { @@ -18766,16 +18805,16 @@ var Set = new Class({ }, /** - * [description] + * Returns a new Set containing all the values in this Set which are *not* also in the given Set. * * @method Phaser.Structs.Set#difference * @since 3.0.0 * * @genericUse {Phaser.Structs.Set.} - [set,$return] * - * @param {Phaser.Structs.Set} set - [description] + * @param {Phaser.Structs.Set} set - The Set to perform the difference with. * - * @return {Phaser.Structs.Set} [description] + * @return {Phaser.Structs.Set} A new Set containing all the values in this Set that are not also in the Set provided as an argument to this method. */ difference: function (set) { @@ -18793,7 +18832,9 @@ var Set = new Class({ }, /** - * [description] + * The size of this Set. This is the number of entries within it. + * Changing the size will truncate the Set if the given value is smaller than the current size. + * Increasing the size larger than the current size has no effect. * * @name Phaser.Structs.Set#size * @type {integer} @@ -18808,7 +18849,14 @@ var Set = new Class({ set: function (value) { - return this.entries.length = value; + if (value < this.entries.length) + { + return this.entries.length = value; + } + else + { + return this.entries.length; + } } } @@ -18872,8 +18920,8 @@ module.exports = Merge; var Defaults = __webpack_require__(128); var GetAdvancedValue = __webpack_require__(12); -var GetBoolean = __webpack_require__(83); -var GetEaseFunction = __webpack_require__(85); +var GetBoolean = __webpack_require__(84); +var GetEaseFunction = __webpack_require__(86); var GetNewValue = __webpack_require__(98); var GetProps = __webpack_require__(206); var GetTargets = __webpack_require__(130); @@ -19419,7 +19467,7 @@ var Tileset = new Class({ if (rowCount % 1 !== 0 || colCount % 1 !== 0) { - console.warn('Tileset ' + this.name + ' image tile area is not an even multiple of tile size'); + console.warn('Image tile area not tile size multiple in: ' + this.name); } // In Tiled a tileset image that is not an even multiple of the tile dimensions is truncated @@ -19476,8 +19524,8 @@ module.exports = Tileset; * @private * @since 3.0.0 * - * @param {integer} tileY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileY - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {number} @@ -19521,8 +19569,8 @@ module.exports = TileToWorldY; * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {number} @@ -19558,7 +19606,7 @@ module.exports = TileToWorldX; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var IsInLayerBounds = __webpack_require__(78); +var IsInLayerBounds = __webpack_require__(79); /** * Gets a tile at the given tile coordinates from the given layer. @@ -19569,8 +19617,7 @@ var IsInLayerBounds = __webpack_require__(78); * * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates @@ -19638,7 +19685,7 @@ module.exports = { GetTilesWithinWorldXY: __webpack_require__(479), HasTileAt: __webpack_require__(220), HasTileAtWorldXY: __webpack_require__(478), - IsInLayerBounds: __webpack_require__(78), + IsInLayerBounds: __webpack_require__(79), PutTileAt: __webpack_require__(134), PutTileAtWorldXY: __webpack_require__(477), PutTilesAt: __webpack_require__(476), @@ -19660,9 +19707,9 @@ module.exports = { TileToWorldXY: __webpack_require__(463), TileToWorldY: __webpack_require__(100), WeightedRandomize: __webpack_require__(462), - WorldToTileX: __webpack_require__(49), + WorldToTileX: __webpack_require__(50), WorldToTileXY: __webpack_require__(461), - WorldToTileY: __webpack_require__(48) + WorldToTileY: __webpack_require__(49) }; @@ -19975,16 +20022,16 @@ var Point = __webpack_require__(6); // See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ /** - * [description] + * Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting. * * @function Phaser.Geom.Intersects.LineToLine * @since 3.0.0 * - * @param {Phaser.Geom.Line} line1 - [description] - * @param {Phaser.Geom.Line} line2 - [description] - * @param {Phaser.Geom.Point} [out] - [description] + * @param {Phaser.Geom.Line} line1 - The first Line to check. + * @param {Phaser.Geom.Line} line2 - The second Line to check. + * @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection. * - * @return {boolean} [description] + * @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`. */ var LineToLine = function (line1, line2, out) { @@ -21062,13 +21109,13 @@ var StableSort = __webpack_require__(110); * @callback EachListCallback * @generic I - [item] * - * @param {*} item - [description] + * @param {*} item - The item which is currently being processed. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. */ /** * @classdesc - * [description] + * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. * * @class List * @memberOf Phaser.Structs @@ -21077,7 +21124,7 @@ var StableSort = __webpack_require__(110); * * @generic T * - * @param {*} parent - [description] + * @param {*} parent - The parent of this list. */ var List = new Class({ @@ -21107,7 +21154,9 @@ var List = new Class({ this.list = []; /** - * [description] + * The index of the current element. + * + * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. * * @name Phaser.Structs.List#position * @type {integer} @@ -21145,17 +21194,17 @@ var List = new Class({ }, /** - * [description] + * Adds the given item to the end of the list. Each item must be unique. * * @method Phaser.Structs.List#add * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*|Array.<*>} child - [description] + * @param {*|Array.<*>} child - The item, or array of items, to add to the list. * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. * - * @return {*} [description] + * @return {*} The list's underlying array. */ add: function (child, skipCallback) { @@ -21170,18 +21219,18 @@ var List = new Class({ }, /** - * [description] + * Adds an item to list, starting at a specified index. Each item must be unique within the list. * * @method Phaser.Structs.List#addAt * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] - * @param {integer} [index=0] - [description] + * @param {*} child - The item, or array of items, to add to the list. + * @param {integer} [index=0] - The index in the list at which the element(s) will be inserted. * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. * - * @return {*} [description] + * @return {*} The List's underlying array. */ addAt: function (child, index, skipCallback) { @@ -21196,16 +21245,16 @@ var List = new Class({ }, /** - * [description] + * Retrieves the item at a given position inside the List. * * @method Phaser.Structs.List#getAt * @since 3.0.0 * * @genericUse {T} - [$return] * - * @param {integer} index - [description] + * @param {integer} index - The index of the item. * - * @return {*} [description] + * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds. */ getAt: function (index) { @@ -21213,16 +21262,16 @@ var List = new Class({ }, /** - * [description] + * Locates an item within the List and returns its index. * * @method Phaser.Structs.List#getIndex * @since 3.0.0 * * @genericUse {T} - [child] * - * @param {*} child - [description] + * @param {*} child - The item to locate. * - * @return {integer} [description] + * @return {integer} The index of the item within the List, or -1 if it's not in the List. */ getIndex: function (child) { @@ -21242,7 +21291,7 @@ var List = new Class({ * * @param {string} property - The property to lexically sort by. * - * @return {Array.<*>} [description] + * @return {Phaser.Structs.List} This List object. */ sort: function (property) { @@ -21257,7 +21306,7 @@ var List = new Class({ }, /** - * [description] + * Internal handler for the {@link #sort} method which compares two items. * * @method Phaser.Structs.List#sortHandler * @private @@ -21265,10 +21314,10 @@ var List = new Class({ * * @genericUse {T} - [childA,childB] * - * @param {*} childA - [description] - * @param {*} childB - [description] + * @param {*} childA - The first item to compare. + * @param {*} childB - The second item to compare. * - * @return {integer} [description] + * @return {integer} The result of the comparison, which will be negative if the first item is smaller then second, positive if the first item is larger than the second, or 0 if they're equal. */ sortHandler: function (childA, childB) { @@ -21313,7 +21362,7 @@ var List = new Class({ }, /** - * [description] + * Returns the first element in a given part of the List which matches a specific criterion. * * @method Phaser.Structs.List#getFirst * @since 3.0.0 @@ -21321,12 +21370,12 @@ var List = new Class({ * @genericUse {T} - [value] * @genericUse {T | null} - [$return] * - * @param {string} property - [description] - * @param {*} value - [description] - * @param {number} [startIndex=0] - [description] - * @param {number} [endIndex] - [description] + * @param {string} property - The name of the property to test or a falsey value to have no criterion. + * @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence. + * @param {number} [startIndex=0] - The position in the List to start the search at. + * @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked. * - * @return {?*} [description] + * @return {?*} The first item which matches the given criterion, or `null` if no such item exists. */ getFirst: function (property, value, startIndex, endIndex) { @@ -21359,7 +21408,7 @@ var List = new Class({ * @param {integer} [startIndex] - The first child index to start the search from. * @param {integer} [endIndex] - The last child index to search up until. * - * @return {Array.<*>} [description] + * @return {Array.<*>} All items of the List which match the given criterion, if any. */ getAll: function (property, value, startIndex, endIndex) { @@ -21367,17 +21416,17 @@ var List = new Class({ }, /** - * [description] + * Returns the total number of items in the List which have a property matching the given value. * * @method Phaser.Structs.List#count * @since 3.0.0 * * @genericUse {T} - [value] * - * @param {string} property - [description] - * @param {*} value - [description] + * @param {string} property - The property to test on each item. + * @param {*} value - The value to test the property against. * - * @return {integer} [description] + * @return {integer} The total number of matching elements. */ count: function (property, value) { @@ -21385,15 +21434,15 @@ var List = new Class({ }, /** - * [description] + * Swaps the positions of two items in the list. * * @method Phaser.Structs.List#swap * @since 3.0.0 * * @genericUse {T} - [child1,child2] * - * @param {*} child1 - [description] - * @param {*} child2 - [description] + * @param {*} child1 - The first item to swap. + * @param {*} child2 - The second item to swap. */ swap: function (child1, child2) { @@ -21401,17 +21450,17 @@ var List = new Class({ }, /** - * [description] + * Moves an item in the List to a new position. * * @method Phaser.Structs.List#moveTo * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] - * @param {integer} index - [description] + * @param {*} child - The item to move. + * @param {integer} index - Moves an item in the List to a new position. * - * @return {*} [description] + * @return {*} The item that was moved. */ moveTo: function (child, index) { @@ -21419,17 +21468,17 @@ var List = new Class({ }, /** - * [description] + * Removes one or many items from the List. * * @method Phaser.Structs.List#remove * @since 3.0.0 * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item, or array of items, to remove. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * - * @return {*} [description] + * @return {*} The item, or array of items, which were successfully removed from the List. */ remove: function (child, skipCallback) { @@ -21444,17 +21493,17 @@ var List = new Class({ }, /** - * [description] + * Removes the item at the given position in the List. * * @method Phaser.Structs.List#removeAt * @since 3.0.0 * * @genericUse {T} - [$return] * - * @param {integer} index - [description] + * @param {integer} index - The position to remove the item from. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * - * @return {*} [description] + * @return {*} The item that was removed. */ removeAt: function (index, skipCallback) { @@ -21469,18 +21518,18 @@ var List = new Class({ }, /** - * [description] + * Removes the items within the given range in the List. * * @method Phaser.Structs.List#removeBetween * @since 3.0.0 * * @genericUse {T[]} - [$return] * - * @param {integer} [startIndex=0] - [description] - * @param {integer} [endIndex] - [description] + * @param {integer} [startIndex=0] - The index to start removing from. + * @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * - * @return {Array.<*>} [description] + * @return {Array.<*>} An array of the items which were removed.[description] */ removeBetween: function (startIndex, endIndex, skipCallback) { @@ -21526,9 +21575,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to bring to the top of the List. * - * @return {*} [description] + * @return {*} The item which was moved. */ bringToTop: function (child) { @@ -21543,9 +21592,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to send to the back of the list. * - * @return {*} [description] + * @return {*} The item which was moved. */ sendToBack: function (child) { @@ -21560,9 +21609,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to move up. * - * @return {*} [description] + * @return {*} The item which was moved. */ moveUp: function (child) { @@ -21579,9 +21628,9 @@ var List = new Class({ * * @genericUse {T} - [child,$return] * - * @param {*} child - [description] + * @param {*} child - The item to move down. * - * @return {*} [description] + * @return {*} The item which was moved. */ moveDown: function (child) { @@ -21608,7 +21657,7 @@ var List = new Class({ }, /** - * [description] + * Shuffles the items in the list. * * @method Phaser.Structs.List#shuffle * @since 3.0.0 @@ -21643,16 +21692,16 @@ var List = new Class({ }, /** - * [description] + * Checks if an item exists within the List. * * @method Phaser.Structs.List#exists * @since 3.0.0 * * @genericUse {T} - [child] * - * @param {*} child - [description] + * @param {*} child - The item to check for the existence of. * - * @return {boolean} True if the item is found in the list, otherwise false. + * @return {boolean} `true` if the item is found in the list, otherwise `false`. */ exists: function (child) { @@ -21667,8 +21716,8 @@ var List = new Class({ * * @genericUse {T} - [value] * - * @param {string} property - [description] - * @param {*} value - [description] + * @param {string} property - The name of the property to set. + * @param {*} value - The value to set the property to. * @param {integer} [startIndex] - The first child index to start the search from. * @param {integer} [endIndex] - The last child index to search up until. */ @@ -21709,7 +21758,7 @@ var List = new Class({ }, /** - * [description] + * Clears the List and recreates its internal array. * * @method Phaser.Structs.List#shutdown * @since 3.0.0 @@ -21722,7 +21771,7 @@ var List = new Class({ }, /** - * [description] + * Destroys this List. * * @method Phaser.Structs.List#destroy * @since 3.0.0 @@ -21737,7 +21786,7 @@ var List = new Class({ }, /** - * [description] + * The number of items inside the List. * * @name Phaser.Structs.List#length * @type {integer} @@ -21754,7 +21803,7 @@ var List = new Class({ }, /** - * [description] + * The first item in the List or `null` for an empty List. * * @name Phaser.Structs.List#first * @type {integer} @@ -21780,7 +21829,7 @@ var List = new Class({ }, /** - * [description] + * The last item in the List, or `null` for an empty List. * * @name Phaser.Structs.List#last * @type {integer} @@ -21806,7 +21855,9 @@ var List = new Class({ }, /** - * [description] + * The next item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. * * @name Phaser.Structs.List#next * @type {integer} @@ -21832,7 +21883,9 @@ var List = new Class({ }, /** - * [description] + * The previous item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. * * @name Phaser.Structs.List#previous * @type {integer} @@ -22370,6 +22423,9 @@ var Frame = new Class({ // Need to check for intersection between the cut area and the crop area // If there is none, we set UV to be empty, otherwise set it to be the intersection area + width = Clamp(width, 0, cw - x); + height = Clamp(height, 0, ch - y); + var cropRight = x + width; var cropBottom = y + height; @@ -24004,7 +24060,7 @@ module.exports = IsSizePowerOfTwo; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var OS = __webpack_require__(91); +var OS = __webpack_require__(92); /** * Determines the browser type and version running this Phaser Game instance. @@ -24149,7 +24205,7 @@ var Components = __webpack_require__(14); var DegToRad = __webpack_require__(31); var EventEmitter = __webpack_require__(11); var Rectangle = __webpack_require__(9); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var ValueToColor = __webpack_require__(178); var Vector2 = __webpack_require__(3); @@ -24942,8 +24998,8 @@ var BaseCamera = new Class({ var sy = y + ((scrollX * s + scrollY * c) * zoom); // Apply transform to point - output.x = (sx * ima + sy * imc + ime) * res; - output.y = (sx * imb + sy * imd + imf) * res; + output.x = (sx * ima + sy * imc) * res + ime; + output.y = (sx * imb + sy * imd) * res + imf; return output; }, @@ -26624,12 +26680,12 @@ module.exports = Perimeter; var BlendModes = __webpack_require__(66); var Circle = __webpack_require__(71); -var CircleContains = __webpack_require__(39); +var CircleContains = __webpack_require__(40); var Class = __webpack_require__(0); var Components = __webpack_require__(14); var GameObject = __webpack_require__(19); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); /** * @classdesc @@ -26930,11 +26986,11 @@ var Bodies = {}; module.exports = Bodies; -var Vertices = __webpack_require__(94); +var Vertices = __webpack_require__(76); var Common = __webpack_require__(33); var Body = __webpack_require__(67); -var Bounds = __webpack_require__(79); -var Vector = __webpack_require__(80); +var Bounds = __webpack_require__(80); +var Vector = __webpack_require__(81); var decomp = __webpack_require__(1068); (function() { @@ -27414,7 +27470,7 @@ module.exports = TweenData; var Class = __webpack_require__(0); var GameObjectCreator = __webpack_require__(13); var GameObjectFactory = __webpack_require__(5); -var TWEEN_CONST = __webpack_require__(82); +var TWEEN_CONST = __webpack_require__(83); /** * @classdesc @@ -27734,12 +27790,12 @@ var Tween = new Class({ }, /** - * [description] + * Checks if the Tween is currently active. * * @method Phaser.Tweens.Tween#isPlaying * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if the Tween is active, otherwise `false`. */ isPlaying: function () { @@ -27747,12 +27803,12 @@ var Tween = new Class({ }, /** - * [description] + * Checks if the Tween is currently paused. * * @method Phaser.Tweens.Tween#isPaused * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if the Tween is paused, otherwise `false`. */ isPaused: function () { @@ -28130,7 +28186,7 @@ var Tween = new Class({ }, /** - * [description] + * Resumes the playback of a previously paused Tween. * * @method Phaser.Tweens.Tween#resume * @since 3.0.0 @@ -28815,17 +28871,17 @@ module.exports = Tween; /** * @typedef {object} Phaser.Tweens.TweenConfigDefaults * - * @property {(object|object[])} targets - [description] - * @property {number} [delay=0] - [description] - * @property {number} [duration=1000] - [description] - * @property {string} [ease='Power0'] - [description] - * @property {array} [easeParams] - [description] - * @property {number} [hold=0] - [description] - * @property {number} [repeat=0] - [description] - * @property {number} [repeatDelay=0] - [description] - * @property {boolean} [yoyo=false] - [description] - * @property {boolean} [flipX=false] - [description] - * @property {boolean} [flipY=false] - [description] + * @property {(object|object[])} targets - The object, or an array of objects, to run the tween on. + * @property {number} [delay=0] - The number of milliseconds to delay before the tween will start. + * @property {number} [duration=1000] - The duration of the tween in milliseconds. + * @property {string} [ease='Power0'] - The easing equation to use for the tween. + * @property {array} [easeParams] - Optional easing parameters. + * @property {number} [hold=0] - The number of milliseconds to hold the tween for before yoyo'ing. + * @property {number} [repeat=0] - The number of times to repeat the tween. + * @property {number} [repeatDelay=0] - The number of milliseconds to pause before a tween will repeat. + * @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + * @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. + * @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. */ var TWEEN_DEFAULTS = { @@ -29076,7 +29132,7 @@ module.exports = GetTargets; */ var Formats = __webpack_require__(29); -var MapData = __webpack_require__(76); +var MapData = __webpack_require__(77); var Parse = __webpack_require__(218); var Tilemap = __webpack_require__(210); @@ -29162,8 +29218,8 @@ module.exports = ParseToTilemap; */ var Formats = __webpack_require__(29); -var LayerData = __webpack_require__(77); -var MapData = __webpack_require__(76); +var LayerData = __webpack_require__(78); +var MapData = __webpack_require__(77); var Tile = __webpack_require__(55); /** @@ -29261,8 +29317,8 @@ module.exports = Parse2DArray; * @private * @since 3.0.0 * - * @param {integer} tileIndex - [description] - * @param {boolean} [collides=true] - [description] + * @param {integer} tileIndex - The tile index to set the collision boolean for. + * @param {boolean} [collides=true] - Should the tile index collide or not? * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetLayerCollisionIndex = function (tileIndex, collides, layer) @@ -29293,7 +29349,7 @@ module.exports = SetLayerCollisionIndex; */ var Tile = __webpack_require__(55); -var IsInLayerBounds = __webpack_require__(78); +var IsInLayerBounds = __webpack_require__(79); var CalculateFacesAt = __webpack_require__(135); var SetTileCollision = __webpack_require__(56); @@ -29308,9 +29364,9 @@ var SetTileCollision = __webpack_require__(56); * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. @@ -29459,7 +29515,7 @@ module.exports = Composite; var Events = __webpack_require__(195); var Common = __webpack_require__(33); -var Bounds = __webpack_require__(79); +var Bounds = __webpack_require__(80); var Body = __webpack_require__(67); (function() { @@ -30242,13 +30298,13 @@ var Vector3 = new Class({ }, /** - * [description] + * Calculate the cross (vector) product of two given Vectors. * * @method Phaser.Math.Vector3#crossVectors * @since 3.0.0 * - * @param {Phaser.Math.Vector3} a - [description] - * @param {Phaser.Math.Vector3} b - [description] + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. * * @return {Phaser.Math.Vector3} This Vector3. */ @@ -30568,7 +30624,7 @@ var Vector3 = new Class({ * * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. * - * @return {number} [description] + * @return {number} The dot product of this Vector and `v`. */ dot: function (v) { @@ -30576,12 +30632,12 @@ var Vector3 = new Class({ }, /** - * [description] + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. * * @method Phaser.Math.Vector3#cross * @since 3.0.0 * - * @param {Phaser.Math.Vector3} v - [description] + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. * * @return {Phaser.Math.Vector3} This Vector3. */ @@ -31866,17 +31922,18 @@ module.exports = RotateAroundXY; // if 'returnFirst' is true it will return after the first point within the triangle is found /** - * [description] + * Filters an array of point-like objects to only those contained within a triangle. + * If `returnFirst` is true, will return an array containing only the first point in the provided array that is within the triangle (or an empty array if there are no such points). * * @function Phaser.Geom.Triangle.ContainsArray * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Point[]} points - [description] - * @param {boolean} [returnFirst] - [description] - * @param {array} [out] - [description] + * @param {Phaser.Geom.Triangle} triangle - The triangle that the points are being checked in. + * @param {Phaser.Geom.Point[]} points - An array of point-like objects (objects that have an `x` and `y` property) + * @param {boolean} [returnFirst=false] - If `true`, return an array containing only the first point found that is within the triangle. + * @param {array} [out] - If provided, the points that are within the triangle will be appended to this array instead of being added to a new array. If `returnFirst` is true, only the first point found within the triangle will be appended. This array will also be returned by this function. * - * @return {Phaser.Geom.Point[]} [description] + * @return {Phaser.Geom.Point[]} An array containing all the points from `points` that are within the triangle, if an array was provided as `out`, points will be appended to that array and it will also be returned here. */ var ContainsArray = function (triangle, points, returnFirst, out) { @@ -32644,16 +32701,16 @@ module.exports = Quad; // Adapted from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html by Jonas Raoni Soares Silva /** - * [description] + * Checks if a point is within the bounds of a Polygon. * * @function Phaser.Geom.Polygon.Contains * @since 3.0.0 * - * @param {Phaser.Geom.Polygon} polygon - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Polygon} polygon - The Polygon to check against. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the point is within the bounds of the Polygon, otherwise `false`. */ var Contains = function (polygon, x, y) { @@ -32736,15 +32793,15 @@ var Polygon = new Class({ }, /** - * [description] + * Check to see if the Polygon contains the given x / y coordinates. * * @method Phaser.Geom.Polygon#contains * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate to check within the polygon. + * @param {number} y - The y coordinate to check within the polygon. * - * @return {boolean} [description] + * @return {boolean} `true` if the coordinates are within the polygon, otherwise `false`. */ contains: function (x, y) { @@ -32756,6 +32813,7 @@ var Polygon = new Class({ * * The points can be set from a variety of formats: * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` @@ -32775,6 +32833,11 @@ var Polygon = new Class({ this.area = 0; this.points = []; + if (typeof points === 'string') + { + points = points.split(' '); + } + if (!Array.isArray(points)) { return this; @@ -32788,10 +32851,10 @@ var Polygon = new Class({ { p = { x: 0, y: 0 }; - if (typeof points[i] === 'number') + if (typeof points[i] === 'number' || typeof points[i] === 'string') { - p.x = points[i]; - p.y = points[i + 1]; + p.x = parseFloat(points[i]); + p.y = parseFloat(points[i + 1]); i++; } else if (Array.isArray(points[i])) @@ -32826,7 +32889,7 @@ var Polygon = new Class({ * @method Phaser.Geom.Polygon#calculateArea * @since 3.0.0 * - * @return {number} [description] + * @return {number} The area of the polygon. */ calculateArea: function () { @@ -35873,7 +35936,16 @@ var ParticleEmitterManager = new Class({ { this.frame = this.texture.get(frame); - this.frameNames = this.texture.getFramesFromTextureSource(this.frame.sourceIndex); + var frames = this.texture.getFramesFromTextureSource(this.frame.sourceIndex); + + var names = []; + + frames.forEach(function (sourceFrame) + { + names.push(sourceFrame.name); + }); + + this.frameNames = names; this.defaultFrame = this.frame; @@ -36240,7 +36312,7 @@ var ComponentsTransform = __webpack_require__(391); var ComponentsVisible = __webpack_require__(390); var ComponentsScrollFactor = __webpack_require__(393); -var Ellipse = __webpack_require__(89); +var Ellipse = __webpack_require__(90); var GameObject = __webpack_require__(19); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(4); @@ -37717,9 +37789,9 @@ var Graphics = new Class({ // var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip) this.renderCanvas(renderer, this, 0, Graphics.TargetCamera, null, ctx, false); - if (renderer.gl && texture) + if (texture) { - texture.source[0].glTexture = renderer.canvasToTexture(ctx.canvas, texture.source[0].glTexture); + texture.refresh(); } } @@ -38387,10 +38459,6 @@ var Container = new Class({ gameObject.parentContainer = this; } - - // Game Objects automatically listen to the Scene shutdown event, but - // we don't need this if they're in a Container - this._sysEvents.off('shutdown', gameObject.destroy, gameObject); }, /** @@ -38409,8 +38477,6 @@ var Container = new Class({ if (this.exclusive) { gameObject.parentContainer = null; - - this._sysEvents.once('shutdown', gameObject.destroy, gameObject); } }, @@ -39688,7 +39754,7 @@ module.exports = { SendToBack: __webpack_require__(849), SetAll: __webpack_require__(848), Shuffle: __webpack_require__(121), - SpliceOne: __webpack_require__(90), + SpliceOne: __webpack_require__(91), StableSort: __webpack_require__(110), Swap: __webpack_require__(847) @@ -39947,16 +40013,19 @@ var Texture = new Class({ * @since 3.0.0 * * @param {integer} sourceIndex - The index of the TextureSource to get the Frames from. + * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array? * * @return {Phaser.Textures.Frame[]} An array of Texture Frames. */ - getFramesFromTextureSource: function (sourceIndex) + getFramesFromTextureSource: function (sourceIndex, includeBase) { + if (includeBase === undefined) { includeBase = false; } + var out = []; for (var frameName in this.frames) { - if (frameName === '__BASE') + if (frameName === '__BASE' && !includeBase) { continue; } @@ -39965,7 +40034,7 @@ var Texture = new Class({ if (frame.sourceIndex === sourceIndex) { - out.push(frame.name); + out.push(frame); } } @@ -41015,7 +41084,7 @@ module.exports = DefaultPlugins; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var OS = __webpack_require__(91); +var OS = __webpack_require__(92); var Browser = __webpack_require__(118); var CanvasPool = __webpack_require__(24); @@ -41385,17 +41454,17 @@ var Rectangle = __webpack_require__(9); // ] /** - * [description] + * Constructs new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds. * * @function Phaser.Geom.Rectangle.FromPoints * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [out,$return] * - * @param {array} points - [description] - * @param {Phaser.Geom.Rectangle} [out] - [description] + * @param {array} points - An array of points (either arrays with two elements corresponding to the X and Y coordinate or an object with public `x` and `y` properties) which should be surrounded by the Rectangle. + * @param {Phaser.Geom.Rectangle} [out] - Optional Rectangle to adjust. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted `out` Rectangle, or a new Rectangle if none was provided. */ var FromPoints = function (points, out) { @@ -41543,18 +41612,18 @@ module.exports = { // Centers this Rectangle so that the center coordinates match the given x and y values. /** - * [description] + * Moves the top-left corner of a Rectangle so that its center is at the given coordinates. * * @function Phaser.Geom.Rectangle.CenterOn * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to be centered. + * @param {number} x - The X coordinate of the Rectangle's center. + * @param {number} y - The Y coordinate of the Rectangle's center. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The centered rectangle. */ var CenterOn = function (rect, x, y) { @@ -41987,11 +42056,14 @@ var Class = __webpack_require__(0); /** * @classdesc * The keys of a Map can be arbitrary values. + * + * ```javascript * var map = new Map([ * [ 1, 'one' ], * [ 2, 'two' ], * [ 3, 'three' ] * ]); + * ``` * * @class Map * @memberOf Phaser.Structs @@ -42002,7 +42074,7 @@ var Class = __webpack_require__(0); * @generic V * @genericUse {V[]} - [elements] * - * @param {Array.<*>} elements - [description] + * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with. */ var Map = new Class({ @@ -42011,7 +42083,7 @@ var Map = new Class({ function Map (elements) { /** - * [description] + * The entries in this Map. * * @genericUse {Object.} - [$type] * @@ -42023,7 +42095,7 @@ var Map = new Class({ this.entries = {}; /** - * [description] + * The number of key / value pairs in this Map. * * @name Phaser.Structs.Map#size * @type {number} @@ -42042,7 +42114,7 @@ var Map = new Class({ }, /** - * [description] + * Adds an element with a specified `key` and `value` to this Map. * * @method Phaser.Structs.Map#set * @since 3.0.0 @@ -42051,8 +42123,8 @@ var Map = new Class({ * @genericUse {V} - [value] * @genericUse {Phaser.Structs.Map.} - [$return] * - * @param {string} key - [description] - * @param {*} value - [description] + * @param {string} key - The key of the element to be added to this Map. + * @param {*} value - The value of the element to be added to this Map. * * @return {Phaser.Structs.Map} This Map object. */ @@ -42068,7 +42140,7 @@ var Map = new Class({ }, /** - * [description] + * Returns the value associated to the `key`, or `undefined` if there is none. * * @method Phaser.Structs.Map#get * @since 3.0.0 @@ -42076,9 +42148,9 @@ var Map = new Class({ * @genericUse {K} - [key] * @genericUse {V} - [$return] * - * @param {string} key - [description] + * @param {string} key - The key of the element to return from the `Map` object. * - * @return {*} [description] + * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object. */ get: function (key) { @@ -42089,14 +42161,14 @@ var Map = new Class({ }, /** - * [description] + * Returns an `Array` of all the values stored in this Map. * * @method Phaser.Structs.Map#getArray * @since 3.0.0 * * @genericUse {V[]} - [$return] * - * @return {Array.<*>} [description] + * @return {Array.<*>} An array of the values stored in this Map. */ getArray: function () { @@ -42112,16 +42184,16 @@ var Map = new Class({ }, /** - * [description] + * Returns a boolean indicating whether an element with the specified key exists or not. * * @method Phaser.Structs.Map#has * @since 3.0.0 * * @genericUse {K} - [key] * - * @param {string} key - [description] + * @param {string} key - The key of the element to test for presence of in this Map. * - * @return {boolean} [description] + * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`. */ has: function (key) { @@ -42129,7 +42201,7 @@ var Map = new Class({ }, /** - * [description] + * Delete the specified element from this Map. * * @method Phaser.Structs.Map#delete * @since 3.0.0 @@ -42137,7 +42209,7 @@ var Map = new Class({ * @genericUse {K} - [key] * @genericUse {Phaser.Structs.Map.} - [$return] * - * @param {string} key - [description] + * @param {string} key - The key of the element to delete from this Map. * * @return {Phaser.Structs.Map} This Map object. */ @@ -42153,7 +42225,7 @@ var Map = new Class({ }, /** - * [description] + * Delete all entries from this Map. * * @method Phaser.Structs.Map#clear * @since 3.0.0 @@ -42176,14 +42248,14 @@ var Map = new Class({ }, /** - * [description] + * Returns all entries keys in this Map. * * @method Phaser.Structs.Map#keys * @since 3.0.0 * * @genericUse {K[]} - [$return] * - * @return {string[]} [description] + * @return {string[]} Array containing entries' keys. */ keys: function () { @@ -42191,14 +42263,14 @@ var Map = new Class({ }, /** - * [description] + * Returns an `Array` of all entries. * * @method Phaser.Structs.Map#values * @since 3.0.0 * * @genericUse {V[]} - [$return] * - * @return {Array.<*>} [description] + * @return {Array.<*>} An `Array` of entries. */ values: function () { @@ -42214,7 +42286,7 @@ var Map = new Class({ }, /** - * [description] + * Dumps the contents of this Map to the console via `console.group`. * * @method Phaser.Structs.Map#dump * @since 3.0.0 @@ -42236,7 +42308,7 @@ var Map = new Class({ }, /** - * [description] + * Passes all entries in this Map to the given callback. * * @method Phaser.Structs.Map#each * @since 3.0.0 @@ -42244,7 +42316,7 @@ var Map = new Class({ * @genericUse {EachMapCallback.} - [callback] * @genericUse {Phaser.Structs.Map.} - [$return] * - * @param {EachMapCallback} callback - [description] + * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map. * * @return {Phaser.Structs.Map} This Map object. */ @@ -42264,16 +42336,16 @@ var Map = new Class({ }, /** - * [description] + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. * * @method Phaser.Structs.Map#contains * @since 3.0.0 * * @genericUse {V} - [value] * - * @param {*} value - [description] + * @param {*} value - The value to search for. * - * @return {boolean} [description] + * @return {boolean} `true` if the value is found, otherwise `false`. */ contains: function (value) { @@ -42291,17 +42363,16 @@ var Map = new Class({ }, /** - * Merges all new keys from the given Map into this one - * If it encounters a key that already exists it will be skipped - * unless override = true. + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. * * @method Phaser.Structs.Map#merge * @since 3.0.0 * * @genericUse {Phaser.Structs.Map.} - [map,$return] * - * @param {Phaser.Structs.Map} map - [description] - * @param {boolean} [override=false] - [description] + * @param {Phaser.Structs.Map} map - The Map to merge in to this Map. + * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. * * @return {Phaser.Structs.Map} This Map object. */ @@ -42694,17 +42765,17 @@ module.exports = Pipeline; var Point = __webpack_require__(6); /** - * [description] + * Returns a random point within a Rectangle. * * @function Phaser.Geom.Rectangle.Random * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point} out - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to return a point from. + * @param {Phaser.Geom.Point} out - The object to update with the point's coordinates. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} The modified `out` object, or a new Point if none was provided. */ var Random = function (rect, out) { @@ -43136,10 +43207,10 @@ var Constraint = {}; module.exports = Constraint; -var Vertices = __webpack_require__(94); -var Vector = __webpack_require__(80); +var Vertices = __webpack_require__(76); +var Vector = __webpack_require__(81); var Sleeping = __webpack_require__(223); -var Bounds = __webpack_require__(79); +var Bounds = __webpack_require__(80); var Axes = __webpack_require__(505); var Common = __webpack_require__(33); @@ -43712,7 +43783,7 @@ var GetFastValue = __webpack_require__(2); var ModelViewProjection = __webpack_require__(893); var ShaderSourceFS = __webpack_require__(892); var ShaderSourceVS = __webpack_require__(891); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var Utils = __webpack_require__(10); var WebGLPipeline = __webpack_require__(198); @@ -43962,7 +44033,7 @@ var TextureTintPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#onBind * @since 3.0.0 * - * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + * @return {this} This WebGLPipeline instance. */ onBind: function () { @@ -43983,7 +44054,7 @@ var TextureTintPipeline = new Class({ * @param {number} height - The new height. * @param {number} resolution - The resolution. * - * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + * @return {this} This WebGLPipeline instance. */ resize: function (width, height, resolution) { @@ -44019,7 +44090,7 @@ var TextureTintPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#flush * @since 3.0.0 * - * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + * @return {this} This WebGLPipeline instance. */ flush: function () { @@ -44077,8 +44148,8 @@ var TextureTintPipeline = new Class({ var v1 = frame.v1; var frameX = frame.x; var frameY = frame.y; - var frameWidth = frame.width; - var frameHeight = frame.height; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; var x = -sprite.displayOriginX + frameX; var y = -sprite.displayOriginY + frameY; @@ -44402,6 +44473,7 @@ var TextureTintPipeline = new Class({ * @param {number} vOffset - Vertical offset on texture coordinate. * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera. * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container. + * @param {boolean} [skipFlip=false] - Skip the renderTexture check. */ batchTexture: function ( gameObject, @@ -44418,7 +44490,8 @@ var TextureTintPipeline = new Class({ tintTL, tintTR, tintBL, tintBR, tintEffect, uOffset, vOffset, camera, - parentTransformMatrix) + parentTransformMatrix, + skipFlip) { this.renderer.setPipeline(this, gameObject); @@ -44473,7 +44546,7 @@ var TextureTintPipeline = new Class({ } // Invert the flipY if this is a RenderTexture - flipY = flipY ^ (texture.isRenderTexture ? 1 : 0); + flipY = flipY ^ (!skipFlip && texture.isRenderTexture ? 1 : 0); if (flipX) { @@ -45098,7 +45171,7 @@ var ForwardDiffuseLightPipeline = new Class({ * * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. * - * @return {Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline} [description] + * @return {this} This WebGLPipeline instance. */ onBind: function (gameObject) { @@ -45129,7 +45202,7 @@ var ForwardDiffuseLightPipeline = new Class({ * @param {Phaser.Scene} scene - [description] * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] * - * @return {Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline} [description] + * @return {this} This WebGLPipeline instance. */ onRender: function (scene, camera) { @@ -46245,7 +46318,7 @@ module.exports = WebGLPipeline; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * Wrap an angle in degrees. @@ -46277,7 +46350,7 @@ module.exports = WrapDegrees; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var MathWrap = __webpack_require__(52); +var MathWrap = __webpack_require__(53); /** * Wrap an angle. @@ -46338,7 +46411,7 @@ module.exports = g; var Class = __webpack_require__(0); var EventEmitter = __webpack_require__(11); var TweenBuilder = __webpack_require__(97); -var TWEEN_CONST = __webpack_require__(82); +var TWEEN_CONST = __webpack_require__(83); /** * @classdesc @@ -46574,12 +46647,13 @@ var Timeline = new Class({ }, /** - * [description] + * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. * * @method Phaser.Tweens.Timeline#setTimeScale * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - The time scale value to set. * * @return {Phaser.Tweens.Timeline} This Timeline object. */ @@ -46591,12 +46665,12 @@ var Timeline = new Class({ }, /** - * [description] + * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. * * @method Phaser.Tweens.Timeline#getTimeScale * @since 3.0.0 * - * @return {number} [description] + * @return {number} The value of the time scale applied to this Tween. */ getTimeScale: function () { @@ -46604,12 +46678,12 @@ var Timeline = new Class({ }, /** - * [description] + * Check whether or not the Timeline is playing. * * @method Phaser.Tweens.Timeline#isPlaying * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} `true` if this Timeline is active, otherwise `false`. */ isPlaying: function () { @@ -46854,7 +46928,7 @@ var Timeline = new Class({ }, /** - * [description] + * Sets a callback for the Tween Manager. * * @method Phaser.Tweens.Timeline#setCallback * @since 3.0.0 @@ -47174,7 +47248,7 @@ var Timeline = new Class({ }, /** - * [description] + * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags them for removal by the TweenManager. * * @method Phaser.Tweens.Timeline#destroy * @since 3.0.0 @@ -47207,8 +47281,8 @@ module.exports = Timeline; var Clone = __webpack_require__(63); var Defaults = __webpack_require__(128); var GetAdvancedValue = __webpack_require__(12); -var GetBoolean = __webpack_require__(83); -var GetEaseFunction = __webpack_require__(85); +var GetBoolean = __webpack_require__(84); +var GetEaseFunction = __webpack_require__(86); var GetNewValue = __webpack_require__(98); var GetTargets = __webpack_require__(130); var GetTweens = __webpack_require__(205); @@ -47358,8 +47432,8 @@ module.exports = TimelineBuilder; var Defaults = __webpack_require__(128); var GetAdvancedValue = __webpack_require__(12); -var GetBoolean = __webpack_require__(83); -var GetEaseFunction = __webpack_require__(85); +var GetBoolean = __webpack_require__(84); +var GetEaseFunction = __webpack_require__(86); var GetNewValue = __webpack_require__(98); var GetValue = __webpack_require__(4); var GetValueOp = __webpack_require__(129); @@ -47538,9 +47612,9 @@ var RESERVED = __webpack_require__(437); * @function Phaser.Tweens.Builders.GetProps * @since 3.0.0 * - * @param {object} config - [description] + * @param {object} config - The configuration object of the tween to get the target(s) from. * - * @return {array} [description] + * @return {array} An array of all the targets the tween is operating on. */ var GetProps = function (config) { @@ -47911,16 +47985,18 @@ var CONST = __webpack_require__(26); var GameObject = __webpack_require__(19); var StaticTilemapLayerRender = __webpack_require__(446); var TilemapComponents = __webpack_require__(103); +var TransformMatrix = __webpack_require__(38); var Utils = __webpack_require__(10); /** * @classdesc - * A StaticTilemapLayer is a game object that renders LayerData from a Tilemap. A - * StaticTilemapLayer can only render tiles from a single tileset. + * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. * - * A StaticTilemapLayer is optimized for speed over flexibility. You cannot apply per-tile - * effects like tint or alpha. You cannot change the tiles in a StaticTilemapLayer. Use this - * over a DynamicTilemapLayer when you don't need either of those features. + * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile + * effects like tint or alpha, or change the tiles or tilesets the layer uses. + * + * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. * * @class StaticTilemapLayer * @extends Phaser.GameObjects.GameObject @@ -47941,10 +48017,10 @@ var Utils = __webpack_require__(10); * @extends Phaser.GameObjects.Components.Visible * @extends Phaser.GameObjects.Components.ScrollFactor * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. * @param {integer} layerIndex - The index of the LayerData associated with this layer. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset used to render the tiles in this layer. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. */ @@ -48012,16 +48088,19 @@ var StaticTilemapLayer = new Class({ */ this.layer = tilemap.layers[layerIndex]; - this.layer.tilemapLayer = this; // Link the LayerData with this static tilemap layer + // Link the LayerData with this static tilemap layer + this.layer.tilemapLayer = this; /** - * The Tileset associated with this layer. A tilemap layer can only render from one Tileset. + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. * * @name Phaser.Tilemaps.StaticTilemapLayer#tileset - * @type {Phaser.Tilemaps.Tileset} + * @type {Phaser.Tilemaps.Tileset[]} * @since 3.0.0 */ - this.tileset = tileset; + this.tileset = []; /** * Used internally by the Canvas renderer. @@ -48124,14 +48203,8 @@ var StaticTilemapLayer = new Class({ this.cullCallback = TilemapComponents.CullTiles; /** - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer - * @type {array} - * @private - * @since 3.0.0 - */ - this.vertexBuffer = null; - - /** + * A reference to the renderer. + * * @name Phaser.Tilemaps.StaticTilemapLayer#renderer * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @private @@ -48140,44 +48213,76 @@ var StaticTilemapLayer = new Class({ this.renderer = scene.sys.game.renderer; /** + * An array of vertex buffer objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer + * @type {WebGLBuffer[]} + * @private + * @since 3.0.0 + */ + this.vertexBuffer = []; + + /** + * An array of ArrayBuffer objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * * @name Phaser.Tilemaps.StaticTilemapLayer#bufferData - * @type {ArrayBuffer} + * @type {ArrayBuffer[]} * @private * @since 3.0.0 */ - this.bufferData = null; + this.bufferData = []; /** + * An array of Float32 Array objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewF32 - * @type {Float32Array} + * @type {Float32Array[]} * @private * @since 3.0.0 */ - this.vertexViewF32 = null; + this.vertexViewF32 = []; /** + * An array of Uint32 Array objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewU32 - * @type {Uint32Array} + * @type {Uint32Array[]} * @private * @since 3.0.0 */ - this.vertexViewU32 = null; + this.vertexViewU32 = []; /** + * An array of booleans, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single boolean. + * * @name Phaser.Tilemaps.StaticTilemapLayer#dirty - * @type {boolean} + * @type {boolean[]} * @private * @since 3.0.0 */ - this.dirty = true; + this.dirty = []; /** + * An array of integers, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single integer. + * * @name Phaser.Tilemaps.StaticTilemapLayer#vertexCount - * @type {integer} + * @type {integer[]} * @private * @since 3.0.0 */ - this.vertexCount = 0; + this.vertexCount = []; /** * The rendering (draw) order of the tiles in this layer. @@ -48202,61 +48307,109 @@ var StaticTilemapLayer = new Class({ */ this._renderOrder = 0; + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#_tempMatrix + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.14.0 + */ + this._tempMatrix = new TransformMatrix(); + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#gidMap + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.14.0 + */ + this.gidMap = []; + + this.setTilesets(tileset); this.setAlpha(this.layer.alpha); this.setPosition(x, y); this.setOrigin(); this.setSize(this.layer.tileWidth * this.layer.width, this.layer.tileHeight * this.layer.height); + this.updateVBOData(); + this.initPipeline('TextureTintPipeline'); if (scene.sys.game.config.renderType === CONST.WEBGL) { scene.sys.game.renderer.onContextRestored(function () { - this.dirty = true; - this.vertexBuffer = null; + this.updateVBOData(); }, this); } }, /** - * Sets the rendering (draw) order of the tiles in this layer. - * - * The default is 'right-down', meaning it will order the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * Setting the render order does not change the tiles or how they are stored in the layer, - * it purely impacts the order in which they are rendered. - * - * You can provide either an integer (0 to 3), or the string version of the order. + * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. * - * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder - * @since 3.12.0 + * @method Phaser.Tilemaps.StaticTilemapLayer#setTilesets + * @private + * @since 3.14.0 + * + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + */ + setTilesets: function (tilesets) + { + var gidMap = []; + var setList = []; + var map = this.tilemap; + + if (!Array.isArray(tilesets)) + { + tilesets = [ tilesets ]; + } + + for (var i = 0; i < tilesets.length; i++) + { + var tileset = tilesets[i]; + + if (typeof tileset === 'string') + { + tileset = map.getTileset(tileset); + } + + if (tileset) + { + setList.push(tileset); + + var s = tileset.firstgid; + + for (var t = 0; t < tileset.total; t++) + { + gidMap[s + t] = tileset; + } + } + } + + this.gidMap = gidMap; + this.tileset = setList; + }, + + /** + * Prepares the VBO data arrays for population by the `upload` method. * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * @method Phaser.Tilemaps.StaticTilemapLayer#updateVBOData + * @private + * @since 3.14.0 * * @return {this} This Tilemap Layer object. */ - setRenderOrder: function (renderOrder) + updateVBOData: function () { - var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; - - if (typeof renderOrder === 'string') + for (var i = 0; i < this.tileset.length; i++) { - renderOrder = orders.indexOf(renderOrder); - } - - if (renderOrder >= 0 && renderOrder < 4) - { - this._renderOrder = renderOrder; - this.dirty = true; + this.dirty[i] = true; + this.vertexCount[i] = 0; + this.vertexBuffer[i] = null; + this.bufferData[i] = null; + this.vertexViewF32[i] = null; + this.vertexViewU32[i] = null; } return this; @@ -48269,19 +48422,20 @@ var StaticTilemapLayer = new Class({ * @since 3.0.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to render to. + * @param {integer} tilesetIndex - The tileset index. * * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. */ - upload: function (camera) + upload: function (camera, tilesetIndex) { var renderer = this.renderer; var gl = renderer.gl; var pipeline = renderer.pipelines.TextureTintPipeline; - if (this.dirty) + if (this.dirty[tilesetIndex]) { - var tileset = this.tileset; + var tileset = this.tileset[tilesetIndex]; var mapWidth = this.layer.width; var mapHeight = this.layer.height; var width = tileset.image.source[0].width; @@ -48291,22 +48445,24 @@ var StaticTilemapLayer = new Class({ var row; var col; var renderOrder = this._renderOrder; + var minTileIndex = tileset.firstgid; + var maxTileIndex = tileset.firstgid + tileset.total; - var vertexBuffer = this.vertexBuffer; - var bufferData = this.bufferData; + var vertexBuffer = this.vertexBuffer[tilesetIndex]; + var bufferData = this.bufferData[tilesetIndex]; var vOffset = -1; var bufferSize = (mapWidth * mapHeight) * pipeline.vertexSize * 6; - this.vertexCount = 0; + this.vertexCount[tilesetIndex] = 0; if (bufferData === null) { bufferData = new ArrayBuffer(bufferSize); - this.bufferData = bufferData; + this.bufferData[tilesetIndex] = bufferData; - this.vertexViewF32 = new Float32Array(bufferData); - this.vertexViewU32 = new Uint32Array(bufferData); + this.vertexViewF32[tilesetIndex] = new Float32Array(bufferData); + this.vertexViewU32[tilesetIndex] = new Uint32Array(bufferData); } if (renderOrder === 0) @@ -48319,12 +48475,12 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } @@ -48338,12 +48494,12 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } @@ -48357,12 +48513,12 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } @@ -48376,23 +48532,23 @@ var StaticTilemapLayer = new Class({ { tile = mapData[row][col]; - if (!tile || tile.index === -1 || !tile.visible) + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) { continue; } - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera); + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); } } } - this.dirty = false; + this.dirty[tilesetIndex] = false; if (vertexBuffer === null) { vertexBuffer = renderer.createVertexBuffer(bufferData, gl.STATIC_DRAW); - this.vertexBuffer = vertexBuffer; + this.vertexBuffer[tilesetIndex] = vertexBuffer; } else { @@ -48402,11 +48558,6 @@ var StaticTilemapLayer = new Class({ } } - pipeline.modelIdentity(); - pipeline.modelTranslate(this.x - (camera.scrollX * this.scrollFactorX), this.y - (camera.scrollY * this.scrollFactorY), 0); - pipeline.modelScale(this.scaleX, this.scaleY, 1); - pipeline.viewLoad2D(camera.matrix.matrix); - return this; }, @@ -48423,21 +48574,17 @@ var StaticTilemapLayer = new Class({ * @param {integer} width - The width of the layer. * @param {integer} height - The height of the layer. * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the layer is being rendered with. + * @param {integer} tilesetIndex - The tileset index. * * @return {integer} The new vOffset value. */ - batchTile: function (vOffset, tile, tileset, width, height, camera) + batchTile: function (vOffset, tile, tileset, width, height, camera, tilesetIndex) { - var tx = tile.pixelX; - var ty = tile.pixelY; - var txw = tx + tile.width; - var tyh = ty + tile.height; - var texCoords = tileset.getTileTextureCoordinates(tile.index); if (!texCoords) { - return; + return vOffset; } var u0 = texCoords.x / width; @@ -48445,16 +48592,47 @@ var StaticTilemapLayer = new Class({ var u1 = (texCoords.x + tile.width) / width; var v1 = (texCoords.y + tile.height) / height; + var matrix = this._tempMatrix; + + var tileWidth = tile.width; + var tileHeight = tile.height; + + var halfTileWidth = tileWidth / 2; + var halfTileHeight = tileHeight / 2; + + var x = -halfTileWidth; + var y = -halfTileHeight; + + if (tile.flipX) + { + tileWidth *= -1; + x += tile.width; + } + + if (tile.flipY) + { + tileHeight *= -1; + y += tile.height; + } + + var xw = x + tileWidth; + var yh = y + tileHeight; + + matrix.applyITRS(halfTileWidth + tile.pixelX, halfTileHeight + tile.pixelY, tile.rotation, 1, 1); + var tint = Utils.getTintAppendFloatAlpha(0xffffff, camera.alpha * this.alpha * tile.alpha); - var tx0 = tx; - var ty0 = ty; - var tx1 = tx; - var ty1 = tyh; - var tx2 = txw; - var ty2 = tyh; - var tx3 = txw; - var ty3 = ty; + var tx0 = matrix.getX(x, y); + var ty0 = matrix.getY(x, y); + + var tx1 = matrix.getX(x, yh); + var ty1 = matrix.getY(x, yh); + + var tx2 = matrix.getX(xw, yh); + var ty2 = matrix.getY(xw, yh); + + var tx3 = matrix.getX(xw, y); + var ty3 = matrix.getY(xw, y); if (camera.roundPixels) { @@ -48471,8 +48649,8 @@ var StaticTilemapLayer = new Class({ ty3 |= 0; } - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; + var vertexViewF32 = this.vertexViewF32[tilesetIndex]; + var vertexViewU32 = this.vertexViewU32[tilesetIndex]; vertexViewF32[++vOffset] = tx0; vertexViewF32[++vOffset] = ty0; @@ -48516,11 +48694,58 @@ var StaticTilemapLayer = new Class({ vertexViewF32[++vOffset] = 0; vertexViewU32[++vOffset] = tint; - this.vertexCount += 6; + this.vertexCount[tilesetIndex] += 6; return vOffset; }, + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder + * @since 3.12.0 + * + * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * + * @return {this} This Tilemap Layer object. + */ + setRenderOrder: function (renderOrder) + { + var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; + + if (typeof renderOrder === 'string') + { + renderOrder = orders.indexOf(renderOrder); + } + + if (renderOrder >= 0 && renderOrder < 4) + { + this._renderOrder = renderOrder; + + for (var i = 0; i < this.tileset.length; i++) + { + this.dirty[i] = true; + } + } + + return this; + }, + /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting * faces are used internally for optimizing collisions against tiles. This method is mostly used @@ -49244,10 +49469,22 @@ var StaticTilemapLayer = new Class({ this.tilemap = undefined; this.layer = undefined; - this.tileset = undefined; this.culledTiles.length = 0; this.cullCallback = null; + for (var i = 0; i < this.tileset.length; i++) + { + this.dirty[i] = true; + this.vertexCount[i] = 0; + this.vertexBuffer[i] = null; + this.bufferData[i] = null; + this.vertexViewF32[i] = null; + this.vertexViewU32[i] = null; + } + + this.gidMap = []; + this.tileset = []; + GameObject.prototype.destroy.call(this); } @@ -49274,13 +49511,14 @@ var TilemapComponents = __webpack_require__(103); /** * @classdesc - * A DynamicTilemapLayer is a game object that renders LayerData from a Tilemap. A - * DynamicTilemapLayer can only render tiles from a single tileset. + * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. * - * A DynamicTilemapLayer trades some speed for being able to apply powerful effects. Unlike a - * StaticTilemapLayer, you can apply per-tile effects like tint or alpha, and you can change the - * tiles in a DynamicTilemapLayer. Use this over a StaticTilemapLayer when you need those - * features. + * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a + * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the + * tiles in a DynamicTilemapLayer. + * + * Use this over a Static Tilemap Layer when you need those features. * * @class DynamicTilemapLayer * @extends Phaser.GameObjects.GameObject @@ -49301,10 +49539,10 @@ var TilemapComponents = __webpack_require__(103); * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. * @param {integer} layerIndex - The index of the LayerData associated with this layer. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset used to render the tiles in this layer. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. */ @@ -49372,16 +49610,19 @@ var DynamicTilemapLayer = new Class({ */ this.layer = tilemap.layers[layerIndex]; - this.layer.tilemapLayer = this; // Link the LayerData with this static tilemap layer + // Link the LayerData with this static tilemap layer + this.layer.tilemapLayer = this; /** - * The Tileset associated with this layer. A tilemap layer can only render from one Tileset. + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. * * @name Phaser.Tilemaps.DynamicTilemapLayer#tileset - * @type {Phaser.Tilemaps.Tileset} + * @type {Phaser.Tilemaps.Tileset[]} * @since 3.0.0 */ - this.tileset = tileset; + this.tileset = []; /** * Used internally with the canvas render. This holds the tiles that are visible within the @@ -49492,6 +49733,16 @@ var DynamicTilemapLayer = new Class({ */ this._renderOrder = 0; + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#gidMap + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.14.0 + */ + this.gidMap = []; + + this.setTilesets(tileset); this.setAlpha(this.layer.alpha); this.setPosition(x, y); this.setOrigin(); @@ -49500,6 +49751,52 @@ var DynamicTilemapLayer = new Class({ this.initPipeline('TextureTintPipeline'); }, + /** + * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setTilesets + * @private + * @since 3.14.0 + * + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + */ + setTilesets: function (tilesets) + { + var gidMap = []; + var setList = []; + var map = this.tilemap; + + if (!Array.isArray(tilesets)) + { + tilesets = [ tilesets ]; + } + + for (var i = 0; i < tilesets.length; i++) + { + var tileset = tilesets[i]; + + if (typeof tileset === 'string') + { + tileset = map.getTileset(tileset); + } + + if (tileset) + { + setList.push(tileset); + + var s = tileset.firstgid; + + for (var t = 0; t < tileset.total; t++) + { + gidMap[s + t] = tileset; + } + } + } + + this.gidMap = gidMap; + this.tileset = setList; + }, + /** * Sets the rendering (draw) order of the tiles in this layer. * @@ -49570,10 +49867,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -49633,13 +49930,13 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#copy * @since 3.0.0 * - * @param {integer} srcTileX - [description] - * @param {integer} srcTileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] - * @param {integer} destTileX - [description] - * @param {integer} destTileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -49666,10 +49963,12 @@ var DynamicTilemapLayer = new Class({ this.tilemap = undefined; this.layer = undefined; - this.tileset = undefined; this.culledTiles.length = 0; this.cullCallback = null; + this.gidMap = []; + this.tileset = []; + GameObject.prototype.destroy.call(this); }, @@ -49681,12 +49980,12 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#fill * @since 3.0.0 * - * @param {integer} index - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} index - The tile index to fill the area with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -49709,17 +50008,14 @@ var DynamicTilemapLayer = new Class({ * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -49758,20 +50054,16 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#findTile * @since 3.0.0 * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {?Phaser.Tilemaps.Tile} */ @@ -49787,20 +50079,16 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#forEachTile * @since 3.0.0 * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -49819,8 +50107,7 @@ var DynamicTilemapLayer = new Class({ * * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ @@ -49837,9 +50124,8 @@ var DynamicTilemapLayer = new Class({ * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates * were invalid. @@ -49855,17 +50141,14 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -49883,13 +50166,10 @@ var DynamicTilemapLayer = new Class({ * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -49904,18 +50184,15 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -49931,10 +50208,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. * - * @return {boolean} + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ hasTileAt: function (tileX, tileY) { @@ -49948,11 +50225,11 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * - * @return {boolean} + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ hasTileAtWorldXY: function (worldX, worldY, camera) { @@ -49969,9 +50246,9 @@ var DynamicTilemapLayer = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -49990,10 +50267,10 @@ var DynamicTilemapLayer = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} worldX - [description] - * @param {integer} worldY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -50012,11 +50289,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#putTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles - * or tile indexes to place. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -50037,10 +50313,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. @@ -50059,11 +50335,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -50079,12 +50354,11 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Tilemaps.Tile} A Tile object. */ @@ -50128,12 +50402,12 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#replaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - [description] - * @param {integer} newIndex - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -50345,10 +50619,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileLocationCallback * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} [callbackContext] - The context under which the callback is called. * @@ -50370,10 +50644,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -50394,10 +50668,10 @@ var DynamicTilemapLayer = new Class({ * * @param {integer} tileA - First tile index. * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. */ @@ -50415,8 +50689,8 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldX * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -50432,8 +50706,8 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldY * @since 3.0.0 * - * @param {integer} tileY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -50450,10 +50724,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Math.Vector2} */ @@ -50480,10 +50754,10 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#weightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. @@ -50504,10 +50778,9 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileX * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -50523,10 +50796,9 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileY * @since 3.0.0 * - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {number} */ @@ -50543,12 +50815,11 @@ var DynamicTilemapLayer = new Class({ * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * * @return {Phaser.Math.Vector2} */ @@ -50577,7 +50848,7 @@ var DegToRad = __webpack_require__(31); var DynamicTilemapLayer = __webpack_require__(209); var Extend = __webpack_require__(20); var Formats = __webpack_require__(29); -var LayerData = __webpack_require__(77); +var LayerData = __webpack_require__(78); var Rotate = __webpack_require__(243); var StaticTilemapLayer = __webpack_require__(208); var Tile = __webpack_require__(55); @@ -50587,21 +50858,21 @@ var Tileset = __webpack_require__(99); /** * @callback TilemapFilterCallback * - * @param {Phaser.GameObjects.GameObject} value - [description] - * @param {number} index - [description] - * @param {Phaser.GameObjects.GameObject[]} array - [description] + * @param {Phaser.GameObjects.GameObject} value - An object found in the filtered area. + * @param {number} index - The index of the object within the array. + * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. * - * @return {Phaser.GameObjects.GameObject} [description] + * @return {Phaser.GameObjects.GameObject} The object. */ /** * @callback TilemapFindCallback * - * @param {Phaser.GameObjects.GameObject} value - [description] - * @param {number} index - [description] - * @param {Phaser.GameObjects.GameObject[]} array - [description] + * @param {Phaser.GameObjects.GameObject} value - An object found. + * @param {number} index - The index of the object within the array. + * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. * - * @return {boolean} [description] + * @return {boolean} `true` if the callback should be invoked, otherwise `false`. */ /** @@ -50887,7 +51158,7 @@ var Tilemap = new Class({ if (!this.scene.sys.textures.exists(key)) { - console.warn('Invalid image key given for tileset: "' + key + '"'); + console.warn('Invalid Tileset Image: ' + key); return null; } @@ -50897,16 +51168,19 @@ var Tilemap = new Class({ if (index === null && this.format === Formats.TILED_JSON) { - console.warn('No data found in the JSON tilemap from Tiled matching the tileset name: "' + tilesetName + '"'); + console.warn('No data found for Tileset: ' + tilesetName); return null; } - if (this.tilesets[index]) + var tileset = this.tilesets[index]; + + if (tileset) { - this.tilesets[index].setTileSize(tileWidth, tileHeight); - this.tilesets[index].setSpacing(tileMargin, tileSpacing); - this.tilesets[index].setImage(texture); - return this.tilesets[index]; + tileset.setTileSize(tileWidth, tileHeight); + tileset.setSpacing(tileMargin, tileSpacing); + tileset.setImage(texture); + + return tileset; } if (tileWidth === undefined) { tileWidth = this.tileWidth; } @@ -50915,8 +51189,10 @@ var Tilemap = new Class({ if (tileSpacing === undefined) { tileSpacing = 0; } if (gid === undefined) { gid = 0; } - var tileset = new Tileset(tilesetName, gid, tileWidth, tileHeight, tileMargin, tileSpacing); + tileset = new Tileset(tilesetName, gid, tileWidth, tileHeight, tileMargin, tileSpacing); + tileset.setImage(texture); + this.tilesets.push(tileset); return tileset; @@ -50968,11 +51244,23 @@ var Tilemap = new Class({ }, /** - * See component documentation. If no layer specified, the map's current layer is used. This - * cannot be applied to StaticTilemapLayers. + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * + * If no layer specified, the map's current layer is used. This cannot be applied to StaticTilemapLayers. * * @method Phaser.Tilemaps.Tilemap#copy * @since 3.0.0 + * + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -50996,24 +51284,20 @@ var Tilemap = new Class({ }, /** - * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set - * to this new layer. + * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. * * @method Phaser.Tilemaps.Tilemap#createBlankDynamicLayer * @since 3.0.0 * * @param {string} name - The name of this layer. Must be unique within the map. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. - * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default - * to the map's width. - * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default - * to the map's height. - * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not - * specified, it will default to the map's tileWidth. - * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not - * specified, it will default to the map's tileHeight. + * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. + * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. + * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. + * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. + * * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. */ createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) @@ -51029,7 +51313,7 @@ var Tilemap = new Class({ if (index !== null) { - console.warn('Cannot create blank layer: layer with matching name already exists ' + name); + console.warn('Invalid Tilemap Layer ID: ' + name); return null; } @@ -51056,6 +51340,7 @@ var Tilemap = new Class({ } this.layers.push(layerData); + this.currentLayerIndex = this.layers.length - 1; var dynamicLayer = new DynamicTilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); @@ -51081,13 +51366,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createDynamicLayer * @since 3.0.0 * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the - * layer name from Tiled. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. - * @param {number} x - The x position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. - * @param {number} y - The y position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} x - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * @param {number} y - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. */ @@ -51097,7 +51379,7 @@ var Tilemap = new Class({ if (index === null) { - console.warn('Cannot create Tilemap Layer, invalid ID: ' + layerID); + console.warn('Invalid Tilemap Layer ID: ' + layerID); return null; } @@ -51106,21 +51388,13 @@ var Tilemap = new Class({ // Check for an associated static or dynamic tilemap layer if (layerData.tilemapLayer) { - console.warn('Cannot create Tilemap Layer. ID: ' + layerID + ' already in use'); + console.warn('Tilemap Layer ID already exists:' + layerID); return null; } this.currentLayerIndex = index; - // Make sure that all the LayerData & the tiles have the correct tile size. They usually - // are, but wouldn't match if you try to load a 2x or 4x res tileset when the map was made - // with a 1x res tileset. - if (layerData.tileWidth !== tileset.tileWidth || layerData.tileHeight !== tileset.tileHeight) - { - this.setLayerTileSize(tileset.tileWidth, tileset.tileHeight, index); - } - - // Default the x/y position to match Tiled layer offset, if it exists. + // Default the x/y position to match Tiled layer offset, if it exists. if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } @@ -51250,11 +51524,10 @@ var Tilemap = new Class({ * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. - * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). + * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.GameObjects.Sprite[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -51281,13 +51554,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createStaticLayer * @since 3.0.0 * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the - * layer name from Tiled. - * @param {Phaser.Tilemaps.Tileset} tileset - The tileset the new layer will use. - * @param {number} x - The x position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. - * @param {number} y - The y position to place the layer in the world. If not specified, it will - * default to the layer offset from Tiled or 0. + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} x - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * @param {number} y - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer was created, or null if it failed. */ @@ -51297,30 +51567,22 @@ var Tilemap = new Class({ if (index === null) { - console.warn('Cannot create tilemap layer, invalid layer ID given: ' + layerID); + console.warn('Invalid Tilemap Layer ID: ' + layerID); return null; } var layerData = this.layers[index]; - // Check for an associated static or dynamic tilemap layer + // Check for an associated static or dynamic tilemap layer if (layerData.tilemapLayer) { - console.warn('Cannot create static tilemap layer since a static or dynamic tilemap layer exists for layer ID:' + layerID); + console.warn('Tilemap Layer ID already exists:' + layerID); return null; } this.currentLayerIndex = index; - // Make sure that all the LayerData & the tiles have the correct tile size. They usually - // are, but wouldn't match if you try to load a 2x or 4x res tileset when the map was made - // with a 1x res tileset. - if (layerData.tileWidth !== tileset.tileWidth || layerData.tileHeight !== tileset.tileHeight) - { - this.setLayerTileSize(tileset.tileWidth, tileset.tileHeight, index); - } - - // Default the x/y position to match Tiled layer offset, if it exists. + // Default the x/y position to match Tiled layer offset, if it exists. if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } @@ -51359,13 +51621,13 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#fill * @since 3.0.0 * - * @param {integer} index - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} index - The tile index to fill the area with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -51428,18 +51690,15 @@ var Tilemap = new Class({ * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to apply the filter on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -51465,9 +51724,8 @@ var Tilemap = new Class({ * * @param {integer} index - The tile index value to search for. * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -51521,21 +51779,17 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#findTile * @since 3.0.0 * - * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -51557,21 +51811,17 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#forEachTile * @since 3.0.0 * - * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -51727,9 +51977,8 @@ var Tilemap = new Class({ * * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -51751,10 +52000,9 @@ var Tilemap = new Class({ * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -51779,18 +52027,15 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getTilesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -51813,14 +52058,11 @@ var Tilemap = new Class({ * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -51840,19 +52082,16 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getTilesWithinWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -51865,6 +52104,23 @@ var Tilemap = new Class({ return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, layer); }, + /** + * Gets the Tileset that has the given `name`, or null if an invalid `name` is given. + * + * @method Phaser.Tilemaps.Tilemap#getTileset + * @since 3.14.0 + * + * @param {string} name - The name of the Tileset to get. + * + * @return {?Phaser.Tilemaps.Tileset} The Tileset, or `null` if no matching named tileset was found. + */ + getTileset: function (name) + { + var index = this.getIndex(this.tilesets, name); + + return (index !== null) ? this.tilesets[index] : null; + }, + /** * Gets the index of the Tileset within this.tilesets that has the given `name`, or null if an * invalid `name` is given. @@ -51890,9 +52146,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#hasTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -51914,10 +52170,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#hasTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -51964,12 +52220,12 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * - * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. + * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid or the coordinates were out of bounds. */ putTileAt: function (tile, tileX, tileY, recalculateFaces, layer) { @@ -51995,11 +52251,11 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} worldX - [description] - * @param {integer} worldY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -52027,12 +52283,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#putTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles - * or tile indexes to place. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -52063,12 +52318,12 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -52096,9 +52351,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#calculateFacesAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -52123,11 +52378,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#calculateFacesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -52178,12 +52433,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#removeTileAt * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -52208,13 +52462,12 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -52242,13 +52495,10 @@ var Tilemap = new Class({ * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. * @param {object} styleConfig - An object specifying the colors to use for the debug drawing. - * @param {?Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at - * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. - * @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled - * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. - * @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting - * tile faces. If set to null, interesting tile faces will not be drawn. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {?Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. + * @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. + * @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52274,13 +52524,13 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#replaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - [description] - * @param {integer} newIndex - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52309,11 +52559,9 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52341,11 +52589,9 @@ var Tilemap = new Class({ * * @param {integer} start - The first index of the tile to be set for collision. * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52374,13 +52620,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setCollisionByProperty * @since 3.0.0 * - * @param {object} properties - An object with tile properties and corresponding values that should - * be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52406,11 +52649,9 @@ var Tilemap = new Class({ * @since 3.0.0 * * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52436,11 +52677,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setCollisionFromCollisionGroup * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52466,11 +52705,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setTileIndexCallback * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a - * collision callback set for. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52495,13 +52733,13 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setTileLocationCallback * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} [callbackContext] - The context under which the callback is called. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52562,8 +52800,8 @@ var Tilemap = new Class({ // Update the base tile size on all layers & tiles for (var i = 0; i < this.layers.length; i++) { - this.layers[i].baseWidth = tileWidth; - this.layers[i].baseHeight = tileHeight; + this.layers[i].baseTileWidth = tileWidth; + this.layers[i].baseTileHeight = tileHeight; var mapData = this.layers[i].data; var mapWidth = this.layers[i].width; @@ -52640,11 +52878,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52675,11 +52913,11 @@ var Tilemap = new Class({ * * @param {integer} tileA - First tile index. * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52706,9 +52944,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#tileToWorldX * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -52730,9 +52968,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#tileToWorldY * @since 3.0.0 * - * @param {integer} tileY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -52755,11 +52993,11 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#tileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. */ @@ -52793,14 +53031,14 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#weightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -52827,11 +53065,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#worldToTileX * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -52853,11 +53090,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#worldToTileY * @since 3.0.0 * - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -52880,13 +53116,12 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#worldToTileXY * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] - * @param {Phaser.Tilemaps.LayerData} [layer] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. */ @@ -52937,7 +53172,7 @@ module.exports = Tilemap; */ var Formats = __webpack_require__(29); -var MapData = __webpack_require__(76); +var MapData = __webpack_require__(77); var ParseTileLayers = __webpack_require__(451); var ParseTilesets = __webpack_require__(450); @@ -53458,7 +53693,7 @@ module.exports = ParseGID; */ var Formats = __webpack_require__(29); -var MapData = __webpack_require__(76); +var MapData = __webpack_require__(77); var ParseTileLayers = __webpack_require__(459); var ParseImageLayers = __webpack_require__(457); var ParseTilesets = __webpack_require__(456); @@ -53485,7 +53720,7 @@ var AssignTileProperties = __webpack_require__(452); * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. * - * @return {?Phaser.Tilemaps.MapData} [description] + * @return {?Phaser.Tilemaps.MapData} The created MapData object, or `null` if the data can't be parsed. */ var ParseJSONTiled = function (name, json, insertNull) { @@ -53558,7 +53793,7 @@ var Parse2DArray = __webpack_require__(132); * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. * - * @return {Phaser.Tilemaps.MapData} [description] + * @return {Phaser.Tilemaps.MapData} The resulting MapData object. */ var ParseCSV = function (name, data, tileWidth, tileHeight, insertNull) { @@ -53615,7 +53850,7 @@ var ParseWeltmeister = __webpack_require__(211); * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. * - * @return {Phaser.Tilemaps.MapData} [description] + * @return {Phaser.Tilemaps.MapData} The created `MapData` object. */ var Parse = function (name, mapFormat, data, tileWidth, tileHeight, insertNull) { @@ -53657,7 +53892,7 @@ module.exports = Parse; */ var Tile = __webpack_require__(55); -var IsInLayerBounds = __webpack_require__(78); +var IsInLayerBounds = __webpack_require__(79); var CalculateFacesAt = __webpack_require__(135); /** @@ -53670,9 +53905,8 @@ var CalculateFacesAt = __webpack_require__(135); * * @param {integer} tileX - The x coordinate. * @param {integer} tileY - The y coordinate. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. @@ -53717,7 +53951,7 @@ module.exports = RemoveTileAt; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var IsInLayerBounds = __webpack_require__(78); +var IsInLayerBounds = __webpack_require__(79); /** * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns @@ -53727,11 +53961,11 @@ var IsInLayerBounds = __webpack_require__(78); * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] + * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {boolean} + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ var HasTileAt = function (tileX, tileY, layer) { @@ -53771,17 +54005,18 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {integer} findIndex - [description] - * @param {integer} newIndex - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ReplaceByIndex = function (findIndex, newIndex, tileX, tileY, width, height, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + for (var i = 0; i < tiles.length; i++) { if (tiles[i] && tiles[i].index === findIndex) @@ -54243,15 +54478,22 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CircleContains = __webpack_require__(39); +var CircleContains = __webpack_require__(40); var Class = __webpack_require__(0); var CONST = __webpack_require__(35); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); var Vector2 = __webpack_require__(3); /** * @classdesc - * [description] + * A Static Arcade Physics Body. + * + * A Static Body never moves, and isn't automatically synchronized with its parent Game Object. + * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Body manually. + * + * A Static Body can collide with other Bodies, but is never moved by collisions. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Body}. * * @class StaticBody * @memberOf Phaser.Physics.Arcade @@ -54404,6 +54646,7 @@ var StaticBody = new Class({ * * @name Phaser.Physics.Arcade.StaticBody#velocity * @type {Phaser.Math.Vector2} + * @readOnly * @since 3.0.0 */ this.velocity = Vector2.ZERO; @@ -54413,25 +54656,28 @@ var StaticBody = new Class({ * * @name Phaser.Physics.Arcade.StaticBody#allowGravity * @type {boolean} + * @readOnly * @default false * @since 3.0.0 */ this.allowGravity = false; /** - * [description] + * Gravitational force applied specifically to this Body. Values are in pixels per second squared. Always zero for a Static Body. * * @name Phaser.Physics.Arcade.StaticBody#gravity * @type {Phaser.Math.Vector2} + * @readOnly * @since 3.0.0 */ this.gravity = Vector2.ZERO; /** - * [description] + * Rebound, or restitution, following a collision, relative to 1. Always zero for a Static Body. * * @name Phaser.Physics.Arcade.StaticBody#bounce * @type {Phaser.Math.Vector2} + * @readOnly * @since 3.0.0 */ this.bounce = Vector2.ZERO; @@ -54439,7 +54685,7 @@ var StaticBody = new Class({ // If true this Body will dispatch events /** - * [description] + * Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary (and `collideWorldBounds` is also true). * * @name Phaser.Physics.Arcade.StaticBody#onWorldBounds * @type {boolean} @@ -54449,7 +54695,7 @@ var StaticBody = new Class({ this.onWorldBounds = false; /** - * [description] + * Whether the simulation emits a `collide` event when this StaticBody collides with another. * * @name Phaser.Physics.Arcade.StaticBody#onCollide * @type {boolean} @@ -54459,7 +54705,7 @@ var StaticBody = new Class({ this.onCollide = false; /** - * [description] + * Whether the simulation emits an `overlap` event when this StaticBody overlaps with another. * * @name Phaser.Physics.Arcade.StaticBody#onOverlap * @type {boolean} @@ -54469,7 +54715,7 @@ var StaticBody = new Class({ this.onOverlap = false; /** - * [description] + * The StaticBody's inertia, relative to a default unit (1). With `bounce`, this affects the exchange of momentum (velocities) during collisions. * * @name Phaser.Physics.Arcade.StaticBody#mass * @type {number} @@ -54479,7 +54725,7 @@ var StaticBody = new Class({ this.mass = 1; /** - * [description] + * Whether this object can be moved by collisions with another body. * * @name Phaser.Physics.Arcade.StaticBody#immovable * @type {boolean} @@ -54489,7 +54735,7 @@ var StaticBody = new Class({ this.immovable = true; /** - * [description] + * A flag disabling the default horizontal separation of colliding bodies. Pass your own `processHandler` to the collider. * * @name Phaser.Physics.Arcade.StaticBody#customSeparateX * @type {boolean} @@ -54499,7 +54745,7 @@ var StaticBody = new Class({ this.customSeparateX = false; /** - * [description] + * A flag disabling the default vertical separation of colliding bodies. Pass your own `processHandler` to the collider. * * @name Phaser.Physics.Arcade.StaticBody#customSeparateY * @type {boolean} @@ -54509,7 +54755,7 @@ var StaticBody = new Class({ this.customSeparateY = false; /** - * [description] + * The amount of horizontal overlap (before separation), if this Body is colliding with another. * * @name Phaser.Physics.Arcade.StaticBody#overlapX * @type {number} @@ -54519,7 +54765,7 @@ var StaticBody = new Class({ this.overlapX = 0; /** - * [description] + * The amount of vertical overlap (before separation), if this Body is colliding with another. * * @name Phaser.Physics.Arcade.StaticBody#overlapY * @type {number} @@ -54529,7 +54775,7 @@ var StaticBody = new Class({ this.overlapY = 0; /** - * [description] + * The amount of overlap (before separation), if this StaticBody is circular and colliding with another circular body. * * @name Phaser.Physics.Arcade.StaticBody#overlapR * @type {number} @@ -54539,7 +54785,7 @@ var StaticBody = new Class({ this.overlapR = 0; /** - * [description] + * Whether this StaticBody is overlapped with another and both have zero velocity. * * @name Phaser.Physics.Arcade.StaticBody#embedded * @type {boolean} @@ -54549,7 +54795,7 @@ var StaticBody = new Class({ this.embedded = false; /** - * [description] + * Whether this StaticBody interacts with the world boundary. * * @name Phaser.Physics.Arcade.StaticBody#collideWorldBounds * @type {boolean} @@ -54559,7 +54805,7 @@ var StaticBody = new Class({ this.collideWorldBounds = false; /** - * [description] + * Whether this StaticBody is checked for collisions and for which directions. You can set `checkCollision.none = false` to disable collision checks. * * @name Phaser.Physics.Arcade.StaticBody#checkCollision * @type {ArcadeBodyCollision} @@ -54568,7 +54814,7 @@ var StaticBody = new Class({ this.checkCollision = { none: false, up: true, down: true, left: true, right: true }; /** - * [description] + * Whether this StaticBody is colliding with another and in which direction. * * @name Phaser.Physics.Arcade.StaticBody#touching * @type {ArcadeBodyCollision} @@ -54577,7 +54823,7 @@ var StaticBody = new Class({ this.touching = { none: true, up: false, down: false, left: false, right: false }; /** - * [description] + * Whether this StaticBody was colliding with another during the last step, and in which direction. * * @name Phaser.Physics.Arcade.StaticBody#wasTouching * @type {ArcadeBodyCollision} @@ -54586,7 +54832,7 @@ var StaticBody = new Class({ this.wasTouching = { none: true, up: false, down: false, left: false, right: false }; /** - * [description] + * Whether this StaticBody is colliding with a tile or the world boundary. * * @name Phaser.Physics.Arcade.StaticBody#blocked * @type {ArcadeBodyCollision} @@ -54595,7 +54841,7 @@ var StaticBody = new Class({ this.blocked = { none: true, up: false, down: false, left: false, right: false }; /** - * [description] + * The StaticBody's physics type (static by default). * * @name Phaser.Physics.Arcade.StaticBody#physicsType * @type {integer} @@ -54640,6 +54886,8 @@ var StaticBody = new Class({ * @param {boolean} [update=true] - Reposition and resize this Body to match the new Game Object? * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + * + * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject */ setGameObject: function (gameObject, update) { @@ -54693,13 +54941,13 @@ var StaticBody = new Class({ }, /** - * [description] + * Sets the offset of the body. * * @method Phaser.Physics.Arcade.StaticBody#setOffset * @since 3.4.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The horizontal offset of the Body from the Game Object's center. + * @param {number} y - The vertical offset of the Body from the Game Object's center. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. */ @@ -54776,14 +55024,14 @@ var StaticBody = new Class({ }, /** - * [description] + * Sets this Static Body to have a circular body and sets its sizes and position. * * @method Phaser.Physics.Arcade.StaticBody#setCircle * @since 3.0.0 * - * @param {number} radius - [description] - * @param {number} [offsetX] - [description] - * @param {number} [offsetY] - [description] + * @param {number} radius - The radius of the StaticBody, in pixels. + * @param {number} [offsetX] - The horizontal offset of the StaticBody from its Game Object, in pixels. + * @param {number} [offsetY] - The vertical offset of the StaticBody from its Game Object, in pixels. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. */ @@ -54821,7 +55069,7 @@ var StaticBody = new Class({ }, /** - * [description] + * Updates the StaticBody's `center` from its `position` and dimensions. * * @method Phaser.Physics.Arcade.StaticBody#updateCenter * @since 3.0.0 @@ -54832,13 +55080,14 @@ var StaticBody = new Class({ }, /** - * [description] + * Updates this Static Body's position based on the current Game Object it is bound to. + * Similar to `updateFromGameObject`, but doesn't modify the Body's dimensions. * * @method Phaser.Physics.Arcade.StaticBody#reset * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate to reset the body to. + * @param {number} y - The y coordinate to reset the body to. */ reset: function (x, y) { @@ -54857,7 +55106,7 @@ var StaticBody = new Class({ }, /** - * [description] + * NOOP function. A Static Body cannot be stopped. * * @method Phaser.Physics.Arcade.StaticBody#stop * @since 3.0.0 @@ -54870,14 +55119,14 @@ var StaticBody = new Class({ }, /** - * [description] + * Returns the x and y coordinates of the top left and bottom right points of the StaticBody. * * @method Phaser.Physics.Arcade.StaticBody#getBounds * @since 3.0.0 * - * @param {ArcadeBodyBounds} obj - [description] + * @param {ArcadeBodyBounds} obj - The object which will hold the coordinates of the bounds. * - * @return {ArcadeBodyBounds} [description] + * @return {ArcadeBodyBounds} The same object that was passed with `x`, `y`, `right` and `bottom` values matching the respective values of the StaticBody. */ getBounds: function (obj) { @@ -54890,15 +55139,15 @@ var StaticBody = new Class({ }, /** - * [description] + * Checks to see if a given x,y coordinate is colliding with this Static Body. * * @method Phaser.Physics.Arcade.StaticBody#hitTest * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The x coordinate to check against this body. + * @param {number} y - The y coordinate to check against this body. * - * @return {boolean} [description] + * @return {boolean} `true` if the given coordinate lies within this body, otherwise `false`. */ hitTest: function (x, y) { @@ -54916,12 +55165,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The absolute (non-negative) change in this StaticBody's horizontal position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaAbsX * @since 3.0.0 * - * @return {number} [description] + * @return {number} Always zero for a Static Body. */ deltaAbsX: function () { @@ -54929,12 +55178,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The absolute (non-negative) change in this StaticBody's vertical position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaAbsY * @since 3.0.0 * - * @return {number} [description] + * @return {number} Always zero for a Static Body. */ deltaAbsY: function () { @@ -54942,12 +55191,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The change in this StaticBody's horizontal position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaX * @since 3.0.0 * - * @return {number} [description] + * @return {number} Always zero for a Static Body. */ deltaX: function () { @@ -54955,12 +55204,12 @@ var StaticBody = new Class({ }, /** - * [description] + * The change in this StaticBody's vertical position from the previous step. Always zero. * * @method Phaser.Physics.Arcade.StaticBody#deltaY * @since 3.0.0 * - * @return {number} [description] + * @return {number} 0 */ deltaY: function () { @@ -54973,7 +55222,7 @@ var StaticBody = new Class({ * @method Phaser.Physics.Arcade.StaticBody#deltaZ * @since 3.0.0 * - * @return {number} [description] + * @return {number} 0 */ deltaZ: function () { @@ -54981,7 +55230,7 @@ var StaticBody = new Class({ }, /** - * [description] + * Disables this Body and marks it for destruction during the next step. * * @method Phaser.Physics.Arcade.StaticBody#destroy * @since 3.0.0 @@ -54994,12 +55243,12 @@ var StaticBody = new Class({ }, /** - * [description] + * Draws a graphical representation of the StaticBody for visual debugging purposes. * * @method Phaser.Physics.Arcade.StaticBody#drawDebug * @since 3.0.0 * - * @param {Phaser.GameObjects.Graphics} graphic - [description] + * @param {Phaser.GameObjects.Graphics} graphic - The Graphics object to use for the debug drawing of the StaticBody. */ drawDebug: function (graphic) { @@ -55013,12 +55262,12 @@ var StaticBody = new Class({ }, /** - * [description] + * Indicates whether the StaticBody is going to be showing a debug visualization during postUpdate. * * @method Phaser.Physics.Arcade.StaticBody#willDrawDebug * @since 3.0.0 * - * @return {boolean} [description] + * @return {boolean} Whether or not the StaticBody is going to show the debug visualization during postUpdate. */ willDrawDebug: function () { @@ -55026,12 +55275,12 @@ var StaticBody = new Class({ }, /** - * [description] + * Sets the Mass of the StaticBody. Will set the Mass to 0.1 if the value passed is less than or equal to zero. * * @method Phaser.Physics.Arcade.StaticBody#setMass * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - The value to set the Mass to. Values of zero or less are changed to 0.1. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. */ @@ -55049,7 +55298,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The x coordinate of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#x * @type {number} @@ -55074,7 +55323,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The y coordinate of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#y * @type {number} @@ -55099,7 +55348,7 @@ var StaticBody = new Class({ }, /** - * [description] + * Returns the left-most x coordinate of the area of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#left * @type {number} @@ -55116,7 +55365,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The right-most x coordinate of the area of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#right * @type {number} @@ -55133,7 +55382,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The highest y coordinate of the area of the StaticBody. * * @name Phaser.Physics.Arcade.StaticBody#top * @type {number} @@ -55150,7 +55399,7 @@ var StaticBody = new Class({ }, /** - * [description] + * The lowest y coordinate of the area of the StaticBody. (y + height) * * @name Phaser.Physics.Arcade.StaticBody#bottom * @type {number} @@ -56436,12 +56685,12 @@ module.exports = Collider; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CircleContains = __webpack_require__(39); +var CircleContains = __webpack_require__(40); var Class = __webpack_require__(0); var CONST = __webpack_require__(35); var RadToDeg = __webpack_require__(171); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); var Vector2 = __webpack_require__(3); /** @@ -56467,6 +56716,8 @@ var Vector2 = __webpack_require__(3); * @classdesc * A Dynamic Arcade Body. * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticBody}. + * * @class Body * @memberOf Phaser.Physics.Arcade * @constructor @@ -56568,8 +56819,8 @@ var Body = new Class({ this.isCircle = false; /** - * The unscaled radius of this Body's boundary (if circular), as set by setCircle, in source pixels. - * The true radius (if circular) is equal to halfWidth. + * If this Body is circular, this is the unscaled radius of the Body's boundary, as set by setCircle(), in source pixels. + * The true radius is equal to `halfWidth`. * * @name Phaser.Physics.Arcade.Body#radius * @type {number} @@ -56608,7 +56859,7 @@ var Body = new Class({ this.prev = new Vector2(gameObject.x, gameObject.y); /** - * Whether this Body's rotation is affected by its angular acceleration and velocity. + * Whether this Body's `rotation` is affected by its angular acceleration and angular velocity. * * @name Phaser.Physics.Arcade.Body#allowRotation * @type {boolean} @@ -56618,7 +56869,7 @@ var Body = new Class({ this.allowRotation = true; /** - * This body's rotation, in degrees, based on its angular acceleration and velocity. + * This body's rotation, in degrees, based on its angular acceleration and angular velocity. * The Body's rotation controls the `angle` of its Game Object. * It doesn't rotate the Body's boundary, which is always an axis-aligned rectangle or a circle. * @@ -56638,7 +56889,8 @@ var Body = new Class({ this.preRotation = gameObject.angle; /** - * The width of the Body's boundary. If circular, this is also the Body's diameter. + * The width of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. * * @name Phaser.Physics.Arcade.Body#width * @type {number} @@ -56648,7 +56900,8 @@ var Body = new Class({ this.width = width; /** - * The height of the Body's boundary. If circular, this is also the Body's diameter. + * The height of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. * * @name Phaser.Physics.Arcade.Body#height * @type {number} @@ -56658,7 +56911,8 @@ var Body = new Class({ this.height = height; /** - * The unscaled width of the Body, in source pixels. The default is the width of the Body's Game Object's texture frame. + * The unscaled width of the Body, in source pixels, as set by setSize(). + * The default is the width of the Body's Game Object's texture frame. * * @name Phaser.Physics.Arcade.Body#sourceWidth * @type {number} @@ -56668,7 +56922,8 @@ var Body = new Class({ this.sourceWidth = width; /** - * The unscaled height of the Body, in source pixels. The default is the height of the Body's Game Object's texture frame. + * The unscaled height of the Body, in source pixels, as set by setSize(). + * The default is the height of the Body's Game Object's texture frame. * * @name Phaser.Physics.Arcade.Body#sourceHeight * @type {number} @@ -56684,7 +56939,7 @@ var Body = new Class({ } /** - * Half the Body's width. + * Half the Body's width, in pixels. * * @name Phaser.Physics.Arcade.Body#halfWidth * @type {number} @@ -56693,7 +56948,7 @@ var Body = new Class({ this.halfWidth = Math.abs(width / 2); /** - * Half the Body's height. + * Half the Body's height, in pixels. * * @name Phaser.Physics.Arcade.Body#halfHeight * @type {number} @@ -56702,7 +56957,8 @@ var Body = new Class({ this.halfHeight = Math.abs(height / 2); /** - * The center of the Body's boundary. The midpoint of its `position` (top-left corner) and its bottom-right corner. + * The center of the Body's boundary. + * The midpoint of its `position` (top-left corner) and its bottom-right corner. * * @name Phaser.Physics.Arcade.Body#center * @type {Phaser.Math.Vector2} @@ -56711,7 +56967,7 @@ var Body = new Class({ this.center = new Vector2(gameObject.x + this.halfWidth, gameObject.y + this.halfHeight); /** - * The Body's change in position, in pixels per second. + * The Body's velocity, in pixels per second. * * @name Phaser.Physics.Arcade.Body#velocity * @type {Phaser.Math.Vector2} @@ -56720,7 +56976,7 @@ var Body = new Class({ this.velocity = new Vector2(); /** - * The Body's calculated change in position, in pixels, at the last step. + * The Body's calculated velocity, in pixels per second, at the last step. * * @name Phaser.Physics.Arcade.Body#newVelocity * @type {Phaser.Math.Vector2} @@ -56748,7 +57004,7 @@ var Body = new Class({ this.acceleration = new Vector2(); /** - * Whether this Body's velocity is affected by its drag vector. + * Whether this Body's velocity is affected by its `drag`. * * @name Phaser.Physics.Arcade.Body#allowDrag * @type {boolean} @@ -56759,20 +57015,30 @@ var Body = new Class({ /** * Absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. * * @name Phaser.Physics.Arcade.Body#drag - * @type {Phaser.Math.Vector2} + * @type {(Phaser.Math.Vector2|number)} * @since 3.0.0 */ this.drag = new Vector2(); /** - * Whether this Body's position is affected by its gravity vector. + * Whether this Body's position is affected by gravity (local or world). * * @name Phaser.Physics.Arcade.Body#allowGravity * @type {boolean} * @default true * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#gravity + * @see Phaser.Physics.Arcade.World#gravity */ this.allowGravity = true; @@ -56783,6 +57049,7 @@ var Body = new Class({ * @name Phaser.Physics.Arcade.Body#gravity * @type {Phaser.Math.Vector2} * @since 3.0.0 + * @see Phaser.Physics.Arcade.World#gravity */ this.gravity = new Vector2(); @@ -56797,7 +57064,7 @@ var Body = new Class({ /** * Rebound following a collision with the world boundary, relative to 1. - * If empty, `bounce` is used instead. + * If null, `bounce` is used instead. * * @name Phaser.Physics.Arcade.Body#worldBounce * @type {?Phaser.Math.Vector2} @@ -56842,9 +57109,8 @@ var Body = new Class({ this.onOverlap = false; /** - * The Body's absolute maximum velocity. - * - * This limits the Body's rate of movement but not its `velocity` values (which can still exceed `maxVelocity`). + * The Body's absolute maximum velocity, in pixels per second. + * The horizontal and vertical components are applied separately. * * @name Phaser.Physics.Arcade.Body#maxVelocity * @type {Phaser.Math.Vector2} @@ -56853,8 +57119,10 @@ var Body = new Class({ this.maxVelocity = new Vector2(10000, 10000); /** - * If this Body is `immovable` and in motion, this the proportion of this Body's movement received by the riding body on each axis, relative to 1. - * The default value (1, 0) moves the riding body horizontally in equal proportion and vertically not at all. + * If this Body is `immovable` and in motion, `friction` is the proportion of this Body's motion received by the riding Body on each axis, relative to 1. + * The default value (1, 0) moves the riding Body horizontally in equal proportion to this Body and vertically not at all. + * The horizontal component (x) is applied only when two colliding Bodies are separated vertically. + * The vertical component (y) is applied only when two colliding Bodies are separated horizontally. * * @name Phaser.Physics.Arcade.Body#friction * @type {Phaser.Math.Vector2} @@ -56881,7 +57149,7 @@ var Body = new Class({ this.useDamping = false; /** - * The rate of change of this Body's rotation, in degrees per second. + * The rate of change of this Body's `rotation`, in degrees per second. * * @name Phaser.Physics.Arcade.Body#angularVelocity * @type {number} @@ -56891,7 +57159,7 @@ var Body = new Class({ this.angularVelocity = 0; /** - * The rate of change of this Body's angular velocity, in degrees per second squared. + * The Body's angular acceleration (change in angular velocity), in degrees per second squared. * * @name Phaser.Physics.Arcade.Body#angularAcceleration * @type {number} @@ -56903,6 +57171,8 @@ var Body = new Class({ /** * Loss of angular velocity due to angular movement, in degrees per second. * + * Angular drag is applied only when angular acceleration is zero. + * * @name Phaser.Physics.Arcade.Body#angularDrag * @type {number} * @default 0 @@ -56932,7 +57202,7 @@ var Body = new Class({ this.mass = 1; /** - * The angle of this Body's velocity vector, in degrees. + * The calculated angle of this Body's velocity vector, in degrees, during the last step. * * @name Phaser.Physics.Arcade.Body#angle * @type {number} @@ -56942,7 +57212,7 @@ var Body = new Class({ this.angle = 0; /** - * The magnitude of the Body's velocity, as calculated during the last update. + * The calculated magnitude of the Body's velocity, in pixels per second, during the last step. * * @name Phaser.Physics.Arcade.Body#speed * @type {number} @@ -56952,7 +57222,8 @@ var Body = new Class({ this.speed = 0; /** - * The calculated direction of the Body's velocity. + * The direction of the Body's velocity, as calculated during the last step. + * If the Body is moving on both axes (diagonally), this describes motion on the vertical axis only. * * @name Phaser.Physics.Arcade.Body#facing * @type {integer} @@ -56961,7 +57232,7 @@ var Body = new Class({ this.facing = CONST.FACING_NONE; /** - * Whether this object can be moved by collisions with another body. + * Whether this Body can be moved by collisions with another Body. * * @name Phaser.Physics.Arcade.Body#immovable * @type {boolean} @@ -56981,7 +57252,8 @@ var Body = new Class({ this.moves = true; /** - * A flag disabling the default horizontal separation of colliding bodies. Pass your own `processHandler` to the collider. + * A flag disabling the default horizontal separation of colliding bodies. + * Pass your own `collideCallback` to the collider. * * @name Phaser.Physics.Arcade.Body#customSeparateX * @type {boolean} @@ -56991,7 +57263,8 @@ var Body = new Class({ this.customSeparateX = false; /** - * A flag disabling the default vertical separation of colliding bodies. Pass your own `processHandler` to the collider. + * A flag disabling the default vertical separation of colliding bodies. + * Pass your own `collideCallback` to the collider. * * @name Phaser.Physics.Arcade.Body#customSeparateY * @type {boolean} @@ -57162,7 +57435,7 @@ var Body = new Class({ this._sy = gameObject.scaleY; /** - * The calculated change in the Body's horizontal position during the current step. + * The calculated change in the Body's horizontal position during the last step. * * @name Phaser.Physics.Arcade.Body#_dx * @type {number} @@ -57173,7 +57446,7 @@ var Body = new Class({ this._dx = 0; /** - * The calculated change in the Body's vertical position during the current step. + * The calculated change in the Body's vertical position during the last step. * * @name Phaser.Physics.Arcade.Body#_dy * @type {number} @@ -57217,6 +57490,8 @@ var Body = new Class({ transform.rotation = RadToDeg(matrix.rotation); transform.scaleX = matrix.scaleX; transform.scaleY = matrix.scaleY; + transform.displayOriginX = sprite.displayOriginX; + transform.displayOriginY = sprite.displayOriginY; } else { @@ -57225,6 +57500,8 @@ var Body = new Class({ transform.rotation = sprite.angle; transform.scaleX = sprite.scaleX; transform.scaleY = sprite.scaleY; + transform.displayOriginX = sprite.displayOriginX; + transform.displayOriginY = sprite.displayOriginY; } var recalc = false; @@ -57261,7 +57538,7 @@ var Body = new Class({ }, /** - * Updates the Body's `center` from its `position` and dimensions. + * Updates the Body's `center` from its `position`, `width`, and `height`. * * @method Phaser.Physics.Arcade.Body#updateCenter * @since 3.0.0 @@ -57527,7 +57804,7 @@ var Body = new Class({ { height = gameObject.frame.realHeight; } - + this.sourceWidth = width; this.sourceHeight = height; @@ -57813,6 +58090,7 @@ var Body = new Class({ drawDebug: function (graphic) { var pos = this.position; + var x = pos.x + this.halfWidth; var y = pos.y + this.halfHeight; @@ -58488,7 +58766,7 @@ var Clamp = __webpack_require__(23); var Class = __webpack_require__(0); var Collider = __webpack_require__(232); var CONST = __webpack_require__(35); -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); var EventEmitter = __webpack_require__(11); var FuzzyEqual = __webpack_require__(249); var FuzzyGreaterThan = __webpack_require__(248); @@ -58506,9 +58784,9 @@ var SeparateY = __webpack_require__(507); var Set = __webpack_require__(95); var StaticBody = __webpack_require__(226); var TileIntersectsBody = __webpack_require__(227); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * @event Phaser.Physics.Arcade.World#pause @@ -58606,7 +58884,7 @@ var Wrap = __webpack_require__(52); /** * An Arcade Physics Collider Type. - * + * * @typedef {( * Phaser.GameObjects.GameObject| * Phaser.GameObjects.Group| @@ -58737,7 +59015,7 @@ var World = new Class({ /** * The number of physics steps to be taken per second. - * + * * This property is read-only. Use the `setFPS` method to modify it at run-time. * * @name Phaser.Physics.Arcade.World#fps @@ -58796,7 +59074,7 @@ var World = new Class({ * - 0.5 = double speed * * @name Phaser.Physics.Arcade.World#timeScale - * @property {number} + * @property {number} * @default 1 * @since 3.10.0 */ @@ -58896,7 +59174,7 @@ var World = new Class({ /** * The maximum number of items per node on the RTree. - * + * * This is ignored if `useTree` is `false`. If you have a large number of bodies in * your world then you may find search performance improves by increasing this value, * to allow more items per node and less node division. @@ -58910,7 +59188,7 @@ var World = new Class({ /** * Should this Arcade Physics World use an RTree for Dynamic Physics bodies or not? - * + * * An RTree is a fast way of spatially sorting of all the moving bodies in the world. * However, at certain limits, the cost of clearing and inserting the bodies into the * tree every frame becomes more expensive than the search speed gains it provides. @@ -58986,7 +59264,7 @@ var World = new Class({ /** * Adds an Arcade Physics Body to a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `enableBody` method is that you can pass arrays or Groups * to this method. * @@ -59112,7 +59390,7 @@ var World = new Class({ * @since 3.10.0 * * @param {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body - The Body to be added to the simulation. - * + * * @return {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} The Body that was added to the simulation. */ add: function (body) @@ -59135,10 +59413,10 @@ var World = new Class({ /** * Disables the Arcade Physics Body of a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `disableBody` method is that you can pass arrays or Groups * to this method. - * + * * The body itself is not deleted, it just has its `enable` property set to false, which * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`. * @@ -60227,11 +60505,11 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#overlap * @since 3.0.0 * - * @param {ArcadeColliderType} object1 - [description] - * @param {ArcadeColliderType} [object2] - [description] - * @param {ArcadePhysicsCallback} [overlapCallback] - [description] - * @param {ArcadePhysicsCallback} [processCallback] - [description] - * @param {*} [callbackContext] - [description] + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {*} [callbackContext] - The context in which to run the callbacks. * * @return {boolean} True if at least one Game Object overlaps another. */ @@ -60249,7 +60527,7 @@ var World = new Class({ * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. * * If you don't require separation then use {@link #overlap} instead. - * + * * If two Groups or arrays are passed, each member of one will be tested against each member of the other. * * If one Group **only** is passed (as `object1`), each member of the Group will be collided against the other members. @@ -60265,13 +60543,13 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#collide * @since 3.0.0 * - * @param {ArcadeColliderType} object1 - [description] - * @param {ArcadeColliderType} [object2] - [description] - * @param {ArcadePhysicsCallback} [collideCallback] - [description] - * @param {ArcadePhysicsCallback} [processCallback] - [description] - * @param {*} [callbackContext] - [description] + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {*} [callbackContext] - The context in which to run the callbacks. * - * @return {boolean} True if any overlapping Game Objects were separated. + * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -60293,9 +60571,9 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * - * @return {boolean} True if any overlapping objects were separated. + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ collideObjects: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly) { @@ -60363,9 +60641,9 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * - * @return {boolean} [description] + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. */ collideHandler: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly) { @@ -60441,7 +60719,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -60476,7 +60754,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -60569,7 +60847,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -60611,7 +60889,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -60713,7 +60991,7 @@ var World = new Class({ * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {*} callbackContext - [description] - * @param {boolean} overlapOnly - [description] + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} [description] */ @@ -60846,12 +61124,16 @@ module.exports = World; var ArcadeSprite = __webpack_require__(104); var Class = __webpack_require__(0); var CONST = __webpack_require__(35); -var Group = __webpack_require__(87); +var Group = __webpack_require__(88); var IsPlainObject = __webpack_require__(8); /** * @classdesc - * [description] + * An Arcade Physics Static Group object. + * + * All Game Objects created by this Group will automatically be given static Arcade Physics bodies. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Group}. * * @class StaticGroup * @extends Phaser.GameObjects.Group @@ -60859,10 +61141,10 @@ var IsPlainObject = __webpack_require__(8); * @constructor * @since 3.0.0 * - * @param {Phaser.Physics.Arcade.World} world - [description] - * @param {Phaser.Scene} scene - [description] - * @param {array} children - [description] - * @param {GroupConfig} config - [description] + * @param {Phaser.Physics.Arcade.World} world - The physics simulation. + * @param {Phaser.Scene} scene - The scene this group belongs to. + * @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. */ var StaticPhysicsGroup = new Class({ @@ -60908,7 +61190,7 @@ var StaticPhysicsGroup = new Class({ } /** - * [description] + * The physics simulation. * * @name Phaser.Physics.Arcade.StaticGroup#world * @type {Phaser.Physics.Arcade.World} @@ -60917,10 +61199,11 @@ var StaticPhysicsGroup = new Class({ this.world = world; /** - * [description] + * The scene this group belongs to. * * @name Phaser.Physics.Arcade.StaticGroup#physicsType * @type {integer} + * @default STATIC_BODY * @since 3.0.0 */ this.physicsType = CONST.STATIC_BODY; @@ -60929,12 +61212,14 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Adds a static physics body to the new group member (if it lacks one) and adds it to the simulation. * * @method Phaser.Physics.Arcade.StaticGroup#createCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The new group member. + * + * @see Phaser.Physics.Arcade.World#enableBody */ createCallbackHandler: function (child) { @@ -60945,12 +61230,14 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Disables the group member's physics body, removing it from the simulation. * * @method Phaser.Physics.Arcade.StaticGroup#removeCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The group member being removed. + * + * @see Phaser.Physics.Arcade.World#disableBody */ removeCallbackHandler: function (child) { @@ -60961,12 +61248,14 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Refreshes the group. * * @method Phaser.Physics.Arcade.StaticGroup#createMultipleCallbackHandler * @since 3.0.0 * - * @param {object} entries - [description] + * @param {Phaser.GameObjects.GameObject[]} entries - The newly created group members. + * + * @see Phaser.Physics.Arcade.StaticGroup#refresh */ createMultipleCallbackHandler: function () { @@ -60974,12 +61263,15 @@ var StaticPhysicsGroup = new Class({ }, /** - * [description] + * Resets each Body to the position of its parent Game Object. + * Body sizes aren't changed (use {@link Phaser.Physics.Arcade.Components.Enable#refreshBody} for that). * * @method Phaser.Physics.Arcade.StaticGroup#refresh * @since 3.0.0 * - * @return {Phaser.Physics.Arcade.StaticGroup} [description] + * @return {Phaser.Physics.Arcade.StaticGroup} This group. + * + * @see Phaser.Physics.Arcade.StaticBody#reset */ refresh: function () { @@ -61012,7 +61304,7 @@ var ArcadeSprite = __webpack_require__(104); var Class = __webpack_require__(0); var CONST = __webpack_require__(35); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(87); +var Group = __webpack_require__(88); var IsPlainObject = __webpack_require__(8); /** @@ -61045,34 +61337,36 @@ var IsPlainObject = __webpack_require__(8); /** * @typedef {object} PhysicsGroupDefaults * - * @property {boolean} setCollideWorldBounds - [description] - * @property {number} setAccelerationX - [description] - * @property {number} setAccelerationY - [description] - * @property {boolean} setAllowDrag - [description] - * @property {boolean} setAllowGravity - [description] - * @property {boolean} setAllowRotation - [description] - * @property {number} setBounceX - [description] - * @property {number} setBounceY - [description] - * @property {number} setDragX - [description] - * @property {number} setDragY - [description] - * @property {number} setGravityX - [description] - * @property {number} setGravityY - [description] - * @property {number} setFrictionX - [description] - * @property {number} setFrictionY - [description] - * @property {number} setVelocityX - [description] - * @property {number} setVelocityY - [description] - * @property {number} setAngularVelocity - [description] - * @property {number} setAngularAcceleration - [description] - * @property {number} setAngularDrag - [description] - * @property {number} setMass - [description] - * @property {boolean} setImmovable - [description] + * @property {boolean} setCollideWorldBounds - As {@link Phaser.Physics.Arcade.Body#setCollideWorldBounds}. + * @property {number} setAccelerationX - As {@link Phaser.Physics.Arcade.Body#setAccelerationX}. + * @property {number} setAccelerationY - As {@link Phaser.Physics.Arcade.Body#setAccelerationY}. + * @property {boolean} setAllowDrag - As {@link Phaser.Physics.Arcade.Body#setAllowDrag}. + * @property {boolean} setAllowGravity - As {@link Phaser.Physics.Arcade.Body#setAllowGravity}. + * @property {boolean} setAllowRotation - As {@link Phaser.Physics.Arcade.Body#setAllowRotation}. + * @property {number} setBounceX - As {@link Phaser.Physics.Arcade.Body#setBounceX}. + * @property {number} setBounceY - As {@link Phaser.Physics.Arcade.Body#setBounceY}. + * @property {number} setDragX - As {@link Phaser.Physics.Arcade.Body#setDragX}. + * @property {number} setDragY - As {@link Phaser.Physics.Arcade.Body#setDragY}. + * @property {number} setGravityX - As {@link Phaser.Physics.Arcade.Body#setGravityX}. + * @property {number} setGravityY - As {@link Phaser.Physics.Arcade.Body#setGravityY}. + * @property {number} setFrictionX - As {@link Phaser.Physics.Arcade.Body#setFrictionX}. + * @property {number} setFrictionY - As {@link Phaser.Physics.Arcade.Body#setFrictionY}. + * @property {number} setVelocityX - As {@link Phaser.Physics.Arcade.Body#setVelocityX}. + * @property {number} setVelocityY - As {@link Phaser.Physics.Arcade.Body#setVelocityY}. + * @property {number} setAngularVelocity - As {@link Phaser.Physics.Arcade.Body#setAngularVelocity}. + * @property {number} setAngularAcceleration - As {@link Phaser.Physics.Arcade.Body#setAngularAcceleration}. + * @property {number} setAngularDrag - As {@link Phaser.Physics.Arcade.Body#setAngularDrag}. + * @property {number} setMass - As {@link Phaser.Physics.Arcade.Body#setMass}. + * @property {boolean} setImmovable - As {@link Phaser.Physics.Arcade.Body#setImmovable}. */ /** * @classdesc * An Arcade Physics Group object. * - * All Game Objects created by this Group will automatically be dynamic Arcade Physics objects. + * All Game Objects created by this Group will automatically be given dynamic Arcade Physics bodies. + * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}. * * @class Group * @extends Phaser.GameObjects.Group @@ -61080,10 +61374,10 @@ var IsPlainObject = __webpack_require__(8); * @constructor * @since 3.0.0 * - * @param {Phaser.Physics.Arcade.World} world - [description] - * @param {Phaser.Scene} scene - [description] - * @param {array} children - [description] - * @param {PhysicsGroupConfig} [config] - [description] + * @param {Phaser.Physics.Arcade.World} world - The physics simulation. + * @param {Phaser.Scene} scene - The scene this group belongs to. + * @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group. */ var PhysicsGroup = new Class({ @@ -61123,7 +61417,7 @@ var PhysicsGroup = new Class({ } /** - * [description] + * The physics simulation. * * @name Phaser.Physics.Arcade.Group#world * @type {Phaser.Physics.Arcade.World} @@ -61133,24 +61427,26 @@ var PhysicsGroup = new Class({ /** * The class to create new group members from. + * This should be ArcadeImage, ArcadeSprite, or a class extending one of those. * * @name Phaser.Physics.Arcade.Group#classType - * @type {Phaser.Physics.Arcade.Sprite} + * @type {(Phaser.Physics.Arcade.Image|Phaser.Physics.Arcade.Sprite)} * @default ArcadeSprite */ config.classType = GetFastValue(config, 'classType', ArcadeSprite); /** - * [description] + * The physics type of the Group's members. * * @name Phaser.Physics.Arcade.Group#physicsType * @type {integer} + * @default DYNAMIC_BODY * @since 3.0.0 */ this.physicsType = CONST.DYNAMIC_BODY; /** - * [description] + * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument. * * @name Phaser.Physics.Arcade.Group#defaults * @type {PhysicsGroupDefaults} @@ -61184,12 +61480,12 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Enables a Game Object's Body and assigns `defaults`. Called when a Group member is added or created. * * @method Phaser.Physics.Arcade.Group#createCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The Game Object being added. */ createCallbackHandler: function (child) { @@ -61207,12 +61503,12 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Disables a Game Object's Body. Called when a Group member is removed. * * @method Phaser.Physics.Arcade.Group#removeCallbackHandler * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {Phaser.GameObjects.GameObject} child - The Game Object being removed. */ removeCallbackHandler: function (child) { @@ -61223,14 +61519,14 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Sets the velocity of each Group member. * * @method Phaser.Physics.Arcade.Group#setVelocity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} step - [description] + * @param {number} x - The horizontal velocity. + * @param {number} y - The vertical velocity. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x, y), the second (x + step, y + step), and so on. * * @return {Phaser.Physics.Arcade.Group} This Physics Group object. */ @@ -61249,13 +61545,13 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Sets the horizontal velocity of each Group member. * * @method Phaser.Physics.Arcade.Group#setVelocityX * @since 3.0.0 * - * @param {number} value - [description] - * @param {number} step - [description] + * @param {number} value - The velocity value. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x), the second (x + step), and so on. * * @return {Phaser.Physics.Arcade.Group} This Physics Group object. */ @@ -61274,13 +61570,13 @@ var PhysicsGroup = new Class({ }, /** - * [description] + * Sets the vertical velocity of each Group member. * * @method Phaser.Physics.Arcade.Group#setVelocityY * @since 3.0.0 * - * @param {number} value - [description] - * @param {number} step - [description] + * @param {number} value - The velocity value. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (y), the second (y + step), and so on. * * @return {Phaser.Physics.Arcade.Group} This Physics Group object. */ @@ -61347,7 +61643,7 @@ module.exports = { var Class = __webpack_require__(0); var Components = __webpack_require__(237); -var Image = __webpack_require__(86); +var Image = __webpack_require__(87); /** * @classdesc @@ -61545,8 +61841,8 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#existing * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} gameObject - [description] - * @param {boolean} [isStatic=false] - Set to true to create a Static body, otherwise it will create a Dynamic body. + * @param {Phaser.GameObjects.GameObject} gameObject - A Game Object. + * @param {boolean} [isStatic=false] - Create a Static body (true) or Dynamic body (false). * * @return {Phaser.GameObjects.GameObject} The Game Object. */ @@ -61664,8 +61960,8 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#staticGroup * @since 3.0.0 * - * @param {object|object[]} [children] - [description] - * @param {GroupConfig} [config] - [description] + * @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. * * @return {Phaser.Physics.Arcade.StaticGroup} The Static Group object that was created. */ @@ -61681,8 +61977,8 @@ var Factory = new Class({ * @method Phaser.Physics.Arcade.Factory#group * @since 3.0.0 * - * @param {object|object[]} [children] - [description] - * @param {PhysicsGroupConfig} [config] - [description] + * @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group. * * @return {Phaser.Physics.Arcade.Group} The Group object that was created. */ @@ -67395,7 +67691,7 @@ Rectangle.Ceil = __webpack_require__(654); Rectangle.CeilAll = __webpack_require__(653); Rectangle.CenterOn = __webpack_require__(174); Rectangle.Clone = __webpack_require__(652); -Rectangle.Contains = __webpack_require__(38); +Rectangle.Contains = __webpack_require__(39); Rectangle.ContainsPoint = __webpack_require__(651); Rectangle.ContainsRect = __webpack_require__(265); Rectangle.CopyFrom = __webpack_require__(650); @@ -67497,7 +67793,7 @@ module.exports = GetMagnitude; */ var MATH_CONST = __webpack_require__(16); -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); var Angle = __webpack_require__(68); /** @@ -67566,15 +67862,16 @@ module.exports = Decompose; */ /** - * [description] + * Create an array of points for each corner of a Rectangle + * If an array is specified, each point object will be added to the end of the array, otherwise a new array will be created. * * @function Phaser.Geom.Rectangle.Decompose * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {array} [out] - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle object to be decomposed. + * @param {array} [out] - If provided, each point will be added to this array. * - * @return {array} [description] + * @return {array} Will return the array you specified or a new array containing the points of the Rectangle. */ var Decompose = function (rect, out) { @@ -67633,7 +67930,7 @@ module.exports = PointToLine; // Based on code by Matt DesLauriers // https://github.com/mattdesl/line-circle-collision/blob/master/LICENSE.md -var Contains = __webpack_require__(39); +var Contains = __webpack_require__(40); var Point = __webpack_require__(6); var tmp = new Point(); @@ -68393,19 +68690,19 @@ var Length = __webpack_require__(65); var Point = __webpack_require__(6); /** - * [description] + * Returns an array of evenly spaced points on the perimeter of a Triangle. * * @function Phaser.Geom.Triangle.GetPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [out,$return] * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {integer} quantity - [description] - * @param {number} stepRate - [description] - * @param {(array|Phaser.Geom.Point[])} [out] - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the points from. + * @param {integer} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param {number} stepRate - If `quantity` is 0, the distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [out] - An array to which the points should be appended. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} The modified `out` array, or a new array if none was provided. */ var GetPoints = function (triangle, quantity, stepRate, out) { @@ -69387,6 +69684,7 @@ var Smooth = __webpack_require__(283); * The Polygon Shape is created by providing a list of points, which are then used to create an * internal Polygon geometry object. The points can be set from a variety of formats: * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point or Vector2 objects: `[new Phaser.Math.Vec2(x1, y1), ...]` * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` @@ -69565,6 +69863,16 @@ var Line = new Class({ var width = this.geom.right - this.geom.left; var height = this.geom.bottom - this.geom.top; + /** + * The width (or thickness) of the line. + * See the setLineWidth method for extra details on changing this on WebGL. + * + * @name Phaser.GameObjects.Line#lineWidth + * @type {number} + * @since 3.13.0 + */ + this.lineWidth = 1; + /** * Private internal value. Holds the start width of the line. * @@ -70405,7 +70713,7 @@ module.exports = Grid; var Class = __webpack_require__(0); var Earcut = __webpack_require__(64); var EllipseRender = __webpack_require__(795); -var GeomEllipse = __webpack_require__(89); +var GeomEllipse = __webpack_require__(90); var Shape = __webpack_require__(27); /** @@ -71242,10 +71550,10 @@ module.exports = UUID; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(31); -var GetBoolean = __webpack_require__(83); +var GetBoolean = __webpack_require__(84); var GetValue = __webpack_require__(4); var Sprite = __webpack_require__(61); -var TWEEN_CONST = __webpack_require__(82); +var TWEEN_CONST = __webpack_require__(83); var Vector2 = __webpack_require__(3); /** @@ -72215,13 +72523,13 @@ var EmitterOp = __webpack_require__(821); var GetFastValue = __webpack_require__(2); var GetRandom = __webpack_require__(161); var HasAny = __webpack_require__(299); -var HasValue = __webpack_require__(84); +var HasValue = __webpack_require__(85); var Particle = __webpack_require__(304); var RandomZone = __webpack_require__(298); var Rectangle = __webpack_require__(9); var StableSort = __webpack_require__(110); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * @callback ParticleEmitterCallback @@ -74390,7 +74698,7 @@ module.exports = ParticleEmitter; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(31); -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); /** * @classdesc @@ -75467,7 +75775,7 @@ module.exports = Circumference; var Circumference = __webpack_require__(307); var CircumferencePoint = __webpack_require__(155); -var FromPercent = __webpack_require__(92); +var FromPercent = __webpack_require__(93); var MATH_CONST = __webpack_require__(16); /** @@ -75520,7 +75828,7 @@ module.exports = GetPoints; */ var CircumferencePoint = __webpack_require__(155); -var FromPercent = __webpack_require__(92); +var FromPercent = __webpack_require__(93); var MATH_CONST = __webpack_require__(16); var Point = __webpack_require__(6); @@ -75565,18 +75873,18 @@ module.exports = GetPoint; var Rectangle = __webpack_require__(9); /** - * [description] + * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. * * @function Phaser.Geom.Rectangle.Union * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rectA - [description] - * @param {Phaser.Geom.Rectangle} rectB - [description] - * @param {Phaser.Geom.Rectangle} [out] - [description] + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. + * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. */ var Union = function (rectA, rectB, out) { @@ -76198,7 +76506,7 @@ module.exports = { var CanvasPool = __webpack_require__(24); var Class = __webpack_require__(0); var IsSizePowerOfTwo = __webpack_require__(117); -var ScaleModes = __webpack_require__(93); +var ScaleModes = __webpack_require__(94); /** * @classdesc @@ -76426,6 +76734,17 @@ var TextureSource = new Class({ if (this.renderer.gl && this.isCanvas) { this.glTexture = this.renderer.canvasToTexture(this.image, this.glTexture); + + // Update all the Frames using this TextureSource + + var index = this.texture.getTextureSourceIndex(this); + + var frames = this.texture.getFramesFromTextureSource(index, true); + + for (var i = 0; i < frames.length; i++) + { + frames[i].glTexture = this.glTexture; + } } }, @@ -82641,7 +82960,7 @@ module.exports = SceneManager; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var SpliceOne = __webpack_require__(90); +var SpliceOne = __webpack_require__(91); /** * Removes the given item, or array of items, from the array. @@ -83917,7 +84236,7 @@ module.exports = SmoothStepInterpolation; */ var Class = __webpack_require__(0); -var Distance = __webpack_require__(51); +var Distance = __webpack_require__(52); var SmoothStepInterpolation = __webpack_require__(335); var Vector2 = __webpack_require__(3); @@ -84881,6 +85200,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native event from the browser. */ + + /* pointerLockChange: function (event) { var element = this.target; @@ -84889,6 +85210,7 @@ var MouseManager = new Class({ this.manager.queue.push(event); }, + */ /** * If the browser supports pointer lock, this will request that the pointer lock is released. If @@ -84915,6 +85237,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native DOM Mouse Move Event. */ + + /* onMouseMove: function (event) { if (event.defaultPrevented || !this.enabled || !this.manager) @@ -84930,6 +85254,7 @@ var MouseManager = new Class({ event.preventDefault(); } }, + */ /** * The Mouse Down Event Handler. @@ -84939,6 +85264,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native DOM Mouse Down Event. */ + + /* onMouseDown: function (event) { if (event.defaultPrevented || !this.enabled) @@ -84954,6 +85281,7 @@ var MouseManager = new Class({ event.preventDefault(); } }, + */ /** * The Mouse Up Event Handler. @@ -84963,6 +85291,8 @@ var MouseManager = new Class({ * * @param {MouseEvent} event - The native DOM Mouse Up Event. */ + + /* onMouseUp: function (event) { if (event.defaultPrevented || !this.enabled) @@ -84978,6 +85308,7 @@ var MouseManager = new Class({ event.preventDefault(); } }, + */ /** * Starts the Mouse Event listeners running. @@ -84988,31 +85319,84 @@ var MouseManager = new Class({ */ startListeners: function () { - var target = this.target; + var _this = this; + var onMouseMove = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.manager.queueMouseMove(event); + + if (_this.capture) + { + event.preventDefault(); + } + }; + + var onMouseDown = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.manager.queueMouseDown(event); + + if (_this.capture) + { + event.preventDefault(); + } + }; + + var onMouseUp = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.manager.queueMouseUp(event); + + if (_this.capture) + { + event.preventDefault(); + } + }; + + this.onMouseMove = onMouseMove; + this.onMouseDown = onMouseDown; + this.onMouseUp = onMouseUp; + + var target = this.target; var passive = { passive: true }; var nonPassive = { passive: false }; - if (this.capture) - { - target.addEventListener('mousemove', this.onMouseMove.bind(this), nonPassive); - target.addEventListener('mousedown', this.onMouseDown.bind(this), nonPassive); - target.addEventListener('mouseup', this.onMouseUp.bind(this), nonPassive); - } - else - { - target.addEventListener('mousemove', this.onMouseMove.bind(this), passive); - target.addEventListener('mousedown', this.onMouseDown.bind(this), passive); - target.addEventListener('mouseup', this.onMouseUp.bind(this), passive); - } + target.addEventListener('mousemove', onMouseMove, (this.capture) ? nonPassive : passive); + target.addEventListener('mousedown', onMouseDown, (this.capture) ? nonPassive : passive); + target.addEventListener('mouseup', onMouseUp, (this.capture) ? nonPassive : passive); if (Features.pointerLock) { - this.pointerLockChange = this.pointerLockChange.bind(this); + var onPointerLockChange = function (event) + { + var element = _this.target; - document.addEventListener('pointerlockchange', this.pointerLockChange, true); - document.addEventListener('mozpointerlockchange', this.pointerLockChange, true); - document.addEventListener('webkitpointerlockchange', this.pointerLockChange, true); + _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false; + + _this.manager.queue.push(event); + }; + + this.pointerLockChange = onPointerLockChange; + + document.addEventListener('pointerlockchange', onPointerLockChange, true); + document.addEventListener('mozpointerlockchange', onPointerLockChange, true); + document.addEventListener('webkitpointerlockchange', onPointerLockChange, true); } }, @@ -85155,7 +85539,7 @@ var Mouse = __webpack_require__(337); var Pointer = __webpack_require__(336); var Rectangle = __webpack_require__(9); var Touch = __webpack_require__(334); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var TransformXY = __webpack_require__(333); /** @@ -86685,7 +87069,7 @@ module.exports = init(); module.exports = { - os: __webpack_require__(91), + os: __webpack_require__(92), browser: __webpack_require__(118), features: __webpack_require__(167), input: __webpack_require__(901), @@ -86990,7 +87374,7 @@ module.exports = ParseXML; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var OS = __webpack_require__(91); +var OS = __webpack_require__(92); /** * @callback ContentLoadedCallback @@ -87665,10 +88049,10 @@ var QuadraticBezier = new Class({ * * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * - * @param {Phaser.GameObjects.Graphics} graphics - [description] - * @param {integer} [pointsTotal=32] - [description] + * @param {Phaser.GameObjects.Graphics} graphics - `Graphics` object to draw onto. + * @param {integer} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. * - * @return {Phaser.GameObjects.Graphics} [description] + * @return {Phaser.GameObjects.Graphics} `Graphics` object that was drawn to. */ draw: function (graphics, pointsTotal) { @@ -87691,7 +88075,7 @@ var QuadraticBezier = new Class({ }, /** - * [description] + * Converts the curve into a JSON compatible object. * * @method Phaser.Curves.QuadraticBezier#toJSON * @since 3.2.0 @@ -87713,14 +88097,14 @@ var QuadraticBezier = new Class({ }); /** - * [description] + * Creates a curve from a JSON object, e. g. created by `toJSON`. * * @function Phaser.Curves.QuadraticBezier.fromJSON * @since 3.2.0 * * @param {JSONCurve} data - The JSON object containing this curve data. * - * @return {Phaser.Curves.QuadraticBezier} [description] + * @return {Phaser.Curves.QuadraticBezier} The created curve instance. */ QuadraticBezier.fromJSON = function (data) { @@ -88016,32 +88400,34 @@ var Vector2 = __webpack_require__(3); * @typedef {object} JSONEllipseCurve * * @property {string} type - The of the curve. - * @property {number} x - [description] - * @property {number} y - [description] + * @property {number} x - The x coordinate of the ellipse. + * @property {number} y - The y coordinate of the ellipse. * @property {number} xRadius - The horizontal radius of ellipse. * @property {number} yRadius - The vertical radius of ellipse. - * @property {integer} startAngle - The start angle of ellipse. - * @property {integer} endAngle - The end angle of ellipse. - * @property {boolean} clockwise - The clockwise of ellipse. - * @property {integer} rotation - The rotation of ellipse. + * @property {integer} startAngle - The start angle of the ellipse, in degrees. + * @property {integer} endAngle - The end angle of the ellipse, in degrees. + * @property {boolean} clockwise - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @property {integer} rotation - The rotation of ellipse, in degrees. */ /** * @typedef {object} EllipseCurveConfig * - * @property {number} [x=0] - [description] - * @property {number} [y=0] - [description] - * @property {number} [xRadius=0] - [description] - * @property {number} [yRadius=0] - [description] - * @property {integer} [startAngle=0] - [description] - * @property {integer} [endAngle=360] - [description] - * @property {boolean} [clockwise=false] - [description] - * @property {integer} [rotation=0] - [description] + * @property {number} [x=0] - The x coordinate of the ellipse. + * @property {number} [y=0] - The y coordinate of the ellipse. + * @property {number} [xRadius=0] - The horizontal radius of the ellipse. + * @property {number} [yRadius=0] - The vertical radius of the ellipse. + * @property {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @property {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @property {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @property {integer} [rotation=0] - The rotation of the ellipse, in degrees. */ /** * @classdesc - * [description] + * An Elliptical Curve derived from the Base Curve class. + * + * See https://en.wikipedia.org/wiki/Elliptic_curve for more details. * * @class Ellipse * @extends Phaser.Curves.Curve @@ -88049,14 +88435,14 @@ var Vector2 = __webpack_require__(3); * @constructor * @since 3.0.0 * - * @param {(number|EllipseCurveConfig)} [x=0] - [description] - * @param {number} [y=0] - [description] - * @param {number} [xRadius=0] - [description] - * @param {number} [yRadius=0] - [description] - * @param {integer} [startAngle=0] - [description] - * @param {integer} [endAngle=360] - [description] - * @param {boolean} [clockwise=false] - [description] - * @param {integer} [rotation=0] - [description] + * @param {(number|EllipseCurveConfig)} [x=0] - The x coordinate of the ellipse, or an Ellipse Curve configuration object. + * @param {number} [y=0] - The y coordinate of the ellipse. + * @param {number} [xRadius=0] - The horizontal radius of ellipse. + * @param {number} [yRadius=0] - The vertical radius of ellipse. + * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. */ var EllipseCurve = new Class({ @@ -88093,7 +88479,7 @@ var EllipseCurve = new Class({ // Center point /** - * [description] + * The center point of the ellipse. Used for calculating rotation. * * @name Phaser.Curves.Ellipse#p0 * @type {Phaser.Math.Vector2} @@ -88102,7 +88488,7 @@ var EllipseCurve = new Class({ this.p0 = new Vector2(x, y); /** - * [description] + * The horizontal radius of the ellipse. * * @name Phaser.Curves.Ellipse#_xRadius * @type {number} @@ -88112,7 +88498,7 @@ var EllipseCurve = new Class({ this._xRadius = xRadius; /** - * [description] + * The vertical radius of the ellipse. * * @name Phaser.Curves.Ellipse#_yRadius * @type {number} @@ -88124,7 +88510,7 @@ var EllipseCurve = new Class({ // Radians /** - * [description] + * The starting angle of the ellipse in radians. * * @name Phaser.Curves.Ellipse#_startAngle * @type {number} @@ -88134,7 +88520,7 @@ var EllipseCurve = new Class({ this._startAngle = DegToRad(startAngle); /** - * [description] + * The end angle of the ellipse in radians. * * @name Phaser.Curves.Ellipse#_endAngle * @type {number} @@ -88411,7 +88797,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The x coordinate of the center of the ellipse. * * @name Phaser.Curves.Ellipse#x * @type {number} @@ -88432,7 +88818,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The y coordinate of the center of the ellipse. * * @name Phaser.Curves.Ellipse#y * @type {number} @@ -88453,7 +88839,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The horizontal radius of the ellipse. * * @name Phaser.Curves.Ellipse#xRadius * @type {number} @@ -88474,7 +88860,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The vertical radius of the ellipse. * * @name Phaser.Curves.Ellipse#yRadius * @type {number} @@ -88495,7 +88881,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The start angle of the ellipse in degrees. * * @name Phaser.Curves.Ellipse#startAngle * @type {number} @@ -88516,7 +88902,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The end angle of the ellipse in degrees. * * @name Phaser.Curves.Ellipse#endAngle * @type {number} @@ -88537,7 +88923,7 @@ var EllipseCurve = new Class({ }, /** - * [description] + * `true` if the ellipse rotation is clockwise or `false` if anti-clockwise. * * @name Phaser.Curves.Ellipse#clockwise * @type {boolean} @@ -88558,7 +88944,28 @@ var EllipseCurve = new Class({ }, /** - * [description] + * The rotation of the ellipse, relative to the center, in degrees. + * + * @name Phaser.Curves.Ellipse#angle + * @type {number} + * @since 3.14.0 + */ + angle: { + + get: function () + { + return RadToDeg(this._rotation); + }, + + set: function (value) + { + this._rotation = DegToRad(value); + } + + }, + + /** + * The rotation of the ellipse, relative to the center, in radians. * * @name Phaser.Curves.Ellipse#rotation * @type {number} @@ -88573,13 +88980,13 @@ var EllipseCurve = new Class({ set: function (value) { - this._rotation = DegToRad(value); + this._rotation = value; } }, /** - * [description] + * JSON serialization of the curve. * * @method Phaser.Curves.Ellipse#toJSON * @since 3.0.0 @@ -88604,14 +89011,14 @@ var EllipseCurve = new Class({ }); /** - * [description] + * Creates a curve from the provided Ellipse Curve Configuration object. * * @function Phaser.Curves.Ellipse.fromJSON * @since 3.0.0 * * @param {JSONEllipseCurve} data - The JSON object containing this curve data. * - * @return {Phaser.Curves.Ellipse} [description] + * @return {Phaser.Curves.Ellipse} The ellipse curve constructed from the configuration object. */ EllipseCurve.fromJSON = function (data) { @@ -88703,7 +89110,7 @@ var Vector2 = __webpack_require__(3); /** * @classdesc - * [description] + * A higher-order Bézier curve constructed of four points. * * @class CubicBezier * @extends Phaser.Curves.Curve @@ -88735,7 +89142,7 @@ var CubicBezierCurve = new Class({ } /** - * [description] + * The start point of this curve. * * @name Phaser.Curves.CubicBezier#p0 * @type {Phaser.Math.Vector2} @@ -88744,7 +89151,7 @@ var CubicBezierCurve = new Class({ this.p0 = p0; /** - * [description] + * The first control point of this curve. * * @name Phaser.Curves.CubicBezier#p1 * @type {Phaser.Math.Vector2} @@ -88753,7 +89160,7 @@ var CubicBezierCurve = new Class({ this.p1 = p1; /** - * [description] + * The second control point of this curve. * * @name Phaser.Curves.CubicBezier#p2 * @type {Phaser.Math.Vector2} @@ -88762,7 +89169,7 @@ var CubicBezierCurve = new Class({ this.p2 = p2; /** - * [description] + * The end point of this curve. * * @name Phaser.Curves.CubicBezier#p3 * @type {Phaser.Math.Vector2} @@ -88791,7 +89198,7 @@ var CubicBezierCurve = new Class({ }, /** - * [description] + * Returns the resolution of this curve. * * @method Phaser.Curves.CubicBezier#getResolution * @since 3.0.0 @@ -88831,17 +89238,17 @@ var CubicBezierCurve = new Class({ }, /** - * [description] + * Draws this curve to the specified graphics object. * * @method Phaser.Curves.CubicBezier#draw * @since 3.0.0 * * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * - * @param {Phaser.GameObjects.Graphics} graphics - [description] - * @param {integer} [pointsTotal=32] - [description] + * @param {Phaser.GameObjects.Graphics} graphics - The graphics object this curve should be drawn to. + * @param {integer} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. * - * @return {Phaser.GameObjects.Graphics} [description] + * @return {Phaser.GameObjects.Graphics} The graphics object this curve was drawn to. Useful for method chaining. */ draw: function (graphics, pointsTotal) { @@ -88864,7 +89271,7 @@ var CubicBezierCurve = new Class({ }, /** - * [description] + * Returns a JSON object that describes this curve. * * @method Phaser.Curves.CubicBezier#toJSON * @since 3.0.0 @@ -88887,14 +89294,14 @@ var CubicBezierCurve = new Class({ }); /** - * [description] + * Generates a curve from a JSON object. * * @function Phaser.Curves.CubicBezier.fromJSON * @since 3.0.0 * * @param {JSONCurve} data - The JSON object containing this curve data. * - * @return {Phaser.Curves.CubicBezier} [description] + * @return {Phaser.Curves.CubicBezier} The curve generated from the JSON object. */ CubicBezierCurve.fromJSON = function (data) { @@ -88976,8 +89383,8 @@ var GetValue = __webpack_require__(4); * @property {array} [data=[]] - [description] * @property {HTMLCanvasElement} [canvas=null] - [description] * @property {Palette} [palette=Arne16] - [description] - * @property {number} [pixelWidth=1] - [description] - * @property {number} [pixelHeight=1] - [description] + * @property {number} [pixelWidth=1] - The width of each 'pixel' in the generated texture. + * @property {number} [pixelHeight=1] - The height of each 'pixel' in the generated texture. * @property {boolean} [resizeCanvas=true] - [description] * @property {boolean} [clearCanvas=true] - [description] * @property {GenerateTextureRendererCallback} [preRender] - [description] @@ -91105,7 +91512,7 @@ var Pad = __webpack_require__(179); * @constructor * @since 3.0.0 * - * @param {Phaser.Game} game - [description] + * @param {Phaser.Game} game - A reference to the Phaser.Game instance. */ var AnimationManager = new Class({ @@ -91118,7 +91525,7 @@ var AnimationManager = new Class({ EventEmitter.call(this); /** - * [description] + * A reference to the Phaser.Game instance. * * @name Phaser.Animations.AnimationManager#game * @type {Phaser.Game} @@ -91128,7 +91535,7 @@ var AnimationManager = new Class({ this.game = game; /** - * [description] + * A reference to the Texture Manager. * * @name Phaser.Animations.AnimationManager#textureManager * @type {Phaser.Textures.TextureManager} @@ -91258,7 +91665,7 @@ var AnimationManager = new Class({ * @since 3.0.0 * * @param {(string|JSONAnimationManager|JSONAnimation)} data - [description] - * @param {boolean} [clearCurrentAnimations=false] - [description] + * @param {boolean} [clearCurrentAnimations=false] - If set to `true`, the current animations will be removed (`anims.clear()`). If set to `false` (default), the animations in `data` will be added. * * @return {Phaser.Animations.Animation[]} An array containing all of the Animation objects that were created as a result of this call. */ @@ -91313,15 +91720,17 @@ var AnimationManager = new Class({ */ /** - * [description] + * Generate an array of {@link AnimationFrameConfig} objects from a texture key and configuration object. + * + * Generates objects with string frame names, as configured by the given {@link AnimationFrameConfig}. * * @method Phaser.Animations.AnimationManager#generateFrameNames * @since 3.0.0 * - * @param {string} key - [description] - * @param {GenerateFrameNamesConfig} [config] - [description] + * @param {string} key - The key for the texture containing the animation frames. + * @param {GenerateFrameNamesConfig} [config] - The configuration object for the animation frame names. * - * @return {AnimationFrameConfig[]} [description] + * @return {AnimationFrameConfig[]} The array of {@link AnimationFrameConfig} objects. */ generateFrameNames: function (key, config) { @@ -91398,7 +91807,9 @@ var AnimationManager = new Class({ */ /** - * Generates an array of {@link AnimationFrameConfig} objects from a texture key and configuration object. + * Generate an array of {@link AnimationFrameConfig} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link GenerateFrameNumbersConfig}. * * @method Phaser.Animations.AnimationManager#generateFrameNumbers * @since 3.0.0 @@ -91462,14 +91873,14 @@ var AnimationManager = new Class({ }, /** - * [description] + * Get an Animation. * * @method Phaser.Animations.AnimationManager#get * @since 3.0.0 * - * @param {string} key - [description] + * @param {string} key - The key of the Animation to retrieve. * - * @return {Phaser.Animations.Animation} [description] + * @return {Phaser.Animations.Animation} The Animation. */ get: function (key) { @@ -91477,14 +91888,14 @@ var AnimationManager = new Class({ }, /** - * Load an Animation into a Game Objects Animation Component. + * Load an Animation into a Game Object's Animation Component. * * @method Phaser.Animations.AnimationManager#load * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} child - [description] - * @param {string} key - [description] - * @param {(string|integer)} [startFrame] - [description] + * @param {Phaser.GameObjects.GameObject} child - The Game Object to load the animation into. + * @param {string} key - The key of the animation to load. + * @param {(string|integer)} [startFrame] - The name of a start frame to set on the loaded animation. * * @return {Phaser.GameObjects.GameObject} [description] */ @@ -91501,7 +91912,7 @@ var AnimationManager = new Class({ }, /** - * [description] + * Pause all animations. * * @method Phaser.Animations.AnimationManager#pauseAll * @fires PauseAllAnimationEvent @@ -91522,13 +91933,13 @@ var AnimationManager = new Class({ }, /** - * [description] + * Play an animation on the given Game Objects that have an Animation Component. * * @method Phaser.Animations.AnimationManager#play * @since 3.0.0 * - * @param {string} key - [description] - * @param {Phaser.GameObjects.GameObject} child - [description] + * @param {string} key - The key of the animation to play on the Game Object. + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Objects to play the animation on. * * @return {Phaser.Animations.AnimationManager} This Animation Manager. */ @@ -91555,13 +91966,13 @@ var AnimationManager = new Class({ }, /** - * [description] + * Remove an animation. * * @method Phaser.Animations.AnimationManager#remove * @fires RemoveAnimationEvent * @since 3.0.0 * - * @param {string} key - [description] + * @param {string} key - The key of the animation to remove. * * @return {Phaser.Animations.Animation} [description] */ @@ -91580,7 +91991,7 @@ var AnimationManager = new Class({ }, /** - * [description] + * Resume all paused animations. * * @method Phaser.Animations.AnimationManager#resumeAll * @fires ResumeAllAnimationEvent @@ -91601,17 +92012,17 @@ var AnimationManager = new Class({ }, /** - * Takes an array of Game Objects that have the Animation Component and then + * Takes an array of Game Objects that have an Animation Component and then * starts the given animation playing on them, each one offset by the * `stagger` amount given to this method. * * @method Phaser.Animations.AnimationManager#staggerPlay * @since 3.0.0 - * + * * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {string} key - The key of the animation to play on the Game Objects. - * @param {Phaser.GameObjects.GameObject[]} children - An array of Game Objects to play the animation on. They must have the Animation Component. + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} children - An array of Game Objects to play the animation on. They must have an Animation Component. * @param {number} [stagger=0] - The amount of time, in milliseconds, to offset each play time by. * * @return {Phaser.Animations.AnimationManager} This Animation Manager. @@ -92759,7 +93170,7 @@ var Animation = new Class({ component.pendingRepeat = false; - component.parent.emit('animationrepeat', this, component.currentFrame, component.repeatCounter); + component.parent.emit('animationrepeat', this, component.currentFrame, component.repeatCounter, component.parent); } } }, @@ -93295,7 +93706,7 @@ module.exports = Visible; */ var MATH_CONST = __webpack_require__(16); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); var WrapAngle = __webpack_require__(200); var WrapAngleDegrees = __webpack_require__(199); @@ -93960,15 +94371,19 @@ var Class = __webpack_require__(0); /** * @classdesc - * [description] + * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect a visible pixel from the geometry mask. The mask is essentially a clipping path which can only make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * + * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and alpha of the pixel from the Geometry Mask do not matter. + * + * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. Moving or transforming the underlying Graphics object will change the mask (and affect the visibility of any masked objects), whereas moving or transforming a masked object will not affect the mask. You can think of the Geometry Mask (or rather, of the its Graphics object) as an invisible curtain placed in front of all masked objects which has its own visual properties and, naturally, respects the camera's visual properties, but isn't affected by and doesn't follow the masked objects by itself. * * @class GeometryMask * @memberOf Phaser.Display.Masks * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description] + * @param {Phaser.Scene} scene - This parameter is not used. + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. */ var GeometryMask = new Class({ @@ -93977,7 +94392,7 @@ var GeometryMask = new Class({ function GeometryMask (scene, graphicsGeometry) { /** - * [description] + * The Graphics object which describes the Geometry Mask. * * @name Phaser.Display.Masks.GeometryMask#geometryMask * @type {Phaser.GameObjects.Graphics} @@ -93987,12 +94402,12 @@ var GeometryMask = new Class({ }, /** - * [description] + * Sets a new Graphics object for the Geometry Mask. * * @method Phaser.Display.Masks.GeometryMask#setShape * @since 3.0.0 * - * @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description] + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. */ setShape: function (graphicsGeometry) { @@ -94000,14 +94415,14 @@ var GeometryMask = new Class({ }, /** - * [description] + * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. * * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] - * @param {Phaser.GameObjects.GameObject} mask - [description] - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. */ preRenderWebGL: function (renderer, mask, camera) { @@ -94035,12 +94450,12 @@ var GeometryMask = new Class({ }, /** - * [description] + * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. * * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL * @since 3.0.0 * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. */ postRenderWebGL: function (renderer) { @@ -94048,18 +94463,19 @@ var GeometryMask = new Class({ // Force flush before disabling stencil test renderer.flush(); + gl.disable(gl.STENCIL_TEST); }, /** - * [description] + * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. * * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description] - * @param {Phaser.GameObjects.GameObject} mask - [description] - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. */ preRenderCanvas: function (renderer, mask, camera) { @@ -94073,12 +94489,12 @@ var GeometryMask = new Class({ }, /** - * [description] + * Restore the canvas context's previous clipping path, thus turning off the mask for it. * * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas * @since 3.0.0 * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description] + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. */ postRenderCanvas: function (renderer) { @@ -94590,19 +95006,19 @@ var Perimeter = __webpack_require__(123); // each spaced out based on the quantity or step required /** - * [description] + * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. * * @function Phaser.Geom.Rectangle.GetPoints * @since 3.0.0 * * @generic {Phaser.Geom.Point[]} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rectangle - [description] + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. * @param {number} step - [description] * @param {integer} quantity - [description] - * @param {(array|Phaser.Geom.Point[])} [out] - [description] + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. * - * @return {(array|Phaser.Geom.Point[])} [description] + * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. */ var GetPoints = function (rectangle, quantity, stepRate, out) { @@ -95175,7 +95591,7 @@ module.exports = Circumference; var Circumference = __webpack_require__(403); var CircumferencePoint = __webpack_require__(192); -var FromPercent = __webpack_require__(92); +var FromPercent = __webpack_require__(93); var MATH_CONST = __webpack_require__(16); /** @@ -95725,7 +96141,7 @@ module.exports = RandomDataGenerator; */ var CircumferencePoint = __webpack_require__(192); -var FromPercent = __webpack_require__(92); +var FromPercent = __webpack_require__(93); var MATH_CONST = __webpack_require__(16); var Point = __webpack_require__(6); @@ -95767,10 +96183,10 @@ module.exports = GetPoint; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetRight = __webpack_require__(43); -var GetTop = __webpack_require__(41); -var SetRight = __webpack_require__(42); -var SetTop = __webpack_require__(40); +var GetRight = __webpack_require__(44); +var GetTop = __webpack_require__(42); +var SetRight = __webpack_require__(43); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned in the top right of the other. @@ -95811,10 +96227,10 @@ module.exports = TopRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetLeft = __webpack_require__(45); -var GetTop = __webpack_require__(41); -var SetLeft = __webpack_require__(44); -var SetTop = __webpack_require__(40); +var GetLeft = __webpack_require__(46); +var GetTop = __webpack_require__(42); +var SetLeft = __webpack_require__(45); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned in the top left of the other. @@ -95856,9 +96272,9 @@ module.exports = TopLeft; */ var GetCenterX = __webpack_require__(75); -var GetTop = __webpack_require__(41); +var GetTop = __webpack_require__(42); var SetCenterX = __webpack_require__(74); -var SetTop = __webpack_require__(40); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned in the top center of the other. @@ -95900,9 +96316,9 @@ module.exports = TopCenter; */ var GetCenterY = __webpack_require__(72); -var GetRight = __webpack_require__(43); +var GetRight = __webpack_require__(44); var SetCenterY = __webpack_require__(73); -var SetRight = __webpack_require__(42); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned in the right center of the other. @@ -95944,9 +96360,9 @@ module.exports = RightCenter; */ var GetCenterY = __webpack_require__(72); -var GetLeft = __webpack_require__(45); +var GetLeft = __webpack_require__(46); var SetCenterY = __webpack_require__(73); -var SetLeft = __webpack_require__(44); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned in the left center of the other. @@ -96066,10 +96482,10 @@ module.exports = Center; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetRight = __webpack_require__(43); -var SetBottom = __webpack_require__(46); -var SetRight = __webpack_require__(42); +var GetBottom = __webpack_require__(48); +var GetRight = __webpack_require__(44); +var SetBottom = __webpack_require__(47); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned in the bottom right of the other. @@ -96110,10 +96526,10 @@ module.exports = BottomRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetLeft = __webpack_require__(45); -var SetBottom = __webpack_require__(46); -var SetLeft = __webpack_require__(44); +var GetBottom = __webpack_require__(48); +var GetLeft = __webpack_require__(46); +var SetBottom = __webpack_require__(47); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned in the bottom left of the other. @@ -96154,9 +96570,9 @@ module.exports = BottomLeft; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); +var GetBottom = __webpack_require__(48); var GetCenterX = __webpack_require__(75); -var SetBottom = __webpack_require__(46); +var SetBottom = __webpack_require__(47); var SetCenterX = __webpack_require__(74); /** @@ -96575,7 +96991,7 @@ var BitmapMaskPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#onBind * @since 3.0.0 * - * @return {Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline} [description] + * @return {this} This WebGLPipeline instance. */ onBind: function () { @@ -96605,7 +97021,7 @@ var BitmapMaskPipeline = new Class({ * @param {number} height - [description] * @param {number} resolution - [description] * - * @return {Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline} [description] + * @return {this} This WebGLPipeline instance. */ resize: function (width, height, resolution) { @@ -96706,16 +97122,16 @@ module.exports = BitmapMaskPipeline; */ /** - * [description] + * Takes a snapshot of the current frame displayed by a WebGL canvas. * * @function Phaser.Renderer.Snapshot.WebGL * @since 3.0.0 * - * @param {HTMLCanvasElement} sourceCanvas - [description] - * @param {string} [type='image/png'] - [description] - * @param {number} [encoderOptions=0.92] - [description] + * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of. + * @param {string} [type='image/png'] - The format of the returned image. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1, for image formats which use lossy compression (such as `image/jpeg`). * - * @return {HTMLImageElement} [description] + * @return {HTMLImageElement} A new image which contains a snapshot of the canvas's contents. */ var WebGLSnapshot = function (sourceCanvas, type, encoderOptions) { @@ -96779,8 +97195,8 @@ var BaseCamera = __webpack_require__(120); var Class = __webpack_require__(0); var CONST = __webpack_require__(26); var IsSizePowerOfTwo = __webpack_require__(117); -var SpliceOne = __webpack_require__(90); -var TransformMatrix = __webpack_require__(53); +var SpliceOne = __webpack_require__(91); +var TransformMatrix = __webpack_require__(38); var Utils = __webpack_require__(10); var WebGLSnapshot = __webpack_require__(422); @@ -96792,15 +97208,15 @@ var TextureTintPipeline = __webpack_require__(196); /** * @callback WebGLContextCallback * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description] + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer which owns the context. */ /** * @typedef {object} SnapshotState * - * @property {SnapshotCallback} callback - [description] - * @property {string} type - [description] - * @property {number} encoder - [description] + * @property {SnapshotCallback} callback - The function to call after the snapshot is taken. + * @property {string} type - The type of the image to create. + * @property {number} encoder - The image quality, between 0 and 1, for image formats which use lossy compression (such as `image/jpeg`). */ /** @@ -96818,7 +97234,7 @@ var TextureTintPipeline = __webpack_require__(196); * @constructor * @since 3.0.0 * - * @param {Phaser.Game} game - [description] + * @param {Phaser.Game} game - The Game instance which owns this WebGL Renderer. */ var WebGLRenderer = new Class({ @@ -96843,7 +97259,7 @@ var WebGLRenderer = new Class({ }; /** - * [description] + * The local configuration settings of this WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#config * @type {RendererConfig} @@ -96863,7 +97279,7 @@ var WebGLRenderer = new Class({ }; /** - * [description] + * The Game instance which owns this WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#game * @type {Phaser.Game} @@ -96872,7 +97288,7 @@ var WebGLRenderer = new Class({ this.game = game; /** - * [description] + * A constant which allows the renderer to be easily identified as a WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#type * @type {integer} @@ -96881,7 +97297,7 @@ var WebGLRenderer = new Class({ this.type = CONST.WEBGL; /** - * [description] + * The width of a rendered frame. * * @name Phaser.Renderer.WebGL.WebGLRenderer#width * @type {number} @@ -96890,7 +97306,7 @@ var WebGLRenderer = new Class({ this.width = game.config.width; /** - * [description] + * The height of a rendered frame. * * @name Phaser.Renderer.WebGL.WebGLRenderer#height * @type {number} @@ -96899,7 +97315,7 @@ var WebGLRenderer = new Class({ this.height = game.config.height; /** - * [description] + * The canvas which this WebGL Renderer draws to. * * @name Phaser.Renderer.WebGL.WebGLRenderer#canvas * @type {HTMLCanvasElement} @@ -96908,7 +97324,7 @@ var WebGLRenderer = new Class({ this.canvas = game.canvas; /** - * [description] + * An array of functions to invoke if the WebGL context is lost. * * @name Phaser.Renderer.WebGL.WebGLRenderer#lostContextCallbacks * @type {WebGLContextCallback[]} @@ -96917,7 +97333,7 @@ var WebGLRenderer = new Class({ this.lostContextCallbacks = []; /** - * [description] + * An array of functions to invoke if the WebGL context is restored. * * @name Phaser.Renderer.WebGL.WebGLRenderer#restoredContextCallbacks * @type {WebGLContextCallback[]} @@ -96926,7 +97342,9 @@ var WebGLRenderer = new Class({ this.restoredContextCallbacks = []; /** - * [description] + * An array of blend modes supported by the WebGL Renderer. + * + * This array includes the default blend modes as well as any custom blend modes added through {@link #addBlendMode}. * * @name Phaser.Renderer.WebGL.WebGLRenderer#blendModes * @type {array} @@ -96946,7 +97364,7 @@ var WebGLRenderer = new Class({ this.nativeTextures = []; /** - * [description] + * Set to `true` if the WebGL context of the renderer is lost. * * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLost * @type {boolean} @@ -96966,7 +97384,9 @@ var WebGLRenderer = new Class({ this.pipelines = null; /** - * [description] + * Details about the currently scheduled snapshot. + * + * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. * * @name Phaser.Renderer.WebGL.WebGLRenderer#snapshotState * @type {SnapshotState} @@ -97114,7 +97534,7 @@ var WebGLRenderer = new Class({ // These are initialized post context creation /** - * [description] + * The underlying WebGL context of the renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#gl * @type {WebGLRenderingContext} @@ -97239,9 +97659,9 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#init * @since 3.0.0 * - * @param {object} config - [description] + * @param {object} config - The configuration object for the renderer. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ init: function (config) { @@ -97361,15 +97781,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Resizes the internal canvas and drawing buffer. * * @method Phaser.Renderer.WebGL.WebGLRenderer#resize * @since 3.0.0 * - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} width - The width of the renderer. + * @param {number} height - The height of the renderer. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ resize: function (width, height) { @@ -97401,19 +97821,21 @@ var WebGLRenderer = new Class({ this.defaultCamera.setSize(width, height); + gl.scissor(0, (this.drawingBufferHeight - this.height), this.width, this.height); + return this; }, /** - * [description] + * Adds a callback to be invoked when the WebGL context has been restored by the browser. * * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextRestored * @since 3.0.0 * - * @param {WebGLContextCallback} callback - [description] - * @param {object} target - [description] + * @param {WebGLContextCallback} callback - The callback to be invoked on context restoration. + * @param {object} target - The context of the callback. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ onContextRestored: function (callback, target) { @@ -97423,15 +97845,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Adds a callback to be invoked when the WebGL context has been lost by the browser. * * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextLost * @since 3.0.0 * - * @param {WebGLContextCallback} callback - [description] - * @param {object} target - [description] + * @param {WebGLContextCallback} callback - The callback to be invoked on context loss. + * @param {object} target - The context of the callback. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ onContextLost: function (callback, target) { @@ -97448,7 +97870,7 @@ var WebGLRenderer = new Class({ * * @param {string} extensionName - Name of the WebGL extension * - * @return {boolean} [description] + * @return {boolean} `true` if the extension is supported, otherwise `false`. */ hasExtension: function (extensionName) { @@ -97461,7 +97883,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#getExtension * @since 3.0.0 * - * @param {string} extensionName - [description] + * @param {string} extensionName - The name of the extension to load. * * @return {object} WebGL extension if the extension is supported */ @@ -97491,17 +97913,15 @@ var WebGLRenderer = new Class({ } }, - /* Renderer State Manipulation Functions */ - /** * Checks if a pipeline is present in the current WebGLRenderer * * @method Phaser.Renderer.WebGL.WebGLRenderer#hasPipeline * @since 3.0.0 * - * @param {string} pipelineName - Name of the pipeline + * @param {string} pipelineName - The name of the pipeline. * - * @return {boolean} [description] + * @return {boolean} `true` if the given pipeline is loaded, otherwise `false`. */ hasPipeline: function (pipelineName) { @@ -97514,9 +97934,9 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#getPipeline * @since 3.0.0 * - * @param {string} pipelineName - [description] + * @param {string} pipelineName - The name of the pipeline. * - * @return {Phaser.Renderer.WebGL.WebGLPipeline} [description] + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance, or `null` if not found. */ getPipeline: function (pipelineName) { @@ -97524,14 +97944,14 @@ var WebGLRenderer = new Class({ }, /** - * Removes a pipeline by name + * Removes a pipeline by name. * * @method Phaser.Renderer.WebGL.WebGLRenderer#removePipeline * @since 3.0.0 * - * @param {string} pipelineName - [description] + * @param {string} pipelineName - The name of the pipeline to be removed. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {this} This WebGLRenderer instance. */ removePipeline: function (pipelineName) { @@ -97546,10 +97966,10 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#addPipeline * @since 3.0.0 * - * @param {string} pipelineName - [description] - * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - Pipeline instance must extend WebGLPipeline + * @param {string} pipelineName - A unique string-based key for the pipeline. + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - A pipeline instance which must extend WebGLPipeline. * - * @return {Phaser.Renderer.WebGL.WebGLPipeline} The instance that was passed. + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipline instance that was passed. */ addPipeline: function (pipelineName, pipelineInstance) { @@ -97559,7 +97979,7 @@ var WebGLRenderer = new Class({ } else { - console.warn('Pipeline', pipelineName, ' already exists.'); + console.warn('Pipeline exists: ' + pipelineName); } pipelineInstance.name = pipelineName; @@ -97575,22 +97995,22 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#pushScissor * @since 3.0.0 * - * @param {integer} x - [description] - * @param {integer} y - [description] - * @param {integer} w - [description] - * @param {integer} h - [description] + * @param {integer} x - The x position of the scissor. + * @param {integer} y - The y position of the scissor. + * @param {integer} width - The width of the scissor. + * @param {integer} height - The height of the scissor. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {integer[]} An array containing the scissor values. */ - pushScissor: function (x, y, w, h) + pushScissor: function (x, y, width, height) { var scissorStack = this.scissorStack; - var scissor = [ x, y, w, h ]; + var scissor = [ x, y, width, height ]; scissorStack.push(scissor); - this.setScissor(x, y, w, h); + this.setScissor(x, y, width, height); this.currentScissor = scissor; @@ -97598,12 +98018,17 @@ var WebGLRenderer = new Class({ }, /** - * Sets the current scissor state + * Sets the current scissor state. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setScissor * @since 3.0.0 + * + * @param {integer} x - The x position of the scissor. + * @param {integer} y - The y position of the scissor. + * @param {integer} width - The width of the scissor. + * @param {integer} height - The height of the scissor. */ - setScissor: function (x, y, w, h) + setScissor: function (x, y, width, height) { var gl = this.gl; @@ -97614,15 +98039,16 @@ var WebGLRenderer = new Class({ var cw = current[2]; var ch = current[3]; - if (cx !== x || cy !== y || cw !== w || ch !== h) + if (cx !== x || cy !== y || cw !== width || ch !== height) { this.flush(); // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/scissor - if (w > 0 && h > 0) + if (width > 0 && height > 0) { - gl.scissor(x, (this.drawingBufferHeight - y - h), w, h); + gl.scissor(x, (this.drawingBufferHeight - y - height), width, height); + } } }, @@ -97721,15 +98147,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Creates a new custom blend mode for the renderer. * * @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode * @since 3.0.0 * - * @param {function} func - [description] - * @param {function} equation - [description] + * @param {function} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. + * @param {function} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. * - * @return {integer} [description] + * @return {integer} The index of the new blend mode, used for referencing it in the future. */ addBlendMode: function (func, equation) { @@ -97739,16 +98165,16 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Updates the function bound to a given custom blend mode. * * @method Phaser.Renderer.WebGL.WebGLRenderer#updateBlendMode * @since 3.0.0 * - * @param {integer} index - [description] - * @param {function} func - [description] - * @param {function} equation - [description] + * @param {integer} index - The index of the custom blend mode. + * @param {function} func - The function to use for the blend mode. + * @param {function} equation - The equation to use for the blend mode. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ updateBlendMode: function (index, func, equation) { @@ -97766,14 +98192,15 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Removes a custom blend mode from the renderer. + * Any Game Objects still using this blend mode will error, so be sure to clear them first. * * @method Phaser.Renderer.WebGL.WebGLRenderer#removeBlendMode * @since 3.0.0 * - * @param {integer} index - [description] + * @param {integer} index - The index of the custom blend mode to be removed. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ removeBlendMode: function (index) { @@ -97794,8 +98221,6 @@ var WebGLRenderer = new Class({ * @since 3.12.0 * * @param {boolean} [force=false] - Force a blank texture set, regardless of what's already bound? - * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. */ setBlankTexture: function (force) { @@ -97814,10 +98239,10 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setTexture2D * @since 3.0.0 * - * @param {WebGLTexture} texture - The WebGL texture that needs to be bound - * @param {integer} textureUnit - The texture unit to which the texture will be bound + * @param {WebGLTexture} texture - The WebGL texture that needs to be bound. + * @param {integer} textureUnit - The texture unit to which the texture will be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setTexture2D: function (texture, textureUnit) { @@ -97843,15 +98268,14 @@ var WebGLRenderer = new Class({ }, /** - * Binds a framebuffer. If there was another framebuffer already bound - * it will force a pipeline flush. + * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setFramebuffer * @since 3.0.0 * * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setFramebuffer: function (framebuffer) { @@ -97883,15 +98307,14 @@ var WebGLRenderer = new Class({ }, /** - * Binds a program. If there was another program already bound - * it will force a pipeline flush + * Binds a program. If there was another program already bound it will force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setProgram * @since 3.0.0 * - * @param {WebGLProgram} program - The program that needs to be bound + * @param {WebGLProgram} program - The program that needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setProgram: function (program) { @@ -97910,15 +98333,14 @@ var WebGLRenderer = new Class({ }, /** - * Bounds a vertex buffer. If there is a vertex buffer already bound - * it'll force a pipeline flush. + * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setVertexBuffer * @since 3.0.0 * - * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound + * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setVertexBuffer: function (vertexBuffer) { @@ -97937,15 +98359,14 @@ var WebGLRenderer = new Class({ }, /** - * Bounds a index buffer. If there is a index buffer already bound - * it'll force a pipeline flush. + * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setIndexBuffer * @since 3.0.0 * - * @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound + * @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ setIndexBuffer: function (indexBuffer) { @@ -97963,21 +98384,18 @@ var WebGLRenderer = new Class({ return this; }, - /* Renderer Resource Creation Functions */ - /** - * Creates a texture from an image source. If the source is not valid - * it creates an empty texture + * Creates a texture from an image source. If the source is not valid it creates an empty texture. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createTextureFromSource * @since 3.0.0 * - * @param {object} source - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] - * @param {integer} scaleMode - [description] + * @param {object} source - The source of the texture. + * @param {integer} width - The width of the texture. + * @param {integer} height - The height of the texture. + * @param {integer} scaleMode - The scale mode to be used by the texture. * - * @return {WebGLTexture} [description] + * @return {?WebGLTexture} The WebGL Texture that was created, or `null` if it couldn't be created. */ createTextureFromSource: function (source, width, height, scaleMode) { @@ -98012,24 +98430,23 @@ var WebGLRenderer = new Class({ }, /** - * A wrapper for creating a WebGLTexture. If not pixel data is passed - * it will create an empty texture. + * A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createTexture2D * @since 3.0.0 * - * @param {integer} mipLevel - Mip level of the texture - * @param {integer} minFilter - Filtering of the texture - * @param {integer} magFilter - Filtering of the texture - * @param {integer} wrapT - Wrapping mode of the texture - * @param {integer} wrapS - Wrapping mode of the texture - * @param {integer} format - Which format does the texture use - * @param {object} pixels - pixel data - * @param {integer} width - Width of the texture in pixels - * @param {integer} height - Height of the texture in pixels + * @param {integer} mipLevel - Mip level of the texture. + * @param {integer} minFilter - Filtering of the texture. + * @param {integer} magFilter - Filtering of the texture. + * @param {integer} wrapT - Wrapping mode of the texture. + * @param {integer} wrapS - Wrapping mode of the texture. + * @param {integer} format - Which format does the texture use. + * @param {object} pixels - pixel data. + * @param {integer} width - Width of the texture in pixels. + * @param {integer} height - Height of the texture in pixels. * @param {boolean} pma - Does the texture have premultiplied alpha? * - * @return {WebGLTexture} Raw WebGLTexture + * @return {WebGLTexture} The WebGLTexture that was created. */ createTexture2D: function (mipLevel, minFilter, magFilter, wrapT, wrapS, format, pixels, width, height, pma) { @@ -98199,8 +98616,8 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#createIndexBuffer * @since 3.0.0 * - * @param {ArrayBuffer} initialDataOrSize - It's either ArrayBuffer or an integer indicating the size of the vbo - * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW + * @param {ArrayBuffer} initialDataOrSize - Either ArrayBuffer or an integer indicating the size of the vbo. + * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. * * @return {WebGLBuffer} Raw index buffer */ @@ -98219,14 +98636,14 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Removes the given texture from the nativeTextures array and then deletes it from the GPU. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteTexture * @since 3.0.0 * - * @param {WebGLTexture} texture - [description] + * @param {WebGLTexture} texture - The WebGL Texture to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteTexture: function (texture) { @@ -98243,14 +98660,14 @@ var WebGLRenderer = new Class({ }, /** - * Wrapper for deleting a raw WebGLFramebuffer + * Deletes a WebGLFramebuffer from the GL instance. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteFramebuffer * @since 3.0.0 * - * @param {WebGLFramebuffer} framebuffer - [description] + * @param {WebGLFramebuffer} framebuffer - The Framebuffer to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteFramebuffer: function (framebuffer) { @@ -98260,14 +98677,14 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Deletes a WebGLProgram from the GL instance. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteProgram * @since 3.0.0 * - * @param {WebGLProgram} program - [description] + * @param {WebGLProgram} program - The shader program to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteProgram: function (program) { @@ -98277,14 +98694,14 @@ var WebGLRenderer = new Class({ }, /** - * Wrapper for deleting a vertex or index buffer + * Deletes a WebGLBuffer from the GL instance. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteBuffer * @since 3.0.0 * - * @param {WebGLBuffer} vertexBuffer - [description] + * @param {WebGLBuffer} vertexBuffer - The WebGLBuffer to be deleted. * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. + * @return {this} This WebGLRenderer instance. */ deleteBuffer: function (buffer) { @@ -98293,16 +98710,14 @@ var WebGLRenderer = new Class({ return this; }, - /* Rendering Functions */ - /** - * Handles any clipping needed by the camera and renders the background - * color if a color is visible. + * Controls the pre-render operations for the given camera. + * Handles any clipping needed by the camera and renders the background color if a color is visible. * * @method Phaser.Renderer.WebGL.WebGLRenderer#preRenderCamera * @since 3.0.0 * - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to pre-render. */ preRenderCamera: function (camera) { @@ -98342,30 +98757,29 @@ var WebGLRenderer = new Class({ camera.emit('prerender', camera); } - else if (color.alphaGL > 0) - { - this.pushScissor(cx, cy, cw, ch); - - TextureTintPipeline.drawFillRect( - cx, cy, cw , ch, - Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), - color.alphaGL - ); - } else { this.pushScissor(cx, cy, cw, ch); + + if (color.alphaGL > 0) + { + TextureTintPipeline.drawFillRect( + cx, cy, cw , ch, + Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), + color.alphaGL + ); + } } }, /** - * Renders the foreground camera effects like flash and fading. - * It resets the current scissor state. + * Controls the post-render operations for the given camera. + * Renders the foreground camera effects like flash and fading. It resets the current scissor state. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera * @since 3.0.0 * - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to post-render. */ postRenderCamera: function (camera) { @@ -98461,15 +98875,16 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * The core render step for a Scene. + * Iterates through the given Game Object's array and renders them with the given Camera. * * @method Phaser.Renderer.WebGL.WebGLRenderer#render * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] - * @param {Phaser.GameObjects.GameObject} children - [description] - * @param {number} interpolationPercentage - [description] - * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + * @param {Phaser.Scene} scene - The Scene to render. + * @param {Phaser.GameObjects.GameObject} children - The Game Object's within the Scene to be rendered. + * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently un-used. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. */ render: function (scene, children, interpolationPercentage, camera) { @@ -98524,7 +98939,7 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * The post-render step happens after all Cameras in all Scenes have been rendered. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRender * @since 3.0.0 @@ -98552,16 +98967,16 @@ var WebGLRenderer = new Class({ }, /** - * [description] + * Schedules a snapshot to be taken after the current frame is rendered. * * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshot * @since 3.0.0 * - * @param {SnapshotCallback} callback - [description] - * @param {string} type - [description] - * @param {number} encoderOptions - [description] + * @param {SnapshotCallback} callback - Function to invoke after the snapshot is created. + * @param {string} type - The format of the image to create, usually `image/png`. + * @param {number} encoderOptions - The image quality, between 0 and 1, to use for image formats with lossy compression (such as `image/jpeg`). * - * @return {Phaser.Renderer.WebGL.WebGLRenderer} [description] + * @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer. */ snapshot: function (callback, type, encoderOptions) { @@ -98587,11 +99002,6 @@ var WebGLRenderer = new Class({ { var gl = this.gl; - if (dstTexture) - { - this.deleteTexture(dstTexture); - } - var wrapping = gl.CLAMP_TO_EDGE; if (IsSizePowerOfTwo(srcCanvas.width, srcCanvas.height)) @@ -98599,17 +99009,24 @@ var WebGLRenderer = new Class({ wrapping = gl.REPEAT; } - return this.createTexture2D(0, gl.NEAREST, gl.NEAREST, wrapping, wrapping, gl.RGBA, srcCanvas, srcCanvas.width, srcCanvas.height, true); + var newTexture = this.createTexture2D(0, gl.NEAREST, gl.NEAREST, wrapping, wrapping, gl.RGBA, srcCanvas, srcCanvas.width, srcCanvas.height, true); + + if (newTexture && dstTexture) + { + this.deleteTexture(dstTexture); + } + + return newTexture; }, /** - * [description] + * Sets the minification and magnification filter for a texture. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureFilter * @since 3.0.0 * - * @param {integer} texture - [description] - * @param {integer} filter - [description] + * @param {integer} texture - The texture to set the filter for. + * @param {integer} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. * * @return {this} This WebGL Renderer instance. */ @@ -99128,9 +99545,9 @@ var CanvasSnapshot = __webpack_require__(425); var Class = __webpack_require__(0); var CONST = __webpack_require__(26); var GetBlendModes = __webpack_require__(424); -var ScaleModes = __webpack_require__(93); +var ScaleModes = __webpack_require__(94); var Smoothing = __webpack_require__(175); -var TransformMatrix = __webpack_require__(53); +var TransformMatrix = __webpack_require__(38); /** * @classdesc @@ -99668,8 +100085,8 @@ var CanvasRenderer = new Class({ var frameX = cd.x; var frameY = cd.y; - var frameWidth = frame.width; - var frameHeight = frame.height; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; var res = frame.source.resolution; var x = -sprite.displayOriginX + frame.x; @@ -99794,36 +100211,59 @@ var Class = __webpack_require__(0); /** * This event is dispatched when an animation starts playing. + * + * Listen for it on the Game Object: `sprite.on('animationstart', listener)` * * @event Phaser.GameObjects.Components.Animation#onStartEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. + */ + +/** + * This event is dispatched when an animation restarts. + * + * Listen for it on the Game Object: `sprite.on('animationrestart', listener)` + * + * @event Phaser.GameObjects.Components.Animation#onRestartEvent + * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. + * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** * This event is dispatched when an animation repeats. + * + * Listen for it on the Game Object: `sprite.on('animationrepeat', listener)` * * @event Phaser.GameObjects.Components.Animation#onRepeatEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. * @param {integer} repeatCount - The number of times this animation has repeated. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** * This event is dispatched when an animation updates. This happens when the animation frame changes, * based on the animation frame rate and other factors like timeScale and delay. + * + * Listen for it on the Game Object: `sprite.on('animationupdate', listener)` * * @event Phaser.GameObjects.Components.Animation#onUpdateEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** * This event is dispatched when an animation completes playing, either naturally or via Animation.stop. + * + * Listen for it on the Game Object: `sprite.on('animationcomplete', listener)` * * @event Phaser.GameObjects.Components.Animation#onCompleteEvent * @param {Phaser.Animations.Animation} animation - Reference to the currently playing animation. * @param {Phaser.Animations.AnimationFrame} frame - Reference to the current Animation Frame. + * @param {Phaser.GameObjects.Sprite} gameObject - Reference to the Game Object on which the event occurred. */ /** @@ -100361,7 +100801,7 @@ var Animation = new Class({ gameObject.visible = true; } - gameObject.emit('animationstart', this.currentAnim, this.currentFrame); + gameObject.emit('animationstart', this.currentAnim, this.currentFrame, gameObject); return gameObject; }, @@ -100526,6 +100966,7 @@ var Animation = new Class({ * Restarts the current animation from its beginning, optionally including its delay value. * * @method Phaser.GameObjects.Components.Animation#restart + * @fires Phaser.GameObjects.Components.Animation#onRestartEvent * @since 3.0.0 * * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting. @@ -100546,6 +100987,10 @@ var Animation = new Class({ // Set frame this.updateFrame(this.currentAnim.frames[0]); + var gameObject = this.parent; + + gameObject.emit('animationrestart', this.currentAnim, this.currentFrame, gameObject); + return this.parent; }, @@ -100566,7 +101011,7 @@ var Animation = new Class({ var gameObject = this.parent; - gameObject.emit('animationcomplete', this.currentAnim, this.currentFrame); + gameObject.emit('animationcomplete', this.currentAnim, this.currentFrame, gameObject); return gameObject; }, @@ -100726,6 +101171,11 @@ var Animation = new Class({ gameObject.texture = animationFrame.frame.texture; gameObject.frame = animationFrame.frame; + if (gameObject.isCropped) + { + gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY); + } + gameObject.setSizeToFrame(); if (animationFrame.frame.customPivot) @@ -100763,7 +101213,7 @@ var Animation = new Class({ var anim = this.currentAnim; - gameObject.emit('animationupdate', anim, animationFrame); + gameObject.emit('animationupdate', anim, animationFrame, gameObject); if (this._pendingStop === 3 && this._pendingStopValue === animationFrame) { @@ -101013,18 +101463,18 @@ var GetValue = __webpack_require__(4); var Clamp = __webpack_require__(23); /** - * [description] + * Retrieves and clamps a numerical value from an object. * * @function Phaser.Utils.Objects.GetMinMaxValue * @since 3.0.0 * - * @param {object} source - [description] - * @param {string} key - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} defaultValue - [description] + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`). + * @param {number} min - The minimum value which can be returned. + * @param {number} max - The maximum value which can be returned. + * @param {number} defaultValue - The value to return if the property doesn't exist. It's also constrained to the given bounds. * - * @return {number} [description] + * @return {number} The clamped value from the `source` object. */ var GetMinMaxValue = function (source, key, min, max, defaultValue) { @@ -101062,7 +101512,7 @@ module.exports = { GetValue: __webpack_require__(4), HasAll: __webpack_require__(432), HasAny: __webpack_require__(299), - HasValue: __webpack_require__(84), + HasValue: __webpack_require__(85), IsPlainObject: __webpack_require__(8), Merge: __webpack_require__(96), MergeRight: __webpack_require__(431) @@ -101107,7 +101557,7 @@ var Class = __webpack_require__(0); var NumberTweenBuilder = __webpack_require__(204); var PluginCache = __webpack_require__(15); var TimelineBuilder = __webpack_require__(203); -var TWEEN_CONST = __webpack_require__(82); +var TWEEN_CONST = __webpack_require__(83); var TweenBuilder = __webpack_require__(97); /** @@ -101874,8 +102324,8 @@ module.exports = [ module.exports = { - GetBoolean: __webpack_require__(83), - GetEaseFunction: __webpack_require__(85), + GetBoolean: __webpack_require__(84), + GetEaseFunction: __webpack_require__(86), GetNewValue: __webpack_require__(98), GetProps: __webpack_require__(206), GetTargets: __webpack_require__(130), @@ -101898,7 +102348,7 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CONST = __webpack_require__(82); +var CONST = __webpack_require__(83); var Extend = __webpack_require__(20); /** @@ -102531,31 +102981,61 @@ var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPer camMatrix.multiply(layerMatrix, calcMatrix); } - var tileset = src.tileset; var ctx = renderer.currentContext; - var image = tileset.image.getSourceImage(); + var gidMap = src.gidMap; ctx.save(); calcMatrix.copyToContext(ctx); + var alpha = camera.alpha * src.alpha; + ctx.globalAlpha = camera.alpha * src.alpha; for (var i = 0; i < tileCount; i++) { var tile = renderTiles[i]; + var tileset = gidMap[tile.index]; + + if (!tileset) + { + continue; + } + + var image = tileset.image.getSourceImage(); var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); if (tileTexCoords) { + var halfWidth = tile.width / 2; + var halfHeight = tile.height / 2; + + ctx.save(); + + ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); + + if (tile.rotation !== 0) + { + ctx.rotate(tile.rotation); + } + + if (tile.flipX || tile.flipY) + { + ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); + } + + ctx.globalAlpha = alpha * tile.alpha; + ctx.drawImage( image, tileTexCoords.x, tileTexCoords.y, tile.width, tile.height, - tile.pixelX, tile.pixelY, + -halfWidth, -halfHeight, tile.width, tile.height ); + + ctx.restore(); } } @@ -102594,33 +103074,44 @@ module.exports = StaticTilemapLayerCanvasRenderer; */ var StaticTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera) { - src.upload(camera); + var tilesets = src.tileset; - if (src.vertexCount > 0) + var pipeline = src.pipeline; + var pipelineVertexBuffer = pipeline.vertexBuffer; + + renderer.setPipeline(pipeline); + + pipeline.modelIdentity(); + pipeline.modelTranslate(src.x - (camera.scrollX * src.scrollFactorX), src.y - (camera.scrollY * src.scrollFactorY), 0); + pipeline.modelScale(src.scaleX, src.scaleY, 1); + pipeline.viewLoad2D(camera.matrix.matrix); + + for (var i = 0; i < tilesets.length; i++) { - var gl = renderer.gl; - var pipeline = this.pipeline; - var pipelineVertexBuffer = pipeline.vertexBuffer; - var texture = src.tileset.glTexture; - - if (renderer.currentPipeline && renderer.currentPipeline.vertexCount > 0) + src.upload(camera, i); + + if (src.vertexCount[i] > 0) { - renderer.flush(); + if (renderer.currentPipeline && renderer.currentPipeline.vertexCount > 0) + { + renderer.flush(); + } + + pipeline.vertexBuffer = src.vertexBuffer[i]; + + renderer.setPipeline(pipeline); + + renderer.setTexture2D(tilesets[i].glTexture, 0); + + renderer.gl.drawArrays(pipeline.topology, 0, src.vertexCount[i]); } - - pipeline.vertexBuffer = src.vertexBuffer; - - renderer.setPipeline(pipeline); - - renderer.setTexture2D(texture, 0); - - gl.drawArrays(pipeline.topology, 0, src.vertexCount); - - pipeline.vertexBuffer = pipelineVertexBuffer; - - pipeline.viewIdentity(); - pipeline.modelIdentity(); } + + // Restore the pipeline + pipeline.vertexBuffer = pipelineVertexBuffer; + + pipeline.viewIdentity(); + pipeline.modelIdentity(); }; module.exports = StaticTilemapLayerWebGLRenderer; @@ -102723,9 +103214,8 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe camMatrix.multiply(layerMatrix, calcMatrix); } - var tileset = src.tileset; var ctx = renderer.currentContext; - var image = tileset.image.getSourceImage(); + var gidMap = src.gidMap; ctx.save(); @@ -102737,6 +103227,14 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe { var tile = renderTiles[i]; + var tileset = gidMap[tile.index]; + + if (!tileset) + { + continue; + } + + var image = tileset.image.getSourceImage(); var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); if (tileTexCoords) @@ -102817,13 +103315,11 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer return; } - var pipeline = this.pipeline; + var gidMap = src.gidMap; + var pipeline = src.pipeline; var getTint = Utils.getTintAppendFloatAlpha; - var tileset = src.tileset; - var texture = tileset.glTexture; - var scrollFactorX = src.scrollFactorX; var scrollFactorY = src.scrollFactorY; @@ -102833,45 +103329,64 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer var sx = src.scaleX; var sy = src.scaleY; - for (var i = 0; i < tileCount; i++) + var tilesets = src.tileset; + + // Loop through each tileset in this layer, drawing just the tiles that are in that set each time + // Doing it this way around allows us to batch tiles using the same tileset + for (var c = 0; c < tilesets.length; c++) { - var tile = renderTiles[i]; + var currentSet = tilesets[c]; + var texture = currentSet.glTexture; - var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); - - if (tileTexCoords === null) + for (var i = 0; i < tileCount; i++) { - continue; + var tile = renderTiles[i]; + + var tileset = gidMap[tile.index]; + + if (tileset !== currentSet) + { + // Skip tiles that aren't in this set + continue; + } + + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + + if (tileTexCoords === null) + { + continue; + } + + var frameWidth = tile.width; + var frameHeight = tile.height; + + var frameX = tileTexCoords.x; + var frameY = tileTexCoords.y; + + var tw = tile.width * 0.5; + var th = tile.height * 0.5; + + var tint = getTint(tile.tint, alpha * tile.alpha); + + pipeline.batchTexture( + src, + texture, + texture.width, texture.height, + (tw + x + tile.pixelX) * sx, (th + y + tile.pixelY) * sy, + tile.width, tile.height, + sx, sy, + tile.rotation, + tile.flipX, tile.flipY, + scrollFactorX, scrollFactorY, + tw, th, + frameX, frameY, frameWidth, frameHeight, + tint, tint, tint, tint, false, + 0, 0, + camera, + null, + true + ); } - - var frameWidth = tile.width; - var frameHeight = tile.height; - - var frameX = tileTexCoords.x; - var frameY = tileTexCoords.y; - - var tw = tile.width * 0.5; - var th = tile.height * 0.5; - - var tint = getTint(tile.tint, alpha * tile.alpha); - - pipeline.batchTexture( - src, - texture, - texture.width, texture.height, - tw + x + tile.pixelX * sx, th + y + tile.pixelY * sy, - tile.width * sx, tile.height * sy, - 1, 1, - tile.rotation, - tile.flipX, tile.flipY, - scrollFactorX, scrollFactorY, - tw, th, - frameX, frameY, frameWidth, frameHeight, - tint, tint, tint, tint, false, - 0, 0, - camera, - null - ); } }; @@ -102970,7 +103485,7 @@ module.exports = ParseTilesets; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var LayerData = __webpack_require__(77); +var LayerData = __webpack_require__(78); var Tile = __webpack_require__(55); /** @@ -103259,7 +103774,7 @@ module.exports = ParseObjectLayers; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var HasValue = __webpack_require__(84); +var HasValue = __webpack_require__(85); /** * [description] @@ -103336,27 +103851,78 @@ var ParseTilesets = function (json) { var newSet = new Tileset(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing); - // Properties stored per-tile in object with string indexes starting at "0" - if (set.tileproperties) + if (json.version > 1) { - newSet.tileProperties = set.tileproperties; - } + // Tiled 1.2+ - // Object & terrain shapes stored per-tile in object with string indexes starting at "0" - if (set.tiles) - { - newSet.tileData = set.tiles; - - // Parse the objects into Phaser format to match handling of other Tiled objects - for (stringID in newSet.tileData) + if (Array.isArray(set.tiles)) { - var objectGroup = newSet.tileData[stringID].objectgroup; - if (objectGroup && objectGroup.objects) + var tiles = {}; + var props = {}; + + for (var t = 0; t < set.tiles.length; t++) { - var parsedObjects = objectGroup.objects.map( - function (obj) { return ParseObject(obj); } - ); - newSet.tileData[stringID].objectgroup.objects = parsedObjects; + var tile = set.tiles[t]; + + // Convert tileproperties + if (tile.properties) + { + var newPropData = {}; + + tile.properties.forEach(function (propData) + { + newPropData[propData['name']] = propData['value']; + }); + + props[tile.id] = newPropData; + } + + // Convert objectgroup + if (tile.objectgroup) + { + tiles[tile.id] = { objectgroup: tile.objectgroup }; + + if (tile.objectgroup.objects) + { + var parsedObjects2 = tile.objectgroup.objects.map( + function (obj) { return ParseObject(obj); } + ); + + tiles[tile.id].objectgroup.objects = parsedObjects2; + } + } + } + + newSet.tileData = tiles; + newSet.tileProperties = props; + } + } + else + { + // Tiled 1 + + // Properties stored per-tile in object with string indexes starting at "0" + if (set.tileproperties) + { + newSet.tileProperties = set.tileproperties; + } + + // Object & terrain shapes stored per-tile in object with string indexes starting at "0" + if (set.tiles) + { + newSet.tileData = set.tiles; + + // Parse the objects into Phaser format to match handling of other Tiled objects + for (stringID in newSet.tileData) + { + var objectGroup = newSet.tileData[stringID].objectgroup; + if (objectGroup && objectGroup.objects) + { + var parsedObjects1 = objectGroup.objects.map( + function (obj) { return ParseObject(obj); } + ); + newSet.tileData[stringID].objectgroup.objects = parsedObjects1; + } } } } @@ -103460,14 +104026,14 @@ module.exports = ParseImageLayers; */ /** - * [description] + * Decode base-64 encoded data, for example as exported by Tiled. * * @function Phaser.Tilemaps.Parsers.Tiled.Base64Decode * @since 3.0.0 * - * @param {object} data - [description] + * @param {object} data - Base-64 encoded data to decode. * - * @return {array} [description] + * @return {array} Array containing the decoded bytes. */ var Base64Decode = function (data) { @@ -103504,7 +104070,7 @@ module.exports = Base64Decode; var Base64Decode = __webpack_require__(458); var GetFastValue = __webpack_require__(2); -var LayerData = __webpack_require__(77); +var LayerData = __webpack_require__(78); var ParseGID = __webpack_require__(215); var Tile = __webpack_require__(55); @@ -103654,8 +104220,8 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); var Vector2 = __webpack_require__(3); /** @@ -103667,12 +104233,11 @@ var Vector2 = __webpack_require__(3); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Math.Vector2} The XY location in tile units. @@ -103721,10 +104286,10 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. @@ -103793,10 +104358,10 @@ var Vector2 = __webpack_require__(3); * @private * @since 3.0.0 * - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {Phaser.Math.Vector2} [point] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Math.Vector2} The XY location in world coordinates. @@ -103837,10 +104402,10 @@ var GetTilesWithin = __webpack_require__(17); * * @param {integer} tileA - First tile index. * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SwapByIndex = function (indexA, indexB, tileX, tileY, width, height, layer) @@ -103888,10 +104453,10 @@ var ShuffleArray = __webpack_require__(121); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Shuffle = function (tileX, tileY, width, height, layer) @@ -103931,10 +104496,10 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -103973,8 +104538,7 @@ module.exports = SetTileLocationCallback; * @private * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a - * collision callback set for. + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -104024,10 +104588,8 @@ var CalculateFacesWithin = __webpack_require__(34); * @private * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer) @@ -104054,7 +104616,10 @@ var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionFromCollisionGroup; @@ -104072,7 +104637,7 @@ module.exports = SetCollisionFromCollisionGroup; var SetTileCollision = __webpack_require__(56); var CalculateFacesWithin = __webpack_require__(34); -var HasValue = __webpack_require__(84); +var HasValue = __webpack_require__(85); /** * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property @@ -104087,12 +104652,9 @@ var HasValue = __webpack_require__(84); * @private * @since 3.0.0 * - * @param {object} properties - An object with tile properties and corresponding values that should - * be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByProperty = function (properties, collides, recalculateFaces, layer) @@ -104129,7 +104691,10 @@ var SetCollisionByProperty = function (properties, collides, recalculateFaces, l } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionByProperty; @@ -104159,10 +104724,8 @@ var SetLayerCollisionIndex = __webpack_require__(133); * @since 3.0.0 * * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, layer) @@ -104185,7 +104748,10 @@ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, lay } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionByExclusion; @@ -104217,10 +104783,8 @@ var SetLayerCollisionIndex = __webpack_require__(133); * * @param {integer} start - The first index of the tile to be set for collision. * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, layer) @@ -104252,7 +104816,10 @@ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, lay } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollisionBetween; @@ -104282,10 +104849,8 @@ var SetLayerCollisionIndex = __webpack_require__(133); * @since 3.0.0 * * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollision = function (indexes, collides, recalculateFaces, layer) @@ -104314,7 +104879,10 @@ var SetCollision = function (indexes, collides, recalculateFaces, layer) } } - if (recalculateFaces) { CalculateFacesWithin(0, 0, layer.width, layer.height, layer); } + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } }; module.exports = SetCollision; @@ -104333,6 +104901,10 @@ module.exports = SetCollision; var GetTilesWithin = __webpack_require__(17); var Color = __webpack_require__(348); +var defaultTileColor = new Color(105, 210, 231, 150); +var defaultCollidingTileColor = new Color(243, 134, 48, 200); +var defaultFaceColor = new Color(40, 39, 37, 150); + /** * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles @@ -104358,18 +104930,15 @@ var RenderDebug = function (graphics, styleConfig, layer) if (styleConfig === undefined) { styleConfig = {}; } // Default colors without needlessly creating Color objects - var tileColor = styleConfig.tileColor !== undefined - ? styleConfig.tileColor - : new Color(105, 210, 231, 150); - var collidingTileColor = styleConfig.collidingTileColor !== undefined - ? styleConfig.collidingTileColor - : new Color(243, 134, 48, 200); - var faceColor = styleConfig.faceColor !== undefined - ? styleConfig.faceColor - : new Color(40, 39, 37, 150); + var tileColor = (styleConfig.tileColor !== undefined) ? styleConfig.tileColor : defaultTileColor; + var collidingTileColor = (styleConfig.collidingTileColor !== undefined) ? styleConfig.collidingTileColor : defaultCollidingTileColor; + var faceColor = (styleConfig.faceColor !== undefined) ? styleConfig.faceColor : defaultFaceColor; var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); + graphics.translate(layer.tilemapLayer.x, layer.tilemapLayer.y); + graphics.scale(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); + for (var i = 0; i < tiles.length; i++) { var tile = tiles[i]; @@ -104380,6 +104949,7 @@ var RenderDebug = function (graphics, styleConfig, layer) var y = tile.pixelY; var color = tile.collides ? collidingTileColor : tileColor; + if (color !== null) { graphics.fillStyle(color.color, color.alpha / 255); @@ -104395,6 +104965,7 @@ var RenderDebug = function (graphics, styleConfig, layer) if (faceColor !== null) { graphics.lineStyle(1, faceColor.color, faceColor.alpha / 255); + if (tile.faceTop) { graphics.lineBetween(x, y, x + tw, y); } if (tile.faceRight) { graphics.lineBetween(x + tw, y, x + tw, y + th); } if (tile.faceBottom) { graphics.lineBetween(x, y + th, x + tw, y + th); } @@ -104417,8 +104988,8 @@ module.exports = RenderDebug; */ var RemoveTileAt = __webpack_require__(219); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's @@ -104428,12 +104999,11 @@ var WorldToTileY = __webpack_require__(48); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified - * location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. @@ -104472,10 +105042,10 @@ var GetRandom = __webpack_require__(161); * @private * @since 3.0.0 * - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ @@ -104530,11 +105100,10 @@ var PutTileAt = __webpack_require__(134); * @private * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles - * or tile indexes to place. - * @param {integer} tileX - [description] - * @param {integer} tileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var PutTilesAt = function (tilesArray, tileX, tileY, recalculateFaces, layer) @@ -104582,8 +105151,8 @@ module.exports = PutTilesAt; */ var PutTileAt = __webpack_require__(134); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -104596,10 +105165,10 @@ var WorldToTileY = __webpack_require__(48); * @since 3.0.0 * * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} worldX - [description] - * @param {integer} worldY - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. @@ -104625,8 +105194,8 @@ module.exports = PutTileAtWorldXY; */ var HasTileAt = __webpack_require__(220); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns @@ -104636,12 +105205,12 @@ var WorldToTileY = __webpack_require__(48); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {number} worldX - The X coordinate of the world position. + * @param {number} worldY - The Y coordinate of the world position. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {boolean} + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ var HasTileAtWorldXY = function (worldX, worldY, camera, layer) { @@ -104665,8 +105234,8 @@ module.exports = HasTileAtWorldXY; */ var GetTilesWithin = __webpack_require__(17); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. @@ -104675,18 +105244,15 @@ var WorldToTileY = __webpack_require__(48); * @private * @since 3.0.0 * - * @param {number} worldX - [description] - * @param {number} worldY - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -104723,8 +105289,8 @@ var Intersects = __webpack_require__(274); var NOOP = __webpack_require__(1); var TileToWorldX = __webpack_require__(101); var TileToWorldY = __webpack_require__(100); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); var TriangleToRectangle = function (triangle, rect) { @@ -104744,13 +105310,10 @@ var TriangleToRectangle = function (triangle, rect) * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on - * at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -104818,8 +105381,8 @@ module.exports = GetTilesWithinShape; */ var GetTileAt = __webpack_require__(102); -var WorldToTileX = __webpack_require__(49); -var WorldToTileY = __webpack_require__(48); +var WorldToTileX = __webpack_require__(50); +var WorldToTileY = __webpack_require__(49); /** * Gets a tile at the given world coordinates from the given layer. @@ -104830,9 +105393,8 @@ var WorldToTileY = __webpack_require__(48); * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description] + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates @@ -104864,9 +105426,9 @@ var GetTilesWithin = __webpack_require__(17); /** * @callback EachTileCallback * - * @param {Phaser.Tilemaps.Tile} value - [description] - * @param {number} index - [description] - * @param {Phaser.Tilemaps.Tile[]} array - [description] + * @param {Phaser.Tilemaps.Tile} value - The Tile. + * @param {integer} index - The index of the tile. + * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. */ /** @@ -104877,25 +105439,22 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ForEachTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + tiles.forEach(callback, context); }; @@ -104917,11 +105476,11 @@ var GetTilesWithin = __webpack_require__(17); /** * @callback FindTileCallback * - * @param {Phaser.Tilemaps.Tile} value - [description] - * @param {number} index - [description] - * @param {Phaser.Tilemaps.Tile[]} array - [description] + * @param {Phaser.Tilemaps.Tile} value - The Tile. + * @param {integer} index - The index of the tile. + * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. * - * @return {boolean} [description] + * @return {boolean} Return `true` if the callback should run, otherwise `false`. */ /** @@ -104933,20 +105492,16 @@ var GetTilesWithin = __webpack_require__(17); * @private * @since 3.0.0 * - * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?Phaser.Tilemaps.Tile} A Tile that matches the search, or null if no Tile found @@ -105073,17 +105628,14 @@ var GetTilesWithin = __webpack_require__(17); * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have - * -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide - * on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that - * have at least one interesting face. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} The filtered array of Tiles. @@ -105091,6 +105643,7 @@ var GetTilesWithin = __webpack_require__(17); var FilterTiles = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + return tiles.filter(callback, context); }; @@ -105121,21 +105674,20 @@ var SetTileCollision = __webpack_require__(56); * @private * @since 3.0.0 * - * @param {integer} index - [description] - * @param {integer} [tileX=0] - [description] - * @param {integer} [tileY=0] - [description] - * @param {integer} [width=max width based on tileX] - [description] - * @param {integer} [height=max height based on tileY] - [description] - * @param {boolean} [recalculateFaces=true] - [description] - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {integer} index - The tile index to fill the area with. + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} layer - The tile layer to use. If not given the current layer is used. */ var Fill = function (index, tileX, tileY, width, height, recalculateFaces, layer) { - if (recalculateFaces === undefined) { recalculateFaces = true; } - var doesIndexCollide = (layer.collideIndexes.indexOf(index) !== -1); var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + for (var i = 0; i < tiles.length; i++) { tiles[i].index = index; @@ -105175,7 +105727,7 @@ var SnapCeil = __webpack_require__(244); * * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. - * @param {array} [outputArray] - [description] + * @param {array} [outputArray] - An optional array to store the Tile objects within. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -105336,11 +105888,8 @@ var ReplaceByIndex = __webpack_require__(221); * @since 3.0.0 * * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted - * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a - * one-to-one mapping with the indexes array. - * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. + * @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -105420,13 +105969,13 @@ var CalculateFacesWithin = __webpack_require__(34); * @private * @since 3.0.0 * - * @param {integer} srcTileX - [description] - * @param {integer} srcTileY - [description] - * @param {integer} width - [description] - * @param {integer} height - [description] - * @param {integer} destTileX - [description] - * @param {integer} destTileY - [description] - * @param {boolean} [recalculateFaces=true] - [description] + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Copy = function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer) @@ -105491,8 +106040,8 @@ module.exports = { TilemapFactory: __webpack_require__(442), Tileset: __webpack_require__(99), - LayerData: __webpack_require__(77), - MapData: __webpack_require__(76), + LayerData: __webpack_require__(78), + MapData: __webpack_require__(77), ObjectLayer: __webpack_require__(212), DynamicTilemapLayer: __webpack_require__(209), @@ -107340,10 +107889,10 @@ Matter.Bodies = __webpack_require__(125); Matter.Composites = __webpack_require__(1067); Matter.Axes = __webpack_require__(505); -Matter.Bounds = __webpack_require__(79); +Matter.Bounds = __webpack_require__(80); Matter.Svg = __webpack_require__(1086); -Matter.Vector = __webpack_require__(80); -Matter.Vertices = __webpack_require__(94); +Matter.Vector = __webpack_require__(81); +Matter.Vertices = __webpack_require__(76); // aliases @@ -107373,8 +107922,8 @@ var SAT = {}; module.exports = SAT; -var Vertices = __webpack_require__(94); -var Vector = __webpack_require__(80); +var Vertices = __webpack_require__(76); +var Vector = __webpack_require__(81); (function() { @@ -107651,7 +108200,7 @@ module.exports = Detector; var SAT = __webpack_require__(502); var Pair = __webpack_require__(419); -var Bounds = __webpack_require__(79); +var Bounds = __webpack_require__(80); (function() { @@ -107761,8 +108310,8 @@ var Body = __webpack_require__(67); var Class = __webpack_require__(0); var Components = __webpack_require__(420); var GetFastValue = __webpack_require__(2); -var HasValue = __webpack_require__(84); -var Vertices = __webpack_require__(94); +var HasValue = __webpack_require__(85); +var Vertices = __webpack_require__(76); /** * @classdesc @@ -108086,7 +108635,7 @@ var Axes = {}; module.exports = Axes; -var Vector = __webpack_require__(80); +var Vector = __webpack_require__(81); var Common = __webpack_require__(33); (function() { @@ -108850,7 +109399,8 @@ module.exports = Velocity; */ /** - * [description] + * Provides methods for setting the size of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. * * @name Phaser.Physics.Arcade.Components.Size * @since 3.0.0 @@ -108858,13 +109408,14 @@ module.exports = Velocity; var Size = { /** - * [description] + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. * * @method Phaser.Physics.Arcade.Components.Size#setOffset * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The amount to offset the body from the parent Game Object along the x-axis. + * @param {number} [y=x] - The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. * * @return {this} This Game Object. */ @@ -108876,14 +109427,15 @@ var Size = { }, /** - * [description] + * Sets the size of this physics body. Setting the size does not adjust the dimensions + * of the parent Game Object. * * @method Phaser.Physics.Arcade.Components.Size#setSize * @since 3.0.0 * - * @param {number} width - [description] - * @param {number} height - [description] - * @param {boolean} [center=true] - [description] + * @param {number} width - The new width of the physics body, in pixels. + * @param {number} height - The new height of the physics body, in pixels. + * @param {boolean} [center=true] - Should the body be re-positioned so its center aligns with the parent Game Object? * * @return {this} This Game Object. */ @@ -108895,14 +109447,14 @@ var Size = { }, /** - * [description] + * Sets this physics body to use a circle for collision instead of a rectangle. * * @method Phaser.Physics.Arcade.Components.Size#setCircle * @since 3.0.0 * - * @param {number} radius - [description] - * @param {number} [offsetX] - [description] - * @param {number} [offsetY] - [description] + * @param {number} radius - The radius of the physics body, in pixels. + * @param {number} [offsetX] - The amount to offset the body from the parent Game Object along the x-axis. + * @param {number} [offsetY] - The amount to offset the body from the parent Game Object along the y-axis. * * @return {this} This Game Object. */ @@ -109011,7 +109563,8 @@ module.exports = Immovable; */ /** - * [description] + * Provides methods for setting the gravity properties of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. * * @name Phaser.Physics.Arcade.Components.Gravity * @since 3.0.0 @@ -109019,13 +109572,15 @@ module.exports = Immovable; var Gravity = { /** - * [description] + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The gravitational force to be applied to the X-axis. + * @param {number} [y=x] - The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. * * @return {this} This Game Object. */ @@ -109037,12 +109592,12 @@ var Gravity = { }, /** - * [description] + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravityX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The gravitational force to be applied to the X-axis. * * @return {this} This Game Object. */ @@ -109054,12 +109609,12 @@ var Gravity = { }, /** - * [description] + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. * * @method Phaser.Physics.Arcade.Components.Gravity#setGravityY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} y - The gravitational force to be applied to the Y-axis. * * @return {this} This Game Object. */ @@ -109086,7 +109641,7 @@ module.exports = Gravity; */ /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. The higher than friction, the faster the body will slow down once force stops being applied to it. * * @name Phaser.Physics.Arcade.Components.Friction * @since 3.0.0 @@ -109094,13 +109649,14 @@ module.exports = Gravity; var Friction = { /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. * * @method Phaser.Physics.Arcade.Components.Friction#setFriction * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The amount of horizontal friction to apply. + * @param {number} [y=x] - The amount of vertical friction to apply. * * @return {this} This Game Object. */ @@ -109112,12 +109668,13 @@ var Friction = { }, /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. * * @method Phaser.Physics.Arcade.Components.Friction#setFrictionX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The amount of friction to apply. * * @return {this} This Game Object. */ @@ -109129,12 +109686,13 @@ var Friction = { }, /** - * [description] + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. * * @method Phaser.Physics.Arcade.Components.Friction#setFrictionY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} x - The amount of friction to apply. * * @return {this} This Game Object. */ @@ -109169,18 +109727,25 @@ module.exports = Friction; var Enable = { /** - * [description] + * Enables this Game Object's Body. * * @method Phaser.Physics.Arcade.Components.Enable#enableBody * @since 3.0.0 * - * @param {boolean} reset - [description] - * @param {number} x - [description] - * @param {number} y - [description] - * @param {boolean} enableGameObject - [description] - * @param {boolean} showGameObject - [description] + * @param {boolean} reset - Also reset the Body and place it at (x, y). + * @param {number} x - The horizontal position to place the Game Object and Body. + * @param {number} y - The horizontal position to place the Game Object and Body. + * @param {boolean} enableGameObject - Also activate this Game Object. + * @param {boolean} showGameObject - Also show this Game Object. * * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.Body#enable + * @see Phaser.Physics.Arcade.StaticBody#enable + * @see Phaser.Physics.Arcade.Body#reset + * @see Phaser.Physics.Arcade.StaticBody#reset + * @see Phaser.GameObjects.GameObject#active + * @see Phaser.GameObjects.GameObject#visible */ enableBody: function (reset, x, y, enableGameObject, showGameObject) { @@ -109205,15 +109770,20 @@ var Enable = { }, /** - * [description] + * Stops and disables this Game Object's Body. * * @method Phaser.Physics.Arcade.Components.Enable#disableBody * @since 3.0.0 * - * @param {boolean} [disableGameObject=false] - [description] - * @param {boolean} [hideGameObject=false] - [description] + * @param {boolean} [disableGameObject=false] - Also deactivate this Game Object. + * @param {boolean} [hideGameObject=false] - Also hide this Game Object. * * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.Body#enable + * @see Phaser.Physics.Arcade.StaticBody#enable + * @see Phaser.GameObjects.GameObject#active + * @see Phaser.GameObjects.GameObject#visible */ disableBody: function (disableGameObject, hideGameObject) { @@ -109238,7 +109808,7 @@ var Enable = { }, /** - * Syncs the Bodies position and size with its parent Game Object. + * Syncs the Body's position and size with its parent Game Object. * You don't need to call this for Dynamic Bodies, as it happens automatically. * But for Static bodies it's a useful way of modifying the position of a Static Body * in the Physics World, based on its Game Object. @@ -109247,6 +109817,8 @@ var Enable = { * @since 3.1.0 * * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject */ refreshBody: function () { @@ -109653,7 +110225,7 @@ module.exports = Angular; */ /** - * [description] + * Provides methods used for setting the acceleration properties of an Arcade Body. * * @name Phaser.Physics.Arcade.Components.Acceleration * @since 3.0.0 @@ -109661,7 +110233,7 @@ module.exports = Angular; var Acceleration = { /** - * [description] + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. * * @method Phaser.Physics.Arcade.Components.Acceleration#setAcceleration * @since 3.0.0 @@ -109679,7 +110251,7 @@ var Acceleration = { }, /** - * [description] + * Sets the body's horizontal acceleration. * * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationX * @since 3.0.0 @@ -109696,7 +110268,7 @@ var Acceleration = { }, /** - * [description] + * Sets the body's vertical acceleration. * * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationY * @since 3.0.0 @@ -109729,7 +110301,7 @@ module.exports = Acceleration; var Class = __webpack_require__(0); var DegToRad = __webpack_require__(31); -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); var DistanceSquared = __webpack_require__(250); var Factory = __webpack_require__(239); var GetFastValue = __webpack_require__(2); @@ -109738,18 +110310,19 @@ var PluginCache = __webpack_require__(15); var Vector2 = __webpack_require__(3); var World = __webpack_require__(234); -// All methods in this class are available under `this.physics` in a Scene. - /** * @classdesc - * [description] + * The Arcade Physics Plugin belongs to a Scene and sets up and manages the Scene's physics simulation. + * It also holds some useful methods for moving and rotating Arcade Physics Bodies. + * + * You can access it from within a Scene using `this.physics`. * * @class ArcadePhysics * @memberOf Phaser.Physics.Arcade * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene that this Plugin belongs to. */ var ArcadePhysics = new Class({ @@ -109758,7 +110331,7 @@ var ArcadePhysics = new Class({ function ArcadePhysics (scene) { /** - * [description] + * The Scene that this Plugin belongs to. * * @name Phaser.Physics.Arcade.ArcadePhysics#scene * @type {Phaser.Scene} @@ -109767,7 +110340,7 @@ var ArcadePhysics = new Class({ this.scene = scene; /** - * [description] + * The Scene's Systems. * * @name Phaser.Physics.Arcade.ArcadePhysics#systems * @type {Phaser.Scenes.Systems} @@ -109776,7 +110349,7 @@ var ArcadePhysics = new Class({ this.systems = scene.sys; /** - * [description] + * A configuration object. Union of the `physics.arcade.*` properties of the GameConfig and SceneConfig objects. * * @name Phaser.Physics.Arcade.ArcadePhysics#config * @type {object} @@ -109785,7 +110358,7 @@ var ArcadePhysics = new Class({ this.config = this.getConfig(); /** - * [description] + * The physics simulation. * * @name Phaser.Physics.Arcade.ArcadePhysics#world * @type {Phaser.Physics.Arcade.World} @@ -109794,7 +110367,7 @@ var ArcadePhysics = new Class({ this.world; /** - * [description] + * An object holding the Arcade Physics factory methods. * * @name Phaser.Physics.Arcade.ArcadePhysics#add * @type {Phaser.Physics.Arcade.Factory} @@ -109847,12 +110420,12 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Creates the physics configuration for the current Scene. * * @method Phaser.Physics.Arcade.ArcadePhysics#getConfig * @since 3.0.0 * - * @return {object} [description] + * @return {object} The physics configuration. */ getConfig: function () { @@ -109868,31 +110441,20 @@ var ArcadePhysics = new Class({ }, /** - * Checks for overlaps between two Game Objects. The objects can be any Game Object that have an Arcade Physics Body. - * - * Unlike {@link #collide} the objects are NOT automatically separated or have any physics applied, they merely test for overlap results. - * - * Both the first and second parameter can be arrays of objects, of differing types. - * If two arrays are passed, the contents of the first parameter will be tested against all contents of the 2nd parameter. - * - * ##### Tilemaps - * - * Any overlapping tiles, including blank/null tiles, will give a positive result. Tiles marked via {@link Phaser.Tilemap#setCollision} (and similar methods) have no special status, and callbacks added via {@link Phaser.Tilemap#setTileIndexCallback} or {@link Phaser.Tilemap#setTileLocationCallback} are not invoked. So calling this method without any callbacks isn't very useful. - * - * If you're interested only in whether an object overlaps a certain tile or class of tiles, filter the tiles with `processCallback` and then use the result returned by this method. Blank/null tiles can be excluded by their {@link Phaser.Tile#index index} (-1). - * - * If you want to take action on certain overlaps, examine the tiles in `collideCallback` and then handle as you like. + * Tests if Game Objects overlap. See {@link Phaser.Physics.Arcade.World#overlap} * * @method Phaser.Physics.Arcade.ArcadePhysics#overlap * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {ArcadePhysicsCallback} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter. - * @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * - * @return {boolean} True if an overlap occurred otherwise false. + * @return {boolean} True if at least one Game Object overlaps another. + * + * @see Phaser.Physics.Arcade.World#overlap */ overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) { @@ -109904,18 +110466,20 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Tests if Game Objects overlap and separates them (if possible). See {@link Phaser.Physics.Arcade.World#collide}. * * @method Phaser.Physics.Arcade.ArcadePhysics#collide * @since 3.0.0 * - * @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {ArcadePhysicsCallback} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter. - * @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {*} [callbackContext] - The context in which to run the callbacks. * - * @return {boolean} True if a collision occurred otherwise false. + * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. + * + * @see Phaser.Physics.Arcade.World#collide */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -109927,12 +110491,12 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Pauses the simulation. * * @method Phaser.Physics.Arcade.ArcadePhysics#pause * @since 3.0.0 * - * @return {Phaser.Physics.Arcade.World} [description] + * @return {Phaser.Physics.Arcade.World} The simulation. */ pause: function () { @@ -109940,12 +110504,12 @@ var ArcadePhysics = new Class({ }, /** - * [description] + * Resumes the simulation (if paused). * * @method Phaser.Physics.Arcade.ArcadePhysics#resume * @since 3.0.0 * - * @return {Phaser.Physics.Arcade.World} [description] + * @return {Phaser.Physics.Arcade.World} The simulation. */ resume: function () { @@ -110191,6 +110755,12 @@ var ArcadePhysics = new Class({ */ shutdown: function () { + if (!this.world) + { + // Already destroyed + return; + } + var eventEmitter = this.systems.events; eventEmitter.off('update', this.world.update, this.world); @@ -110455,9 +111025,9 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#equals * @since 3.0.0 * - * @param {Phaser.Math.Vector4} v - [description] + * @param {Phaser.Math.Vector4} v - The vector to check equality with. * - * @return {boolean} [description] + * @return {boolean} A boolean indicating whether the two Vectors are equal or not. */ equals: function (v) { @@ -110719,7 +111289,7 @@ var Vector4 = new Class({ * @method Phaser.Math.Vector4#distance * @since 3.0.0 * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - [description] + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. * * @return {number} The distance from this Vector to the given Vector. */ @@ -111942,7 +112512,7 @@ module.exports = DistancePower; module.exports = { - Between: __webpack_require__(51), + Between: __webpack_require__(52), Power: __webpack_require__(560), Squared: __webpack_require__(250) @@ -112296,7 +112866,7 @@ var PhaserMath = { Factorial: __webpack_require__(245), FloatBetween: __webpack_require__(300), FloorTo: __webpack_require__(543), - FromPercent: __webpack_require__(92), + FromPercent: __webpack_require__(93), GetSpeed: __webpack_require__(542), IsEven: __webpack_require__(541), IsEvenStrict: __webpack_require__(540), @@ -112318,7 +112888,7 @@ var PhaserMath = { SmoothStep: __webpack_require__(181), TransformXY: __webpack_require__(333), Within: __webpack_require__(531), - Wrap: __webpack_require__(52), + Wrap: __webpack_require__(53), // Vector classes Vector2: __webpack_require__(3), @@ -113173,6 +113743,12 @@ var LoaderPlugin = new Class({ */ nextFile: function (file, success) { + // Has the game been destroyed during load? If so, bail out now. + if (!this.inflight) + { + return; + } + this.inflight.delete(file); this.updateProgress(); @@ -113213,6 +113789,12 @@ var LoaderPlugin = new Class({ */ fileProcessComplete: function (file) { + // Has the game been destroyed during load? If so, bail out now. + if (!this.scene || !this.systems || !this.systems.game || this.systems.game.pendingDestroy) + { + return; + } + // This file has failed, so move it to the failed Set if (file.state === CONST.FILE_ERRORED) { @@ -113696,7 +114278,7 @@ module.exports = UnityAtlasFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var TILEMAP_FORMATS = __webpack_require__(29); /** @@ -113861,7 +114443,7 @@ module.exports = TilemapJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var TILEMAP_FORMATS = __webpack_require__(29); /** @@ -115403,7 +115985,7 @@ module.exports = PluginFile; var Class = __webpack_require__(0); var CONST = __webpack_require__(18); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); /** * @typedef {object} Phaser.Loader.FileTypes.PackFileConfig @@ -115633,7 +116215,7 @@ var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(2); var ImageFile = __webpack_require__(58); var IsPlainObject = __webpack_require__(8); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var MultiFile = __webpack_require__(57); /** @@ -117055,7 +117637,7 @@ var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(8); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var MultiFile = __webpack_require__(57); /** @@ -117611,7 +118193,7 @@ var FileTypesManager = __webpack_require__(7); var GetFastValue = __webpack_require__(2); var ImageFile = __webpack_require__(58); var IsPlainObject = __webpack_require__(8); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); var MultiFile = __webpack_require__(57); /** @@ -117870,7 +118452,7 @@ module.exports = AtlasJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(7); -var JSONFile = __webpack_require__(50); +var JSONFile = __webpack_require__(51); /** * @classdesc @@ -118088,7 +118670,7 @@ module.exports = { HTMLFile: __webpack_require__(584), HTMLTextureFile: __webpack_require__(583), ImageFile: __webpack_require__(58), - JSONFile: __webpack_require__(50), + JSONFile: __webpack_require__(51), MultiAtlasFile: __webpack_require__(582), PackFile: __webpack_require__(581), PluginFile: __webpack_require__(580), @@ -119347,20 +119929,20 @@ module.exports = CreatePixelPerfectHandler; */ var Circle = __webpack_require__(71); -var CircleContains = __webpack_require__(39); +var CircleContains = __webpack_require__(40); var Class = __webpack_require__(0); var CreateInteractiveObject = __webpack_require__(261); var CreatePixelPerfectHandler = __webpack_require__(608); -var DistanceBetween = __webpack_require__(51); -var Ellipse = __webpack_require__(89); -var EllipseContains = __webpack_require__(88); +var DistanceBetween = __webpack_require__(52); +var Ellipse = __webpack_require__(90); +var EllipseContains = __webpack_require__(89); var EventEmitter = __webpack_require__(11); var GetFastValue = __webpack_require__(2); var InputPluginCache = __webpack_require__(106); var IsPlainObject = __webpack_require__(8); var PluginCache = __webpack_require__(15); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); var Triangle = __webpack_require__(59); var TriangleContains = __webpack_require__(69); @@ -122790,7 +123372,7 @@ var Length = __webpack_require__(65); // The 2D area of a triangle. The area value is always non-negative. /** - * [description] + * Gets the length of the perimeter of the given triangle. * * @function Phaser.Geom.Triangle.Perimeter * @since 3.0.0 @@ -122822,15 +123404,15 @@ module.exports = Perimeter; */ /** - * [description] + * Returns true if two triangles have the same coordinates. * * @function Phaser.Geom.Triangle.Equals * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Triangle} toCompare - [description] + * @param {Phaser.Geom.Triangle} triangle - The first triangle to check. + * @param {Phaser.Geom.Triangle} toCompare - The second triangle to check. * - * @return {boolean} [description] + * @return {boolean} `true` if the two given triangles have the exact same coordinates, otherwise `false`. */ var Equals = function (triangle, toCompare) { @@ -123120,19 +123702,19 @@ var Offset = __webpack_require__(263); */ /** - * [description] + * Positions the Triangle so that it is centered on the given coordinates. * * @function Phaser.Geom.Triangle.CenterOn * @since 3.0.0 * * @generic {Phaser.Geom.Triangle} O - [triangle,$return] * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {number} x - [description] - * @param {number} y - [description] - * @param {CenterFunction} [centerFunc] - [description] + * @param {Phaser.Geom.Triangle} triangle - The triangle to be positioned. + * @param {number} x - The horizontal coordinate to center on. + * @param {number} y - The vertical coordinate to center on. + * @param {CenterFunction} [centerFunc] - The function used to center the triangle. Defaults to Centroid centering. * - * @return {Phaser.Geom.Triangle} [description] + * @return {Phaser.Geom.Triangle} The Triangle that was centered. */ var CenterOn = function (triangle, x, y, centerFunc) { @@ -123168,17 +123750,17 @@ var Triangle = __webpack_require__(59); // w/h can be positive or negative and represent the length of each side /** - * [description] + * Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles. * * @function Phaser.Geom.Triangle.BuildRight * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} x - The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle. + * @param {number} y - The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle. + * @param {number} width - The length of the side which is to the left or to the right of the right angle. + * @param {number} height - The length of the side which is above or below the right angle. * - * @return {Phaser.Geom.Triangle} [description] + * @return {Phaser.Geom.Triangle} The constructed right Triangle. */ var BuildRight = function (x, y, width, height) { @@ -123287,24 +123869,18 @@ module.exports = BuildFromPolygon; var Triangle = __webpack_require__(59); -// Builds an equilateral triangle. -// In the equilateral triangle, all the sides are the same length (congruent) -// and all the angles are the same size (congruent). - -// The x/y specifies the top-middle of the triangle (x1/y1) and length -// is the length of each side - /** - * [description] + * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). + * The x/y specifies the top-middle of the triangle (x1/y1) and length is the length of each side. * * @function Phaser.Geom.Triangle.BuildEquilateral * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} length - [description] + * @param {number} x - x coordinate of the top point of the triangle. + * @param {number} y - y coordinate of the top point of the triangle. + * @param {number} length - Length of each side of the triangle. * - * @return {Phaser.Geom.Triangle} [description] + * @return {Phaser.Geom.Triangle} The Triangle object of the given size. */ var BuildEquilateral = function (x, y, length) { @@ -123616,17 +124192,17 @@ module.exports = Overlaps; */ /** - * [description] + * Nudges (translates) the top-left corner of a Rectangle by the coordinates of a point (translation vector). * * @function Phaser.Geom.Rectangle.OffsetPoint * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point} point - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * @param {(Phaser.Geom.Point|Phaser.Math.Vector2)} point - The point whose coordinates should be used as an offset. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var OffsetPoint = function (rect, point) { @@ -123650,18 +124226,18 @@ module.exports = OffsetPoint; */ /** - * [description] + * Nudges (translates) the top left corner of a Rectangle by a given offset. * * @function Phaser.Geom.Rectangle.Offset * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * @param {number} x - The distance to move the Rectangle horizontally. + * @param {number} y - The distance to move the Rectangle vertically. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var Offset = function (rect, x, y) { @@ -123685,18 +124261,18 @@ module.exports = Offset; */ /** - * [description] + * Merges a Rectangle with a point by repositioning and/or resizing it so that the point is on or within its bounds. * * @function Phaser.Geom.Rectangle.MergeXY * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [target,$return] * - * @param {Phaser.Geom.Rectangle} target - [description] - * @param {number} x - [description] - * @param {number} y - [description] + * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged and modified. + * @param {number} x - The X coordinate of the point which should be merged. + * @param {number} y - The Y coordinate of the point which should be merged. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The modified `target` Rectangle. */ var MergeXY = function (target, x, y) { @@ -123732,17 +124308,18 @@ module.exports = MergeXY; // Neither rect should have negative widths or heights /** - * [description] + * Merges the source rectangle into the target rectangle and returns the target. + * Neither rectangle should have a negative width or height. * * @function Phaser.Geom.Rectangle.MergeRect * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [target,$return] * - * @param {Phaser.Geom.Rectangle} target - [description] - * @param {Phaser.Geom.Rectangle} source - [description] + * @param {Phaser.Geom.Rectangle} target - Target rectangle. Will be modified to include source rectangle. + * @param {Phaser.Geom.Rectangle} source - Rectangle that will be merged into target rectangle. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} Modified target rectangle that contains source rectangle. */ var MergeRect = function (target, source) { @@ -123774,21 +124351,18 @@ module.exports = MergeRect; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// Merges the target Rectangle with a list of points. -// The points is an array of objects with public x/y properties. - /** - * [description] + * Merges a Rectangle with a list of points by repositioning and/or resizing it such that all points are located on or within its bounds. * * @function Phaser.Geom.Rectangle.MergePoints * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [target,$return] * - * @param {Phaser.Geom.Rectangle} target - [description] - * @param {Phaser.Geom.Point[]} points - [description] + * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged. + * @param {Phaser.Geom.Point[]} points - An array of Points (or any object with public `x` and `y` properties) which should be merged with the Rectangle. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The modified Rectangle. */ var MergePoints = function (target, points) { @@ -123963,20 +124537,18 @@ module.exports = GetSize; var Point = __webpack_require__(6); -// The center of the Rectangle object, expressed as a Point object - /** - * [description] + * Returns the center of a Rectangle as a Point. * * @function Phaser.Geom.Rectangle.GetCenter * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [out,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {(Phaser.Geom.Point|object)} [out] - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the center of. + * @param {(Phaser.Geom.Point|object)} [out] - Optional point-like object to update with the center coordinates. * - * @return {(Phaser.Geom.Point|object)} [description] + * @return {(Phaser.Geom.Point|object)} The modified `out` object, or a new Point if none was provided. */ var GetCenter = function (rect, out) { @@ -124002,16 +124574,16 @@ module.exports = GetCenter; */ /** - * [description] + * Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension. * * @function Phaser.Geom.Rectangle.FloorAll * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var FloorAll = function (rect) { @@ -124240,18 +124812,18 @@ module.exports = CopyFrom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(38); +var Contains = __webpack_require__(39); /** - * [description] + * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. * * @function Phaser.Geom.Rectangle.ContainsPoint * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Point} point - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle object. + * @param {Phaser.Geom.Point} point - The point object to be checked. Can be a Phaser Point object or any object with x and y values. * - * @return {boolean} [description] + * @return {boolean} A value of true if the Rectangle object contains the specified point, otherwise false. */ var ContainsPoint = function (rect, point) { @@ -124274,14 +124846,14 @@ module.exports = ContainsPoint; var Rectangle = __webpack_require__(9); /** - * [description] + * Creates a new Rectangle which is identical to the given one. * * @function Phaser.Geom.Rectangle.Clone * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} source - [description] + * @param {Phaser.Geom.Rectangle} source - The Rectangle to clone. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The newly created Rectangle, which is separate from the given one. */ var Clone = function (source) { @@ -124337,16 +124909,16 @@ module.exports = CeilAll; */ /** - * [description] + * Rounds a Rectangle's position up to the smallest integer greater than or equal to each current coordinate. * * @function Phaser.Geom.Rectangle.Ceil * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [rect,$return] * - * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. */ var Ceil = function (rect) { @@ -124432,17 +125004,19 @@ module.exports = Reverse; // Export the points as an array of flat numbers, following the sequence [ x,y, x,y, x,y ] /** - * [description] + * Stores all of the points of a Polygon into a flat array of numbers following the sequence [ x,y, x,y, x,y ], + * i.e. each point of the Polygon, in the order it's defined, corresponds to two elements of the resultant + * array for the point's X and Y coordinate. * * @function Phaser.Geom.Polygon.GetNumberArray * @since 3.0.0 * * @generic {number[]} O - [output,$return] * - * @param {Phaser.Geom.Polygon} polygon - [description] - * @param {(array|number[])} [output] - [description] + * @param {Phaser.Geom.Polygon} polygon - The Polygon whose points to export. + * @param {(array|number[])} [output] - An array to which the points' coordinates should be appended. * - * @return {(array|number[])} [description] + * @return {(array|number[])} The modified `output` array, or a new array if none was given. */ var GetNumberArray = function (polygon, output) { @@ -124726,16 +125300,16 @@ module.exports = Negative; */ /** - * [description] + * Swaps the X and the Y coordinate of a point. * * @function Phaser.Geom.Point.Invert * @since 3.0.0 * * @generic {Phaser.Geom.Point} O - [point,$return] * - * @param {Phaser.Geom.Point} point - [description] + * @param {Phaser.Geom.Point} point - The Point to modify. * - * @return {Phaser.Geom.Point} [description] + * @return {Phaser.Geom.Point} The modified `point`. */ var Invert = function (point) { @@ -124758,7 +125332,7 @@ module.exports = Invert; var Point = __webpack_require__(6); /** - * [description] + * Interpolate two given Point objects, based on `t` value. Return result either as new Point if `out` parameter is omitted or load result into Point passed as `out` parameter and return it. For `out` parameter you can also use any object with public x/y properties. * * @function Phaser.Geom.Point.Interpolate * @since 3.0.0 @@ -124960,15 +125534,15 @@ module.exports = Floor; */ /** - * [description] + * A comparison of two `Point` objects to see if they are equal. * * @function Phaser.Geom.Point.Equals * @since 3.0.0 * - * @param {Phaser.Geom.Point} point - [description] - * @param {Phaser.Geom.Point} toCompare - [description] + * @param {Phaser.Geom.Point} point - The original `Point` to compare against. + * @param {Phaser.Geom.Point} toCompare - The second `Point` to compare. * - * @return {boolean} [description] + * @return {boolean} Returns true if the both `Point` objects are equal. */ var Equals = function (point, toCompare) { @@ -125416,7 +125990,7 @@ var Angle = __webpack_require__(68); * @function Phaser.Geom.Line.NormalX * @since 3.0.0 * - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Line} line - The Line object to get the normal value from. * * @return {number} [description] */ @@ -125816,15 +126390,17 @@ var Contains = __webpack_require__(69); var LineToLine = __webpack_require__(107); /** - * [description] + * Checks if a Triangle and a Line intersect. + * + * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * * @function Phaser.Geom.Intersects.TriangleToLine * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check with. + * @param {Phaser.Geom.Line} line - The Line to check with. * - * @return {boolean} [description] + * @return {boolean} `true` if the Triangle and the Line intersect, otherwise `false`. */ var TriangleToLine = function (triangle, line) { @@ -125970,20 +126546,20 @@ module.exports = RectangleToValues; */ var LineToLine = __webpack_require__(107); -var Contains = __webpack_require__(38); +var Contains = __webpack_require__(39); var ContainsArray = __webpack_require__(146); var Decompose = __webpack_require__(271); /** - * [description] + * Checks for intersection between Rectangle shape and Triangle shape. * * @function Phaser.Geom.Intersects.RectangleToTriangle * @since 3.0.0 * - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {Phaser.Geom.Triangle} triangle - [description] + * @param {Phaser.Geom.Rectangle} rect - Rectangle object to test. + * @param {Phaser.Geom.Triangle} triangle - Triangle object to test. * - * @return {boolean} [description] + * @return {boolean} A value of `true` if objects intersect; otherwise `false`. */ var RectangleToTriangle = function (rect, triangle) { @@ -126208,18 +126784,22 @@ var Rectangle = __webpack_require__(9); var RectangleToRectangle = __webpack_require__(147); /** - * [description] + * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. + * + * If optional `output` parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero). + * + * If Rectangle object is passed as `output` and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersetion, it will be returned without any change. * * @function Phaser.Geom.Intersects.GetRectangleIntersection * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [output,$return] * - * @param {Phaser.Geom.Rectangle} rectA - [description] - * @param {Phaser.Geom.Rectangle} rectB - [description] - * @param {Phaser.Geom.Rectangle} [output] - [description] + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle object. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle object. + * @param {Phaser.Geom.Rectangle} [output] - Optional Rectangle object. If given, the intersection data will be loaded into it (in case of no intersection, it will be left unchanged). Otherwise, new Rectangle object will be created and returned with either intersection data or empty (all values set to zero), if there is no intersection. * - * @return {Phaser.Geom.Rectangle} [description] + * @return {Phaser.Geom.Rectangle} A rectangle object with intersection data. */ var GetRectangleIntersection = function (rectA, rectB, output) { @@ -126303,18 +126883,18 @@ module.exports = CircleToRectangle; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); /** - * [description] + * Checks if two Circles intersect. * * @function Phaser.Geom.Intersects.CircleToCircle * @since 3.0.0 * - * @param {Phaser.Geom.Circle} circleA - [description] - * @param {Phaser.Geom.Circle} circleB - [description] + * @param {Phaser.Geom.Circle} circleA - The first Circle to check for intersection. + * @param {Phaser.Geom.Circle} circleB - The second Circle to check for intersection. * - * @return {boolean} [description] + * @return {boolean} `true` if the two Circles intersect, otherwise `false`. */ var CircleToCircle = function (circleA, circleB) { @@ -126510,7 +127090,7 @@ module.exports = CopyFrom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(88); +var Contains = __webpack_require__(89); /** * Check to see if the Ellipse contains all four points of the given Rectangle object. @@ -126546,7 +127126,7 @@ module.exports = ContainsRect; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(88); +var Contains = __webpack_require__(89); /** * Check to see if the Ellipse contains the given Point object. @@ -126577,7 +127157,7 @@ module.exports = ContainsPoint; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Ellipse = __webpack_require__(89); +var Ellipse = __webpack_require__(90); /** * Creates a new Ellipse instance based on the values contained in the given source. @@ -126641,13 +127221,13 @@ module.exports = Area; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Ellipse = __webpack_require__(89); +var Ellipse = __webpack_require__(90); Ellipse.Area = __webpack_require__(711); Ellipse.Circumference = __webpack_require__(307); Ellipse.CircumferencePoint = __webpack_require__(155); Ellipse.Clone = __webpack_require__(710); -Ellipse.Contains = __webpack_require__(88); +Ellipse.Contains = __webpack_require__(89); Ellipse.ContainsPoint = __webpack_require__(709); Ellipse.ContainsRect = __webpack_require__(708); Ellipse.CopyFrom = __webpack_require__(707); @@ -126847,7 +127427,7 @@ module.exports = CopyFrom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(39); +var Contains = __webpack_require__(40); /** * Check to see if the Circle contains all four points of the given Rectangle object. @@ -126883,7 +127463,7 @@ module.exports = ContainsRect; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Contains = __webpack_require__(39); +var Contains = __webpack_require__(40); /** * Check to see if the Circle contains the given Point object. @@ -126978,7 +127558,7 @@ Circle.Area = __webpack_require__(721); Circle.Circumference = __webpack_require__(403); Circle.CircumferencePoint = __webpack_require__(192); Circle.Clone = __webpack_require__(720); -Circle.Contains = __webpack_require__(39); +Circle.Contains = __webpack_require__(40); Circle.ContainsPoint = __webpack_require__(719); Circle.ContainsRect = __webpack_require__(718); Circle.CopyFrom = __webpack_require__(717); @@ -127922,7 +128502,7 @@ GameObjectCreator.register('particles', function (config, addToScene) var BuildGameObject = __webpack_require__(28); var GameObjectCreator = __webpack_require__(13); var GetAdvancedValue = __webpack_require__(12); -var Image = __webpack_require__(86); +var Image = __webpack_require__(87); /** * Creates a new Image Game Object and returns it. @@ -127970,7 +128550,7 @@ GameObjectCreator.register('image', function (config, addToScene) */ var GameObjectCreator = __webpack_require__(13); -var Group = __webpack_require__(87); +var Group = __webpack_require__(88); /** * Creates a new Group Game Object and returns it. @@ -129189,7 +129769,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Image = __webpack_require__(86); +var Image = __webpack_require__(87); var GameObjectFactory = __webpack_require__(5); /** @@ -129231,7 +129811,7 @@ GameObjectFactory.register('image', function (x, y, key, frame) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Group = __webpack_require__(87); +var Group = __webpack_require__(88); var GameObjectFactory = __webpack_require__(5); /** @@ -129733,7 +130313,7 @@ module.exports = StarCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -130116,7 +130696,7 @@ module.exports = PolygonCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -131399,7 +131979,7 @@ module.exports = EllipseCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -131593,7 +132173,7 @@ module.exports = CurveCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -131775,7 +132355,7 @@ module.exports = ArcCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var FillPathWebGL = __webpack_require__(81); +var FillPathWebGL = __webpack_require__(82); var StrokePathWebGL = __webpack_require__(60); /** @@ -132661,20 +133241,27 @@ var TextStyle = new Class({ */ setFont: function (font) { - if (typeof font === 'string') + var fontFamily = font; + var fontSize = ''; + var fontStyle = ''; + + if (typeof font !== 'string') { - this.fontFamily = font; - this.fontSize = ''; - this.fontStyle = ''; - } - else - { - this.fontFamily = GetValue(font, 'fontFamily', 'Courier'); - this.fontSize = GetValue(font, 'fontSize', '16px'); - this.fontStyle = GetValue(font, 'fontStyle', ''); + fontFamily = GetValue(font, 'fontFamily', 'Courier'); + fontSize = GetValue(font, 'fontSize', '16px'); + fontStyle = GetValue(font, 'fontStyle', ''); } - return this.update(true); + if (fontFamily !== this.fontFamily || fontSize !== this.fontSize || fontStyle !== this.fontStyle) + { + this.fontFamily = fontFamily; + this.fontSize = fontSize; + this.fontStyle = fontStyle; + + this.update(true); + } + + return this.parent; }, /** @@ -132689,9 +133276,14 @@ var TextStyle = new Class({ */ setFontFamily: function (family) { - this.fontFamily = family; + if (this.fontFamily !== family) + { + this.fontFamily = family; - return this.update(true); + this.update(true); + } + + return this.parent; }, /** @@ -132706,9 +133298,14 @@ var TextStyle = new Class({ */ setFontStyle: function (style) { - this.fontStyle = style; + if (this.fontStyle !== style) + { + this.fontStyle = style; - return this.update(true); + this.update(true); + } + + return this.parent; }, /** @@ -132728,9 +133325,14 @@ var TextStyle = new Class({ size = size.toString() + 'px'; } - this.fontSize = size; + if (this.fontSize !== size) + { + this.fontSize = size; - return this.update(true); + this.update(true); + } + + return this.parent; }, /** @@ -132868,24 +133470,31 @@ var TextStyle = new Class({ */ setStroke: function (color, thickness) { - if (color === undefined) + if (thickness === undefined) { thickness = this.strokeThickness; } + + if (color === undefined && this.strokeThickness !== 0) { // Reset the stroke to zero (disabling it) this.strokeThickness = 0; - } - else - { - if (thickness === undefined) { thickness = this.strokeThickness; } + this.update(true); + } + else if (this.stroke !== color || this.strokeThickness !== thickness) + { this.stroke = color; this.strokeThickness = thickness; + + this.update(true); } - return this.update(true); + return this.parent; }, /** * Set the shadow settings. + * + * Calling this method always re-measures the parent Text object, + * so only call it when you actually change the shadow settings. * * @method Phaser.GameObjects.Text.TextStyle#setShadow * @since 3.0.0 @@ -134111,9 +134720,9 @@ module.exports = { var Class = __webpack_require__(0); var FloatBetween = __webpack_require__(300); -var GetEaseFunction = __webpack_require__(85); +var GetEaseFunction = __webpack_require__(86); var GetFastValue = __webpack_require__(2); -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * The returned value sets what the property will be at the START of the particle's life, on emit. @@ -137784,14 +138393,14 @@ var UpdateList = new Class({ while (i--) { - this.this._pendingRemoval[i].destroy(true); + this._pendingRemoval[i].destroy(true); } i = this._pendingInsertion.length; while (i--) { - this.this._pendingInsertion[i].destroy(true); + this._pendingInsertion[i].destroy(true); } this._list.length = 0; @@ -138040,7 +138649,7 @@ module.exports = Replace; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var SpliceOne = __webpack_require__(90); +var SpliceOne = __webpack_require__(91); /** * Removes a random object from the given array and returns it. @@ -138141,7 +138750,7 @@ module.exports = RemoveBetween; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var SpliceOne = __webpack_require__(90); +var SpliceOne = __webpack_require__(91); /** * Removes the item from the given position in the array. @@ -139135,14 +139744,14 @@ module.exports = ReverseRows; */ /** - * [description] + * Reverses the columns in the given Array Matrix. * * @function Phaser.Utils.Array.Matrix.ReverseColumns * @since 3.0.0 * - * @param {array} matrix - [description] + * @param {array} matrix - The array matrix to reverse the columns for. * - * @return {array} [description] + * @return {array} The column reversed matrix. */ var ReverseColumns = function (matrix) { @@ -139174,14 +139783,14 @@ var CheckMatrix = __webpack_require__(162); // Array Matrix. /** - * [description] + * Generates a string (which you can pass to console.log) from the given Array Matrix. * * @function Phaser.Utils.Array.Matrix.MatrixToString * @since 3.0.0 * - * @param {array} matrix - [description] + * @param {array} matrix - A 2-dimensional array. * - * @return {string} [description] + * @return {string} A string representing the matrix. */ var MatrixToString = function (matrix) { @@ -139540,8 +140149,8 @@ var GameObjects = { Container: __webpack_require__(159), DynamicBitmapText: __webpack_require__(158), Graphics: __webpack_require__(157), - Group: __webpack_require__(87), - Image: __webpack_require__(86), + Group: __webpack_require__(88), + Image: __webpack_require__(87), Particles: __webpack_require__(822), PathFollower: __webpack_require__(297), RenderTexture: __webpack_require__(153), @@ -141349,7 +141958,7 @@ var CanvasTexture = new Class({ /** * A reference to the Texture Source of this Canvas. * - * @name Phaser.Textures.CanvasTexturer#_source + * @name Phaser.Textures.CanvasTexture#_source * @type {Phaser.Textures.TextureSource} * @private * @since 3.7.0 @@ -141369,7 +141978,7 @@ var CanvasTexture = new Class({ /** * The 2D Canvas Rendering Context. * - * @name Phaser.Textures.CanvasTexture#canvas + * @name Phaser.Textures.CanvasTexture#context * @readOnly * @type {CanvasRenderingContext2D} * @since 3.7.0 @@ -143172,7 +143781,7 @@ module.exports = init(); * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var OS = __webpack_require__(91); +var OS = __webpack_require__(92); var Browser = __webpack_require__(118); /** @@ -143271,76 +143880,76 @@ var ValueToColor = __webpack_require__(178); /** * @callback BootCallback * - * @param {Phaser.Game} game - [description] + * @param {Phaser.Game} game - The game. */ /** * @typedef {object} InputConfig * - * @property {(boolean|KeyboardInputConfig)} [keyboard=true] - [description] - * @property {(boolean|MouseInputConfig)} [mouse=true] - [description] - * @property {(boolean|TouchInputConfig)} [touch=true] - [description] - * @property {(boolean|GamepadInputConfig)} [gamepad=false] - [description] - * @property {integer} [activePointers=1] - [description] + * @property {(boolean|KeyboardInputConfig)} [keyboard=true] - Keyboard input configuration. `true` uses the default configuration and `false` disables keyboard input. + * @property {(boolean|MouseInputConfig)} [mouse=true] - Mouse input configuration. `true` uses the default configuration and `false` disables mouse input. + * @property {(boolean|TouchInputConfig)} [touch=true] - Touch input configuration. `true` uses the default configuration and `false` disables touch input. + * @property {(boolean|GamepadInputConfig)} [gamepad=false] - Gamepad input configuration. `true` enables gamepad input. + * @property {integer} [activePointers=1] - The maximum number of touch pointers. See {@link Phaser.Input.InputManager#pointers}. */ /** * @typedef {object} MouseInputConfig * - * @property {*} [target=null] - [description] - * @property {boolean} [capture=true] - [description] + * @property {*} [target=null] - Where the Mouse Manager listens for mouse input events. The default is the game canvas. + * @property {boolean} [capture=true] - Whether mouse input events have preventDefault() called on them. */ /** * @typedef {object} KeyboardInputConfig * - * @property {*} [target=window] - [description] + * @property {*} [target=window] - Where the Keyboard Manager listens for keyboard input events. */ /** * @typedef {object} TouchInputConfig * - * @property {*} [target=null] - [description] - * @property {boolean} [capture=true] - [description] + * @property {*} [target=null] - Where the Touch Manager listens for touch input events. The default is the game canvas. + * @property {boolean} [capture=true] - Whether touch input events have preventDefault() called on them. */ /** * @typedef {object} GamepadInputConfig * - * @property {*} [target=window] - [description] + * @property {*} [target=window] - Where the Gamepad Manager listens for gamepad input events. */ /** * @typedef {object} BannerConfig * - * @property {boolean} [hidePhaser=false] - [description] - * @property {string} [text='#ffffff'] - [description] - * @property {string[]} [background] - [description] + * @property {boolean} [hidePhaser=false] - Omit Phaser's name and version from the banner. + * @property {string} [text='#ffffff'] - The color of the banner text. + * @property {string[]} [background] - The background colors of the banner. */ /** * @typedef {object} FPSConfig * - * @property {integer} [min=10] - [description] - * @property {integer} [target=60] - [description] - * @property {boolean} [forceSetTimeOut=false] - [description] - * @property {integer} [deltaHistory=10] - [description] + * @property {integer} [min=10] - The minimum acceptable rendering rate, in frames per second. + * @property {integer} [target=60] - The optimum rendering rate, in frames per second. + * @property {boolean} [forceSetTimeOut=false] - Use setTimeout instead of requestAnimationFrame to run the game loop. + * @property {integer} [deltaHistory=10] - Calculate the average frame delta from this many consecutive frame intervals. * @property {integer} [panicMax=120] - [description] */ /** * @typedef {object} RenderConfig * - * @property {boolean} [antialias=true] - [description] - * @property {boolean} [pixelArt=false] - [description] + * @property {boolean} [antialias=true] - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. + * @property {boolean} [pixelArt=false] - Sets `antialias` and `roundPixels` to true. This is the best setting for pixel-art games. * @property {boolean} [autoResize=true] - Automatically resize the Game Canvas if you resize the renderer. - * @property {boolean} [roundPixels=false] - [description] - * @property {boolean} [transparent=false] - [description] - * @property {boolean} [clearBeforeRender=true] - [description] - * @property {boolean} [premultipliedAlpha=true] - [description] - * @property {boolean} [preserveDrawingBuffer=false] - [description] - * @property {boolean} [failIfMajorPerformanceCaveat=false] - [description] - * @property {string} [powerPreference='default'] - "high-performance", "low-power" or "default" + * @property {boolean} [roundPixels=false] - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. + * @property {boolean} [transparent=false] - Whether the game canvas will be transparent. + * @property {boolean} [clearBeforeRender=true] - Whether the game canvas will be cleared between each rendering frame. + * @property {boolean} [premultipliedAlpha=true] - In WebGL mode, the drawing buffer contains colors with pre-multiplied alpha. + * @property {boolean} [preserveDrawingBuffer=false] - In WebGL mode, the drawing buffer won't be cleared automatically each frame. + * @property {boolean} [failIfMajorPerformanceCaveat=false] - Let the browser abort creating a WebGL context if it judges performance would be unacceptable. + * @property {string} [powerPreference='default'] - "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. * @property {integer} [batchSize=2000] - The default WebGL batch size. */ @@ -143351,8 +143960,8 @@ var ValueToColor = __webpack_require__(178); * @property {(integer|string)} [height=768] - The base height of your game. * @property {integer} [zoom=1] - The zoom value of the game canvas. * @property {number} [resolution=1] - The rendering resolution of the canvas. - * @property {any} [parent] - The parent DOM element. - * @property {integer} [mode=0] - The scale mode to apply to the canvas. + * @property {(HTMLElement|string)} [parent] - The DOM element that will contain the game canvas, or its `id`. If null (the default) or if the named element doesn't exist, the game canvas is inserted directly into the document body. + * @property {integer} [mode=0] - The scale mode to apply to the canvas. SHOW_ALL, EXACT_FIT, USER_SCALE, or RESIZE. * @property {integer} [minWidth] - The minimum width the canvas can be scaled down to. * @property {integer} [minHeight] - The minimum height the canvas can be scaled down to. * @property {integer} [maxWidth] - The maximum width the canvas can be scaled up to. @@ -143362,22 +143971,22 @@ var ValueToColor = __webpack_require__(178); /** * @typedef {object} CallbacksConfig * - * @property {BootCallback} [preBoot=NOOP] - [description] - * @property {BootCallback} [postBoot=NOOP] - [description] + * @property {BootCallback} [preBoot=NOOP] - A function to run at the start of the boot sequence. + * @property {BootCallback} [postBoot=NOOP] - A function to run at the end of the boot sequence. At this point, all the game systems have started and plugins have been loaded. */ /** * @typedef {object} LoaderConfig * - * @property {string} [baseURL] - [description] - * @property {string} [path] - [description] - * @property {integer} [maxParallelDownloads=32] - [description] - * @property {(string|undefined)} [crossOrigin=undefined] - [description] - * @property {string} [responseType] - [description] - * @property {boolean} [async=true] - [description] - * @property {string} [user] - [description] - * @property {string} [password] - [description] - * @property {integer} [timeout=0] - [description] + * @property {string} [baseURL] - An URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. + * @property {string} [path] - An URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. + * @property {integer} [maxParallelDownloads=32] - The maximum number of resources the loader will start loading at once. + * @property {(string|undefined)} [crossOrigin=undefined] - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. + * @property {string} [responseType] - The response type of the XHR request, e.g. `blob`, `text`, etc. + * @property {boolean} [async=true] - Should the XHR request use async or not? + * @property {string} [user] - Optional username for the XHR request. + * @property {string} [password] - Optional password for the XHR request. + * @property {integer} [timeout=0] - Optional XHR timeout value, in ms. */ /** @@ -143390,65 +143999,81 @@ var ValueToColor = __webpack_require__(178); /** * @typedef {object} ImagesConfig * - * @property {string} [default] - [description] - * @property {string} [missing] - [description] + * @property {string} [default] - URL to use for the 'default' texture. + * @property {string} [missing] - URL to use for the 'missing' texture. */ +/** + * @typedef {object} PhysicsConfig + * + * @property {string} [default] - The default physics system. It will be started for each scene. Phaser provides 'arcade', 'impact', and 'matter'. + * @property {ArcadeWorldConfig} [arcade] - Arcade Physics configuration. + * @property {Phaser.Physics.Impact.WorldConfig} [impact] - Impact Physics configuration. + * @property {object} [matter] - Matter Physics configuration. + */ + /** * @typedef {object} PluginObjectItem * - * @property {string} [key] - [description] - * @property {*} [plugin] - [description] - * @property {boolean} [start] - [description] - * @property {string} [systemKey] - [description] - * @property {string} [sceneKey] - [description] - * @property {*} [data] - [description] + * @property {string} [key] - A key to identify the plugin in the Plugin Manager. + * @property {*} [plugin] - The plugin itself. Usually a class/constructor. + * @property {boolean} [start] - Whether the plugin should be started automatically. + * @property {string} [systemKey] - For a scene plugin, add the plugin to the scene's systems object under this key (`this.sys.KEY`, from the scene). + * @property {string} [sceneKey] - For a scene plugin, add the plugin to the scene object under this key (`this.KEY`, from the scene). + * @property {*} [data] - Arbitrary data passed to the plugin's init() method. + * + * @example + * // Global plugin + * { key: 'BankPlugin', plugin: BankPluginV3, start: true, data: { gold: 5000 } } + * @example + * // Scene plugin + * { key: 'WireFramePlugin', plugin: WireFramePlugin, systemKey: 'wireFramePlugin', sceneKey: 'wireframe' } */ /** * @typedef {object} PluginObject * - * @property {?PluginObjectItem[]} [global] - [description] - * @property {?PluginObjectItem[]} [scene] - [description] - * @property {string[]} [default] - [description] - * @property {*} [defaultMerge] - [description] + * @property {?PluginObjectItem[]} [global] - Global plugins to install. + * @property {?PluginObjectItem[]} [scene] - Scene plugins to install. + * @property {string[]} [default] - The default set of scene plugins (names). + * @property {string[]} [defaultMerge] - Plugins to *add* to the default set of scene plugins. */ /** * @typedef {object} GameConfig * - * @property {(integer|string)} [width=1024] - [description] - * @property {(integer|string)} [height=768] - [description] - * @property {number} [zoom=1] - [description] - * @property {number} [resolution=1] - [description] - * @property {number} [type=CONST.AUTO] - [description] - * @property {*} [parent=null] - [description] + * @property {(integer|string)} [width=1024] - The width of the game, in game pixels. + * @property {(integer|string)} [height=768] - The height of the game, in game pixels. + * @property {number} [zoom=1] - Simple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc. + * @property {number} [resolution=1] - The size of each game pixel, in canvas pixels. Values larger than 1 are "high" resolution. + * @property {number} [type=CONST.AUTO] - Which renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS. + * @property {(HTMLElement|string)} [parent=null] - The DOM element that will contain the game canvas, or its `id`. If null (the default) or if the named element doesn't exist, the game canvas is inserted directly into the document body. * @property {HTMLCanvasElement} [canvas=null] - Provide your own Canvas element for Phaser to use instead of creating one. - * @property {string} [canvasStyle=null] - [description] + * @property {string} [canvasStyle=null] - CSS styles to apply to the game canvas instead of Phaser's default styles. * @property {CanvasRenderingContext2D} [context] - Provide your own Canvas Context for Phaser to use, instead of creating one. - * @property {object} [scene=null] - [description] - * @property {string[]} [seed] - [description] - * @property {string} [title=''] - [description] - * @property {string} [url='http://phaser.io'] - [description] - * @property {string} [version=''] - [description] - * @property {boolean} [autoFocus=true] - Automatically call window.focus() when the game boots. - * @property {(boolean|InputConfig)} [input] - [description] - * @property {boolean} [disableContextMenu=false] - [description] - * @property {(boolean|BannerConfig)} [banner=false] - [description] + * @property {object} [scene=null] - A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have { active: true }. + * @property {string[]} [seed] - Seed for the random number generator. + * @property {string} [title=''] - The title of the game. Shown in the browser console. + * @property {string} [url='http://phaser.io'] - The URL of the game. Shown in the browser console. + * @property {string} [version=''] - The version of the game. Shown in the browser console. + * @property {boolean} [autoFocus=true] - Automatically call window.focus() when the game boots. Usually necessary to capture input events if the game is in a separate frame. + * @property {(boolean|InputConfig)} [input] - Input configuration, or `false` to disable all game input. + * @property {boolean} [disableContextMenu=false] - Disable the browser's default 'contextmenu' event (usually triggered by a right-button mouse click). + * @property {(boolean|BannerConfig)} [banner=false] - Configuration for the banner printed in the browser console when the game starts. * @property {DOMContainerConfig} [dom] - The DOM Container configuration object. - * @property {FPSConfig} [fps] - [description] - * @property {RenderConfig} [render] - [description] - * @property {(string|number)} [backgroundColor=0x000000] - [description] - * @property {CallbacksConfig} [callbacks] - [description] - * @property {LoaderConfig} [loader] - [description] - * @property {ImagesConfig} [images] - [description] - * @property {object} [physics] - [description] - * @property {PluginObject|PluginObjectItem[]} [plugins] - [description] + * @property {FPSConfig} [fps] - Game loop configuration. + * @property {RenderConfig} [render] - Game renderer configuration. + * @property {(string|number)} [backgroundColor=0x000000] - The background color of the game canvas. The default is black. + * @property {CallbacksConfig} [callbacks] - Optional callbacks to run before or after game boot. + * @property {LoaderConfig} [loader] - Loader configuration. + * @property {ImagesConfig} [images] - Images configuration. + * @property {object} [physics] - Physics configuration. + * @property {PluginObject|PluginObjectItem[]} [plugins] - Plugins to install. */ /** * @classdesc - * [description] + * The active game configuration settings, parsed from a {@link GameConfig} object. * * @class Config * @memberOf Phaser.Boot @@ -143456,6 +144081,8 @@ var ValueToColor = __webpack_require__(178); * @since 3.0.0 * * @param {GameConfig} [GameConfig] - The configuration object for your Phaser Game instance. + * + * @see Phaser.Game#config */ var Config = new Class({ @@ -143522,7 +144149,7 @@ var Config = new Class({ } /** - * @const {number} Phaser.Boot.Config#renderType - [description] + * @const {number} Phaser.Boot.Config#renderType - Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) */ this.renderType = GetValue(config, 'type', CONST.AUTO); @@ -143554,17 +144181,17 @@ var Config = new Class({ MATH.RND.init(this.seed); /** - * @const {string} Phaser.Boot.Config#gameTitle - [description] + * @const {string} Phaser.Boot.Config#gameTitle - The title of the game. */ this.gameTitle = GetValue(config, 'title', ''); /** - * @const {string} Phaser.Boot.Config#gameURL - [description] + * @const {string} Phaser.Boot.Config#gameURL - The URL of the game. */ this.gameURL = GetValue(config, 'url', 'https://phaser.io'); /** - * @const {string} Phaser.Boot.Config#gameVersion - [description] + * @const {string} Phaser.Boot.Config#gameVersion - The version of the game. */ this.gameVersion = GetValue(config, 'version', ''); @@ -143643,7 +144270,7 @@ var Config = new Class({ this.inputGamepadEventTarget = GetValue(config, 'input.gamepad.target', window); /** - * @const {boolean} Phaser.Boot.Config#disableContextMenu - [description] + * @const {boolean} Phaser.Boot.Config#disableContextMenu - Set to `true` to disable context menu. Default value is `false`. */ this.disableContextMenu = GetValue(config, 'disableContextMenu', false); @@ -143713,7 +144340,7 @@ var Config = new Class({ this.roundPixels = GetValue(renderConfig, 'roundPixels', false); /** - * @const {boolean} Phaser.Boot.Config#pixelArt - [description] + * @const {boolean} Phaser.Boot.Config#pixelArt - Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode). */ this.pixelArt = GetValue(renderConfig, 'pixelArt', false); @@ -143813,7 +144440,7 @@ var Config = new Class({ this.loaderPath = GetValue(config, 'loader.path', ''); /** - * @const {integer} Phaser.Boot.Config#loaderMaxParallelDownloads - [description] + * @const {integer} Phaser.Boot.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). */ this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', 32); @@ -143861,9 +144488,9 @@ var Config = new Class({ * { key: 'WireFramePlugin', plugin: WireFramePlugin, systemKey: 'wireFramePlugin', sceneKey: 'wireframe' } * ], * default: [], OR - * defaultMerge: { + * defaultMerge: [ * 'ModPlayer' - * } + * ] * } */ @@ -145650,20 +146277,20 @@ module.exports = GetOffsetX; module.exports = { CenterOn: __webpack_require__(412), - GetBottom: __webpack_require__(47), + GetBottom: __webpack_require__(48), GetCenterX: __webpack_require__(75), GetCenterY: __webpack_require__(72), - GetLeft: __webpack_require__(45), + GetLeft: __webpack_require__(46), GetOffsetX: __webpack_require__(919), GetOffsetY: __webpack_require__(918), - GetRight: __webpack_require__(43), - GetTop: __webpack_require__(41), - SetBottom: __webpack_require__(46), + GetRight: __webpack_require__(44), + GetTop: __webpack_require__(42), + SetBottom: __webpack_require__(47), SetCenterX: __webpack_require__(74), SetCenterY: __webpack_require__(73), - SetLeft: __webpack_require__(44), - SetRight: __webpack_require__(42), - SetTop: __webpack_require__(40) + SetLeft: __webpack_require__(45), + SetRight: __webpack_require__(43), + SetTop: __webpack_require__(41) }; @@ -145678,10 +146305,10 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetRight = __webpack_require__(43); -var GetTop = __webpack_require__(41); -var SetBottom = __webpack_require__(46); -var SetRight = __webpack_require__(42); +var GetRight = __webpack_require__(44); +var GetTop = __webpack_require__(42); +var SetBottom = __webpack_require__(47); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned next to the top right position of the other. @@ -145722,10 +146349,10 @@ module.exports = TopRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetLeft = __webpack_require__(45); -var GetTop = __webpack_require__(41); -var SetBottom = __webpack_require__(46); -var SetLeft = __webpack_require__(44); +var GetLeft = __webpack_require__(46); +var GetTop = __webpack_require__(42); +var SetBottom = __webpack_require__(47); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the top left position of the other. @@ -145767,8 +146394,8 @@ module.exports = TopLeft; */ var GetCenterX = __webpack_require__(75); -var GetTop = __webpack_require__(41); -var SetBottom = __webpack_require__(46); +var GetTop = __webpack_require__(42); +var SetBottom = __webpack_require__(47); var SetCenterX = __webpack_require__(74); /** @@ -145810,10 +146437,10 @@ module.exports = TopCenter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetRight = __webpack_require__(43); -var GetTop = __webpack_require__(41); -var SetLeft = __webpack_require__(44); -var SetTop = __webpack_require__(40); +var GetRight = __webpack_require__(44); +var GetTop = __webpack_require__(42); +var SetLeft = __webpack_require__(45); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the right top position of the other. @@ -145855,9 +146482,9 @@ module.exports = RightTop; */ var GetCenterY = __webpack_require__(72); -var GetRight = __webpack_require__(43); +var GetRight = __webpack_require__(44); var SetCenterY = __webpack_require__(73); -var SetLeft = __webpack_require__(44); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the right center position of the other. @@ -145898,10 +146525,10 @@ module.exports = RightCenter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetRight = __webpack_require__(43); -var SetBottom = __webpack_require__(46); -var SetLeft = __webpack_require__(44); +var GetBottom = __webpack_require__(48); +var GetRight = __webpack_require__(44); +var SetBottom = __webpack_require__(47); +var SetLeft = __webpack_require__(45); /** * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other. @@ -145942,10 +146569,10 @@ module.exports = RightBottom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetLeft = __webpack_require__(45); -var GetTop = __webpack_require__(41); -var SetRight = __webpack_require__(42); -var SetTop = __webpack_require__(40); +var GetLeft = __webpack_require__(46); +var GetTop = __webpack_require__(42); +var SetRight = __webpack_require__(43); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the left top position of the other. @@ -145987,9 +146614,9 @@ module.exports = LeftTop; */ var GetCenterY = __webpack_require__(72); -var GetLeft = __webpack_require__(45); +var GetLeft = __webpack_require__(46); var SetCenterY = __webpack_require__(73); -var SetRight = __webpack_require__(42); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned next to the left center position of the other. @@ -146030,10 +146657,10 @@ module.exports = LeftCenter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetLeft = __webpack_require__(45); -var SetBottom = __webpack_require__(46); -var SetRight = __webpack_require__(42); +var GetBottom = __webpack_require__(48); +var GetLeft = __webpack_require__(46); +var SetBottom = __webpack_require__(47); +var SetRight = __webpack_require__(43); /** * Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other. @@ -146074,10 +146701,10 @@ module.exports = LeftBottom; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetRight = __webpack_require__(43); -var SetRight = __webpack_require__(42); -var SetTop = __webpack_require__(40); +var GetBottom = __webpack_require__(48); +var GetRight = __webpack_require__(44); +var SetRight = __webpack_require__(43); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other. @@ -146118,10 +146745,10 @@ module.exports = BottomRight; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); -var GetLeft = __webpack_require__(45); -var SetLeft = __webpack_require__(44); -var SetTop = __webpack_require__(40); +var GetBottom = __webpack_require__(48); +var GetLeft = __webpack_require__(46); +var SetLeft = __webpack_require__(45); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other. @@ -146162,10 +146789,10 @@ module.exports = BottomLeft; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var GetBottom = __webpack_require__(47); +var GetBottom = __webpack_require__(48); var GetCenterX = __webpack_require__(75); var SetCenterX = __webpack_require__(74); -var SetTop = __webpack_require__(40); +var SetTop = __webpack_require__(41); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other. @@ -147165,9 +147792,9 @@ var Path = new Class({ * @method Phaser.Curves.Path#getPoints * @since 3.0.0 * - * @param {integer} [divisions=12] - [description] + * @param {integer} [divisions=12] - The number of points to divide the path in to. * - * @return {Phaser.Math.Vector2[]} [description] + * @return {Phaser.Math.Vector2[]} An array of Vector2 objects that containing the points along the Path. */ getPoints: function (divisions) { @@ -147221,7 +147848,7 @@ var Path = new Class({ * * @generic {Phaser.Math.Vector2} O - [out,$return] * - * @param {Phaser.Math.Vector2} [out] - [description] + * @param {Phaser.Math.Vector2} [out] - `Vector2` instance that should be used for storing the result. If `undefined` a new `Vector2` will be created. * * @return {Phaser.Math.Vector2} [description] */ @@ -147694,7 +148321,7 @@ var Camera = __webpack_require__(379); var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); var PluginCache = __webpack_require__(15); -var RectangleContains = __webpack_require__(38); +var RectangleContains = __webpack_require__(39); /** * @typedef {object} InputJSONCameraObject @@ -152300,7 +152927,7 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Wrap = __webpack_require__(52); +var Wrap = __webpack_require__(53); /** * Wrap each item's coordinates within a rectangle's area. @@ -152349,7 +152976,8 @@ module.exports = WrapInRectangle; */ /** - * [description] + * Takes an array of Game Objects and toggles the visibility of each one. + * Those previously `visible = false` will become `visible = true`, and vice versa. * * @function Phaser.Actions.ToggleVisible * @since 3.0.0 @@ -152384,7 +153012,16 @@ module.exports = ToggleVisible; */ /** - * [description] + * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, the + * calculated spread value. + * + * The spread value is derived from the given `min` and `max` values and the total number of items in the array.//#endregion + * + * For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call: + * + * ```javascript + * Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1); + * ``` * * @function Phaser.Actions.Spread * @since 3.0.0 @@ -152392,12 +153029,12 @@ module.exports = ToggleVisible; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {string} property - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} [inc=false] - [description] + * @param {string} property - The property of the Game Object to spread. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) * - * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that were passed to this Action. */ var Spread = function (items, property, min, max, inc) { @@ -152440,7 +153077,9 @@ module.exports = Spread; var MathSmoothStep = __webpack_require__(181); /** - * [description] + * Smoothstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. * * @function Phaser.Actions.SmoothStep * @since 3.0.0 @@ -152448,10 +153087,10 @@ var MathSmoothStep = __webpack_require__(181); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {string} property - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} inc - [description] + * @param {string} property - The property of the Game Object to interpolate. + * @param {number} min - The minimum interpolation value. + * @param {number} max - The maximum interpolation value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -152496,7 +153135,9 @@ module.exports = SmoothStep; var MathSmootherStep = __webpack_require__(182); /** - * [description] + * Smootherstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. * * @function Phaser.Actions.SmootherStep * @since 3.0.0 @@ -152504,10 +153145,10 @@ var MathSmootherStep = __webpack_require__(182); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {string} property - [description] - * @param {number} min - [description] - * @param {number} max - [description] - * @param {number} inc - [description] + * @param {string} property - The property of the Game Object to interpolate. + * @param {number} min - The minimum interpolation value. + * @param {number} max - The maximum interpolation value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -152585,9 +153226,11 @@ module.exports = Shuffle; var Vector2 = __webpack_require__(3); /** - * Iterate through items changing the position of each element to - * be that of the element that came before it in the array (or after it if direction = 1) + * Iterate through the items array changing the position of each element to be that of the element that came before + * it in the array (or after it if direction = 1) + * * The first items position is set to x/y. + * * The final x/y coords are returned * * @function Phaser.Actions.ShiftPosition @@ -152597,10 +153240,10 @@ var Vector2 = __webpack_require__(3); * @generic {Phaser.Math.Vector2} O - [output,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {number} x - [description] - * @param {number} y - [description] - * @param {integer} [direction=0] - [description] - * @param {(Phaser.Math.Vector2|object)} [output] - [description] + * @param {number} x - The x coordinate to place the first item in the array at. + * @param {number} y - The y coordinate to place the first item in the array at. + * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {(Phaser.Math.Vector2|object)} [output] - An optional objec to store the final objects position in. * * @return {Phaser.Math.Vector2} The output vector. */ @@ -152878,7 +153521,7 @@ module.exports = SetVisible; */ /** - * [description] + * Takes an array of Game Objects, or any objects that have the public method setTint() and then updates it to the given value(s). You can specify tint color per corner or provide only one color value for `topLeft` parameter, in which case whole item will be tinted with that color. * * @function Phaser.Actions.SetTint * @since 3.0.0 @@ -152886,10 +153529,10 @@ module.exports = SetVisible; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {number} topLeft - [description] - * @param {number} [topRight] - [description] - * @param {number} [bottomLeft] - [description] - * @param {number} [bottomRight] - [description] + * @param {number} topLeft - The tint being applied to top-left corner of item. If other parameters are given no value, this tint will be applied to whole item. + * @param {number} [topRight] - The tint to be applied to top-right corner of item. + * @param {number} [bottomLeft] - The tint to be applied to the bottom-left corner of item. + * @param {number} [bottomRight] - The tint to be applied to the bottom-right corner of item. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153134,7 +153777,9 @@ module.exports = SetOrigin; */ /** - * [description] + * Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks. + * + * @see {@link Phaser.GameObjects.GameObject#setInteractive} * * @function Phaser.Actions.SetHitArea * @since 3.0.0 @@ -153142,8 +153787,8 @@ module.exports = SetOrigin; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {*} hitArea - [description] - * @param {HitAreaCallback} hitAreaCallback - [description] + * @param {*} hitArea - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {HitAreaCallback} hitAreaCallback - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153424,7 +154069,7 @@ module.exports = ScaleX; var MathRotateAroundDistance = __webpack_require__(183); /** - * [description] + * Rotates an array of Game Objects around a point by the given angle and distance. * * @function Phaser.Actions.RotateAroundDistance * @since 3.0.0 @@ -153471,7 +154116,7 @@ module.exports = RotateAroundDistance; */ var RotateAroundDistance = __webpack_require__(183); -var DistanceBetween = __webpack_require__(51); +var DistanceBetween = __webpack_require__(52); /** * Rotates each item around the given point by the given angle. @@ -153560,7 +154205,9 @@ module.exports = Rotate; var Random = __webpack_require__(184); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomTriangle * @since 3.0.0 @@ -153568,7 +154215,7 @@ var Random = __webpack_require__(184); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Triangle} triangle - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153598,7 +154245,7 @@ module.exports = RandomTriangle; var Random = __webpack_require__(187); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Ellipse. * * @function Phaser.Actions.RandomRectangle * @since 3.0.0 @@ -153606,7 +154253,7 @@ var Random = __webpack_require__(187); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153636,7 +154283,9 @@ module.exports = RandomRectangle; var Random = __webpack_require__(188); /** - * [description] + * Takes an array of Game Objects and positions them at random locations on the Line. + * + * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomLine * @since 3.0.0 @@ -153644,7 +154293,7 @@ var Random = __webpack_require__(188); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Line} line - The Line to position the Game Objects randomly on. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153674,7 +154323,9 @@ module.exports = RandomLine; var Random = __webpack_require__(185); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomEllipse * @since 3.0.0 @@ -153682,7 +154333,7 @@ var Random = __webpack_require__(185); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Ellipse} ellipse - [description] + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153712,7 +154363,9 @@ module.exports = RandomEllipse; var Random = __webpack_require__(191); /** - * [description] + * Takes an array of Game Objects and positions them at random locations within the Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.RandomCircle * @since 3.0.0 @@ -153720,7 +154373,7 @@ var Random = __webpack_require__(191); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Circle} circle - [description] + * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects within. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153784,11 +154437,12 @@ module.exports = PlayAnimation; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -// var GetPointsOnLine = require('../geom/line/GetPointsOnLine'); var BresenhamPoints = __webpack_require__(386); /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.PlaceOnTriangle * @since 3.0.0 @@ -153796,8 +154450,8 @@ var BresenhamPoints = __webpack_require__(386); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Triangle} triangle - [description] - * @param {number} [stepRate=1] - [description] + * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects on. + * @param {number} [stepRate=1] - An optional step rate, to increase or decrease the packing of the Game Objects on the lines. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153848,14 +154502,11 @@ var MarchingAnts = __webpack_require__(389); var RotateLeft = __webpack_require__(388); var RotateRight = __webpack_require__(387); -// Place the items in the array around the perimeter of the given rectangle. - -// Placement starts from the top-left of the rectangle, and proceeds in a -// clockwise direction. If the shift parameter is given you can offset where -// placement begins. - /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. + * + * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. + * If the `shift` parameter is given you can offset where placement begins. * * @function Phaser.Actions.PlaceOnRectangle * @since 3.0.0 @@ -153863,8 +154514,8 @@ var RotateRight = __webpack_require__(387); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Rectangle} rect - [description] - * @param {integer} [shift=1] - [description] + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects on. + * @param {integer} [shift=1] - An optional positional offset. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153908,7 +154559,7 @@ module.exports = PlaceOnRectangle; var GetPoints = __webpack_require__(189); /** - * [description] + * Positions an array of Game Objects on evenly spaced points of a Line. * * @function Phaser.Actions.PlaceOnLine * @since 3.0.0 @@ -153916,7 +154567,7 @@ var GetPoints = __webpack_require__(189); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Line} line - [description] + * @param {Phaser.Geom.Line} line - The Line to position the Game Objects on. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -153950,7 +154601,9 @@ module.exports = PlaceOnLine; */ /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of an Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.PlaceOnEllipse * @since 3.0.0 @@ -153958,9 +154611,9 @@ module.exports = PlaceOnLine; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Ellipse} ellipse - [description] - * @param {number} [startAngle=0] - [description] - * @param {number} [endAngle=6.28] - [description] + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects on. + * @param {number} [startAngle=0] - Optional angle to start position from, in radians. + * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -154000,7 +154653,9 @@ module.exports = PlaceOnEllipse; */ /** - * [description] + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * * @function Phaser.Actions.PlaceOnCircle * @since 3.0.0 @@ -154008,9 +154663,9 @@ module.exports = PlaceOnEllipse; * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. - * @param {Phaser.Geom.Circle} circle - [description] - * @param {number} [startAngle=0] - [description] - * @param {number} [endAngle=6.28] - [description] + * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects on. + * @param {number} [startAngle=0] - Optional angle to start position from, in radians. + * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -155080,7 +155735,7 @@ module.exports = Size; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var ScaleModes = __webpack_require__(93); +var ScaleModes = __webpack_require__(94); /** * Provides methods used for getting and setting the scale of a Game Object. @@ -156301,7 +156956,7 @@ module.exports = GetFirst; /** * @callback CallCallback * - * @param {Phaser.GameObjects.GameObject} item - [description] + * @param {Phaser.GameObjects.GameObject} item - The Game Object to run the callback on. */ /** @@ -156843,7 +157498,7 @@ var MatterBody = __webpack_require__(67); var MatterEvents = __webpack_require__(195); var MatterTileBody = __webpack_require__(504); var MatterWorld = __webpack_require__(499); -var Vector = __webpack_require__(80); +var Vector = __webpack_require__(81); /** * @classdesc @@ -156855,7 +157510,7 @@ var Vector = __webpack_require__(80); * @constructor * @since 3.0.0 * - * @param {Phaser.Scene} scene - [description] + * @param {Phaser.Scene} scene - The Scene to which this Matter World instance belongs. * @param {object} config - [description] */ var World = new Class({ @@ -156869,7 +157524,7 @@ var World = new Class({ EventEmitter.call(this); /** - * [description] + * The Scene to which this Matter World instance belongs. * * @name Phaser.Physics.Matter.World#scene * @type {Phaser.Scene} @@ -156878,7 +157533,7 @@ var World = new Class({ this.scene = scene; /** - * [description] + * An instance of the MatterJS Engine. * * @name Phaser.Physics.Matter.World#engine * @type {MatterJS.Engine} @@ -156936,7 +157591,7 @@ var World = new Class({ } /** - * [description] + * A flag that toggles if the world is enabled or not. * * @name Phaser.Physics.Matter.World#enabled * @type {boolean} @@ -157002,7 +157657,7 @@ var World = new Class({ this.autoUpdate = GetValue(config, 'autoUpdate', true); /** - * [description] + * A flag that controls if the debug graphics will be drawn to or not. * * @name Phaser.Physics.Matter.World#drawDebug * @type {boolean} @@ -157012,7 +157667,7 @@ var World = new Class({ this.drawDebug = GetValue(config, 'debug', false); /** - * [description] + * An instance of the Graphics object the debug bodies are drawn to, if enabled. * * @name Phaser.Physics.Matter.World#debugGraphic * @type {Phaser.GameObjects.Graphics} @@ -157021,21 +157676,27 @@ var World = new Class({ this.debugGraphic; /** - * [description] + * The default configuration values. * * @name Phaser.Physics.Matter.World#defaults * @type {object} * @since 3.0.0 */ this.defaults = { - debugShowBody: GetValue(config, 'debugShowBody', true), - debugShowStaticBody: GetValue(config, 'debugShowStaticBody', true), - debugShowVelocity: GetValue(config, 'debugShowVelocity', true), - bodyDebugColor: GetValue(config, 'debugBodyColor', 0xff00ff), - staticBodyDebugColor: GetValue(config, 'debugBodyColor', 0x0000ff), - velocityDebugColor: GetValue(config, 'debugVelocityColor', 0x00ff00), - debugShowJoint: GetValue(config, 'debugShowJoint', true), - jointDebugColor: GetValue(config, 'debugJointColor', 0x000000) + debugShowBody: GetFastValue(config, 'debugShowBody', true), + debugShowStaticBody: GetFastValue(config, 'debugShowStaticBody', true), + debugShowVelocity: GetFastValue(config, 'debugShowVelocity', true), + bodyDebugColor: GetFastValue(config, 'debugBodyColor', 0xff00ff), + bodyDebugFillColor: GetFastValue(config, 'bodyDebugFillColor', 0xe3a7e3), + staticBodyDebugColor: GetFastValue(config, 'debugBodyColor', 0x0000ff), + velocityDebugColor: GetFastValue(config, 'debugVelocityColor', 0x00ff00), + debugShowJoint: GetFastValue(config, 'debugShowJoint', true), + jointDebugColor: GetFastValue(config, 'debugJointColor', 0x000000), + debugWireframes: GetFastValue(config, 'debugWireframes', true), + debugShowInternalEdges: GetFastValue(config, 'debugShowInternalEdges', false), + debugShowConvexHulls: GetFastValue(config, 'debugShowConvexHulls', false), + debugConvexHullColor: GetFastValue(config, 'debugConvexHullColor', 0xaaaaaa), + debugShowSleeping: GetFastValue(config, 'debugShowSleeping', false) }; if (this.drawDebug) @@ -157265,18 +157926,18 @@ var World = new Class({ }, /** - * [description] + * Creates a rectangle Matter body and adds it to the world. * * @method Phaser.Physics.Matter.World#create * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] - * @param {object} options - [description] + * @param {number} x - The horizontal position of the body in the world. + * @param {number} y - The vertical position of the body in the world. + * @param {number} width - The width of the body. + * @param {number} height - The height of the body. + * @param {object} options - Optional Matter configuration object. * - * @return {MatterJS.Body} [description] + * @return {MatterJS.Body} The Matter.js body that was created. */ create: function (x, y, width, height, options) { @@ -157530,9 +158191,10 @@ var World = new Class({ }, /** - * [description] + * Handles the rendering of bodies and debug information to the debug Graphics object, if enabled. * * @method Phaser.Physics.Matter.World#postUpdate + * @private * @since 3.0.0 */ postUpdate: function () @@ -157542,135 +158204,325 @@ var World = new Class({ return; } - var graphics = this.debugGraphic; + this.debugGraphic.clear(); + var bodies = Composite.allBodies(this.localWorld); - graphics.clear(); - graphics.lineStyle(1, this.defaults.bodyDebugColor); + if (this.defaults.debugWireframes) + { + if (this.defaults.debugShowConvexHulls) + { + this.renderConvexHulls(bodies); + } + + this.renderWireframes(bodies); + } + else + { + this.renderBodies(bodies); + } + + if (this.defaults.debugShowJoint) + { + this.renderJoints(); + } + }, + + /** + * Renders the debug convex hulls from the given array of bodies. + * + * @method Phaser.Physics.Matter.World#renderConvexHulls + * @private + * @since 3.14.0 + * + * @param {array} bodies - An array of bodies from the localWorld. + */ + renderConvexHulls: function (bodies) + { + var graphics = this.debugGraphic; + + graphics.lineStyle(1, this.defaults.debugConvexHullColor); + graphics.beginPath(); - var i,j; - - for (i = 0; i < bodies.length; i++) + for (var i = 0; i < bodies.length; i++) { - if (!bodies[i].render.visible) + var body = bodies[i]; + + if (!body.render.visible || body.parts.length === 1) { continue; } - // Handle drawing both single bodies and compound bodies. If compound, draw both the - // convex hull (first part) and the rest of the bodies. - for (j = 0; j < bodies[i].parts.length; j++) + graphics.moveTo(body.vertices[0].x, body.vertices[0].y); + + for (var j = 1; j < body.vertices.length; j++) { - var body = bodies[i].parts[j]; + graphics.lineTo(body.vertices[j].x, body.vertices[j].y); + } + + graphics.lineTo(body.vertices[0].x, body.vertices[0].y); + } - var vertices = body.vertices; + graphics.strokePath(); + }, - graphics.moveTo(vertices[0].x, vertices[0].y); + /** + * Renders the wireframes of the given array of bodies. + * + * @method Phaser.Physics.Matter.World#renderWireframes + * @private + * @since 3.14.0 + * + * @param {array} bodies - An array of bodies from the localWorld. + */ + renderWireframes: function (bodies) + { + var graphics = this.debugGraphic; + var showInternalEdges = this.defaults.debugShowInternalEdges; - for (var k = 1; k < vertices.length; k++) + graphics.lineStyle(1, this.defaults.bodyDebugColor); + + graphics.beginPath(); + + for (var i = 0; i < bodies.length; i++) + { + var body = bodies[i]; + + if (!body.render.visible) + { + continue; + } + + for (var k = (body.parts.length > 1) ? 1 : 0; k < body.parts.length; k++) + { + var part = body.parts[k]; + + var vertLength = part.vertices.length; + + graphics.moveTo(part.vertices[0].x, part.vertices[0].y); + + for (var j = 1; j < vertLength; j++) { - graphics.lineTo(vertices[k].x, vertices[k].y); + if (!part.vertices[j - 1].isInternal || showInternalEdges) + { + graphics.lineTo(part.vertices[j].x, part.vertices[j].y); + } + else + { + graphics.moveTo(part.vertices[j].x, part.vertices[j].y); + } + + if (part.vertices[j].isInternal && !showInternalEdges) + { + graphics.moveTo(part.vertices[(j + 1) % vertLength].x, part.vertices[(j + 1) % vertLength].y); + } } - - graphics.lineTo(vertices[0].x, vertices[0].y); - - graphics.strokePath(); + + graphics.lineTo(part.vertices[0].x, part.vertices[0].y); } } - graphics.closePath(); + graphics.strokePath(); + }, - if (this.defaults.debugShowJoint) + /** + * Renders the array of bodies. + * + * @method Phaser.Physics.Matter.World#renderBodies + * @private + * @since 3.14.0 + * + * @param {array} bodies - An array of bodies from the localWorld. + */ + renderBodies: function (bodies) + { + var graphics = this.debugGraphic; + + var showInternalEdges = this.defaults.debugShowInternalEdges || !this.defaults.debugWireframes; + var showSleeping = this.defaults.debugShowSleeping; + var wireframes = this.defaults.debugWireframes; + + var body; + var part; + var i; + var k; + + for (i = 0; i < bodies.length; i++) { - graphics.lineStyle(2, this.defaults.jointDebugColor); + body = bodies[i]; - // Render constraints - var constraints = Composite.allConstraints(this.localWorld); - - for (i = 0; i < constraints.length; i++) + if (!body.render.visible) { - var constraint = constraints[i]; + continue; + } - if (!constraint.render.visible || !constraint.pointA || !constraint.pointB) + // Handle compound parts + for (k = body.parts.length > 1 ? 1 : 0; k < body.parts.length; k++) + { + part = body.parts[k]; + + if (!part.render.visible) { continue; } - if (constraint.render.lineWidth) + if (showSleeping && body.isSleeping) { - graphics.lineStyle(constraint.render.lineWidth, Common.colorToNumber(constraint.render.strokeStyle)); - } - - var bodyA = constraint.bodyA; - var bodyB = constraint.bodyB; - var start; - var end; - - if (bodyA) - { - start = Vector.add(bodyA.position, constraint.pointA); + graphics.lineStyle(1, this.defaults.bodyDebugColor, 0.5 * part.render.opacity); + graphics.fillStyle(this.defaults.bodyDebugColor, 0.5 * part.render.opacity); } else { - start = constraint.pointA; + graphics.lineStyle(1, this.defaults.bodyDebugColor, part.render.opacity); + graphics.fillStyle(this.defaults.bodyDebugColor, part.render.opacity); } - if (constraint.render.type === 'pin') + // Part polygon + if (part.circleRadius) { graphics.beginPath(); - graphics.arc(start.x, start.y, 3, 0, 2 * Math.PI); - graphics.closePath(); + graphics.arc(part.position.x, part.position.y, part.circleRadius, 0, 2 * Math.PI); } else { - if (bodyB) - { - end = Vector.add(bodyB.position, constraint.pointB); - } - else - { - end = constraint.pointB; - } - graphics.beginPath(); - graphics.moveTo(start.x, start.y); + graphics.moveTo(part.vertices[0].x, part.vertices[0].y); - if (constraint.render.type === 'spring') + var vertLength = part.vertices.length; + + for (var j = 1; j < vertLength; j++) { - var delta = Vector.sub(end, start); - var normal = Vector.perp(Vector.normalise(delta)); - var coils = Math.ceil(Common.clamp(constraint.length / 5, 12, 20)); - var offset; - - for (j = 1; j < coils; j += 1) + if (!part.vertices[j - 1].isInternal || showInternalEdges) { - offset = (j % 2 === 0) ? 1 : -1; + graphics.lineTo(part.vertices[j].x, part.vertices[j].y); + } + else + { + graphics.moveTo(part.vertices[j].x, part.vertices[j].y); + } - graphics.lineTo( - start.x + delta.x * (j / coils) + normal.x * offset * 4, - start.y + delta.y * (j / coils) + normal.y * offset * 4 - ); + if (part.vertices[j].isInternal && !showInternalEdges) + { + graphics.moveTo(part.vertices[(j + 1) % part.vertices.length].x, part.vertices[(j + 1) % part.vertices.length].y); } } + + graphics.lineTo(part.vertices[0].x, part.vertices[0].y); - graphics.lineTo(end.x, end.y); + graphics.closePath(); } - if (constraint.render.lineWidth) + if (!wireframes) + { + graphics.fillPath(); + } + else { graphics.strokePath(); } + } + } + }, - if (constraint.render.anchors) + /** + * Renders world constraints. + * + * @method Phaser.Physics.Matter.World#renderJoints + * @private + * @since 3.14.0 + */ + renderJoints: function () + { + var graphics = this.debugGraphic; + + graphics.lineStyle(2, this.defaults.jointDebugColor); + + // Render constraints + var constraints = Composite.allConstraints(this.localWorld); + + for (var i = 0; i < constraints.length; i++) + { + var constraint = constraints[i]; + + if (!constraint.render.visible || !constraint.pointA || !constraint.pointB) + { + continue; + } + + if (constraint.render.lineWidth) + { + graphics.lineStyle(constraint.render.lineWidth, Common.colorToNumber(constraint.render.strokeStyle)); + } + + var bodyA = constraint.bodyA; + var bodyB = constraint.bodyB; + var start; + var end; + + if (bodyA) + { + start = Vector.add(bodyA.position, constraint.pointA); + } + else + { + start = constraint.pointA; + } + + if (constraint.render.type === 'pin') + { + graphics.beginPath(); + graphics.arc(start.x, start.y, 3, 0, 2 * Math.PI); + graphics.closePath(); + } + else + { + if (bodyB) { - graphics.fillStyle(Common.colorToNumber(constraint.render.strokeStyle)); - graphics.beginPath(); - graphics.arc(start.x, start.y, 6, 0, 2 * Math.PI); - graphics.arc(end.x, end.y, 6, 0, 2 * Math.PI); - graphics.closePath(); - graphics.fillPath(); + end = Vector.add(bodyB.position, constraint.pointB); } + else + { + end = constraint.pointB; + } + + graphics.beginPath(); + graphics.moveTo(start.x, start.y); + + if (constraint.render.type === 'spring') + { + var delta = Vector.sub(end, start); + var normal = Vector.perp(Vector.normalise(delta)); + var coils = Math.ceil(Common.clamp(constraint.length / 5, 12, 20)); + var offset; + + for (var j = 1; j < coils; j += 1) + { + offset = (j % 2 === 0) ? 1 : -1; + + graphics.lineTo( + start.x + delta.x * (j / coils) + normal.x * offset * 4, + start.y + delta.y * (j / coils) + normal.y * offset * 4 + ); + } + } + + graphics.lineTo(end.x, end.y); + } + + if (constraint.render.lineWidth) + { + graphics.strokePath(); + } + + if (constraint.render.anchors) + { + graphics.fillStyle(Common.colorToNumber(constraint.render.strokeStyle)); + graphics.beginPath(); + graphics.arc(start.x, start.y, 6, 0, 2 * Math.PI); + graphics.arc(end.x, end.y, 6, 0, 2 * Math.PI); + graphics.closePath(); + graphics.fillPath(); } } }, @@ -157718,6 +158570,11 @@ var World = new Class({ MatterWorld.clear(this.localWorld, false); Engine.clear(this.engine); + + if (this.drawDebug) + { + this.debugGraphic.destroy(); + } }, /** @@ -158263,10 +159120,10 @@ var Resolver = {}; module.exports = Resolver; -var Vertices = __webpack_require__(94); -var Vector = __webpack_require__(80); +var Vertices = __webpack_require__(76); +var Vector = __webpack_require__(81); var Common = __webpack_require__(33); -var Bounds = __webpack_require__(79); +var Bounds = __webpack_require__(80); (function() { @@ -159346,7 +160203,7 @@ var Class = __webpack_require__(0); var Components = __webpack_require__(420); var GameObject = __webpack_require__(19); var GetFastValue = __webpack_require__(2); -var Image = __webpack_require__(86); +var Image = __webpack_require__(87); var Pipeline = __webpack_require__(186); var Vector2 = __webpack_require__(3); @@ -159807,16 +160664,18 @@ var Bodies = __webpack_require__(125); /***/ (function(module, exports) { /** - * @author Richard Davey - * @copyright 2018 Photon Storm Ltd. + * @author Stefan Hedman (http://steffe.se) * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ +// v0.3.0 + module.exports = { decomp: polygonDecomp, quickDecomp: polygonQuickDecomp, isSimple: polygonIsSimple, removeCollinearPoints: polygonRemoveCollinearPoints, + removeDuplicatePoints: polygonRemoveDuplicatePoints, makeCCW: polygonMakeCCW }; @@ -159992,6 +160851,9 @@ function polygonMakeCCW(polygon){ // reverse poly if clockwise if (!isLeft(polygonAt(polygon, br - 1), polygonAt(polygon, br), polygonAt(polygon, br + 1))) { polygonReverse(polygon); + return true; + } else { + return false; } } @@ -160056,6 +160918,27 @@ function polygonCanSee(polygon, a,b) { return true; } +/** + * Check if two vertices in the polygon can see each other + * @method canSee2 + * @param {Number} a Vertex index 1 + * @param {Number} b Vertex index 2 + * @return {Boolean} + */ +function polygonCanSee2(polygon, a,b) { + // for each edge + for (var i = 0; i !== polygon.length; ++i) { + // ignore incident edges + if (i === a || i === b || (i + 1) % polygon.length === a || (i + 1) % polygon.length === b){ + continue; + } + if( lineSegmentsIntersect(polygonAt(polygon, a), polygonAt(polygon, b), polygonAt(polygon, i), polygonAt(polygon, i+1)) ){ + return false; + } + } + return true; +} + /** * Copy the polygon from vertex i to vertex j. * @method copy @@ -160339,9 +161222,12 @@ function polygonQuickDecomp(polygon, result,reflexVertices,steinerPoints,delta,m } for (var j = lowerIndex; j <= upperIndex; ++j) { - if (isLeftOn(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j)) && isRightOn(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j))) { + if ( + isLeftOn(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j)) && + isRightOn(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j)) + ) { d = sqdist(polygonAt(poly, i), polygonAt(poly, j)); - if (d < closestDist) { + if (d < closestDist && polygonCanSee2(poly, i, j)) { closestDist = d; closestIndex = j % polygon.length; } @@ -160398,6 +161284,23 @@ function polygonRemoveCollinearPoints(polygon, precision){ return num; } +/** + * Remove duplicate points in the polygon. + * @method removeDuplicatePoints + * @param {Number} [precision] The threshold to use when determining whether two points are the same. Use zero for best precision. + */ +function polygonRemoveDuplicatePoints(polygon, precision){ + for(var i=polygon.length-1; i>=1; --i){ + var pi = polygon[i]; + for(var j=i-1; j>=0; --j){ + if(points_eq(pi, polygon[j], precision)){ + polygon.splice(i,1); + continue; + } + } + } +} + /** * Check if two scalars are equal * @static @@ -160409,7 +161312,20 @@ function polygonRemoveCollinearPoints(polygon, precision){ */ function scalar_eq(a,b,precision){ precision = precision || 0; - return Math.abs(a-b) < precision; + return Math.abs(a-b) <= precision; +} + +/** + * Check if two points are equal + * @static + * @method points_eq + * @param {Array} a + * @param {Array} b + * @param {Number} [precision] + * @return {Boolean} + */ +function points_eq(a,b,precision){ + return scalar_eq(a[0],b[0],precision) && scalar_eq(a[1],b[1],precision); } @@ -161059,7 +161975,7 @@ var COLLIDES = __webpack_require__(225); var CollisionMap = __webpack_require__(1075); var EventEmitter = __webpack_require__(11); var GetFastValue = __webpack_require__(2); -var HasValue = __webpack_require__(84); +var HasValue = __webpack_require__(85); var Set = __webpack_require__(95); var Solver = __webpack_require__(1107); var TILEMAP_FORMATS = __webpack_require__(29); @@ -161068,31 +161984,31 @@ var TYPE = __webpack_require__(224); /** * @typedef {object} Phaser.Physics.Impact.WorldConfig * - * @property {number} [gravity=0] - [description] - * @property {number} [cellSize=64] - [description] - * @property {number} [timeScale=1] - [description] + * @property {number} [gravity=0] - Sets {@link Phaser.Physics.Impact.World#gravity} + * @property {number} [cellSize=64] - The size of the cells used for the broadphase pass. Increase this value if you have lots of large objects in the world. + * @property {number} [timeScale=1] - A `Number` that allows per-body time scaling, e.g. a force-field where bodies inside are in slow-motion, while others are at full speed. * @property {number} [maxStep=0.05] - [description] - * @property {boolean} [debug=false] - [description] - * @property {number} [maxVelocity=100] - [description] - * @property {boolean} [debugShowBody=true] - [description] - * @property {boolean} [debugShowVelocity=true] - [description] - * @property {number} [debugBodyColor=0xff00ff] - [description] - * @property {number} [debugVelocityColor=0x00ff00] - [description] - * @property {number} [maxVelocityX=maxVelocity] - [description] - * @property {number} [maxVelocityY=maxVelocity] - [description] - * @property {number} [minBounceVelocity=40] - [description] - * @property {number} [gravityFactor=1] - [description] - * @property {number} [bounciness=0] - [description] - * @property {(object|boolean)} [setBounds] - [description] - * @property {number} [setBounds.x=0] - [description] - * @property {number} [setBounds.y=0] - [description] - * @property {number} [setBounds.width] - [description] - * @property {number} [setBounds.height] - [description] - * @property {number} [setBounds.thickness=64] - [description] - * @property {boolean} [setBounds.left=true] - [description] - * @property {boolean} [setBounds.right=true] - [description] - * @property {boolean} [setBounds.top=true] - [description] - * @property {boolean} [setBounds.bottom=true] - [description] + * @property {boolean} [debug=false] - Sets {@link Phaser.Physics.Impact.World#debug}. + * @property {number} [maxVelocity=100] - The maximum velocity a body can move. + * @property {boolean} [debugShowBody=true] - Whether the Body's boundary is drawn to the debug display. + * @property {boolean} [debugShowVelocity=true] - Whether the Body's velocity is drawn to the debug display. + * @property {number} [debugBodyColor=0xff00ff] - The color of this Body on the debug display. + * @property {number} [debugVelocityColor=0x00ff00] - The color of the Body's velocity on the debug display. + * @property {number} [maxVelocityX=maxVelocity] - Maximum X velocity objects can move. + * @property {number} [maxVelocityY=maxVelocity] - Maximum Y velocity objects can move. + * @property {number} [minBounceVelocity=40] - The minimum velocity an object can be moving at to be considered for bounce. + * @property {number} [gravityFactor=1] - Gravity multiplier. Set to 0 for no gravity. + * @property {number} [bounciness=0] - The default bounce, or restitution, of bodies in the world. + * @property {(object|boolean)} [setBounds] - Should the world have bounds enabled by default? + * @property {number} [setBounds.x=0] - The x coordinate of the world bounds. + * @property {number} [setBounds.y=0] - The y coordinate of the world bounds. + * @property {number} [setBounds.width] - The width of the world bounds. + * @property {number} [setBounds.height] - The height of the world bounds. + * @property {number} [setBounds.thickness=64] - The thickness of the walls of the world bounds. + * @property {boolean} [setBounds.left=true] - Should the left-side world bounds wall be created? + * @property {boolean} [setBounds.right=true] - Should the right-side world bounds wall be created? + * @property {boolean} [setBounds.top=true] - Should the top world bounds wall be created? + * @property {boolean} [setBounds.bottom=true] - Should the bottom world bounds wall be created? */ /** @@ -161100,24 +162016,24 @@ var TYPE = __webpack_require__(224); * * @typedef {object} Phaser.Physics.Impact.WorldDefaults * - * @property {boolean} debugShowBody - [description] - * @property {boolean} debugShowVelocity - [description] - * @property {number} bodyDebugColor - [description] - * @property {number} velocityDebugColor - [description] - * @property {number} maxVelocityX - [description] - * @property {number} maxVelocityY - [description] - * @property {number} minBounceVelocity - [description] - * @property {number} gravityFactor - [description] - * @property {number} bounciness - [description] + * @property {boolean} debugShowBody - Whether the Body's boundary is drawn to the debug display. + * @property {boolean} debugShowVelocity - Whether the Body's velocity is drawn to the debug display. + * @property {number} bodyDebugColor - The color of this Body on the debug display. + * @property {number} velocityDebugColor - The color of the Body's velocity on the debug display. + * @property {number} maxVelocityX - Maximum X velocity objects can move. + * @property {number} maxVelocityY - Maximum Y velocity objects can move. + * @property {number} minBounceVelocity - The minimum velocity an object can be moving at to be considered for bounce. + * @property {number} gravityFactor - Gravity multiplier. Set to 0 for no gravity. + * @property {number} bounciness - The default bounce, or restitution, of bodies in the world. */ /** * @typedef {object} Phaser.Physics.Impact.WorldWalls * - * @property {?Phaser.Physics.Impact.Body} left - [description] - * @property {?Phaser.Physics.Impact.Body} right - [description] - * @property {?Phaser.Physics.Impact.Body} top - [description] - * @property {?Phaser.Physics.Impact.Body} bottom - [description] + * @property {?Phaser.Physics.Impact.Body} left - The left-side wall of the world bounds. + * @property {?Phaser.Physics.Impact.Body} right - The right-side wall of the world bounds. + * @property {?Phaser.Physics.Impact.Body} top - The top wall of the world bounds. + * @property {?Phaser.Physics.Impact.Body} bottom - The bottom wall of the world bounds. */ /** @@ -161533,12 +162449,12 @@ var World = new Class({ }, /** - * [description] + * Creates a Graphics Game Object used for debug display and enables the world for debug drawing. * * @method Phaser.Physics.Impact.World#createDebugGraphic * @since 3.0.0 * - * @return {Phaser.GameObjects.Graphics} [description] + * @return {Phaser.GameObjects.Graphics} The Graphics object created that will have the debug visuals drawn to it. */ createDebugGraphic: function () { @@ -162263,7 +163179,7 @@ module.exports = ImpactSprite; var Class = __webpack_require__(0); var Components = __webpack_require__(506); -var Image = __webpack_require__(86); +var Image = __webpack_require__(87); /** * @classdesc @@ -162568,7 +163484,7 @@ var ImpactSprite = __webpack_require__(1071); * @constructor * @since 3.0.0 * - * @param {Phaser.Physics.Impact.World} world - [description] + * @param {Phaser.Physics.Impact.World} world - A reference to the Impact Physics world. */ var Factory = new Class({ @@ -162577,7 +163493,7 @@ var Factory = new Class({ function Factory (world) { /** - * [description] + * A reference to the Impact Physics world. * * @name Phaser.Physics.Impact.Factory#world * @type {Phaser.Physics.Impact.World} @@ -162596,15 +163512,15 @@ var Factory = new Class({ }, /** - * [description] + * Creates a new ImpactBody object and adds it to the physics simulation. * * @method Phaser.Physics.Impact.Factory#body * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} x - The horizontal position of the body in the physics world. + * @param {number} y - The vertical position of the body in the physics world. + * @param {number} width - The width of the body. + * @param {number} height - The height of the body. * * @return {Phaser.Physics.Impact.ImpactBody} The ImpactBody object that was created. */ @@ -162619,7 +163535,7 @@ var Factory = new Class({ * @method Phaser.Physics.Impact.Factory#existing * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject} gameObject - [description] + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to receive the physics body. * * @return {Phaser.GameObjects.GameObject} The Game Object. */ @@ -162639,7 +163555,7 @@ var Factory = new Class({ }, /** - * [description] + * Creates a new ImpactImage object and adds it to the physics world. * * @method Phaser.Physics.Impact.Factory#image * @since 3.0.0 @@ -162661,7 +163577,7 @@ var Factory = new Class({ }, /** - * [description] + * Creates a new ImpactSprite object and adds it to the physics world. * * @method Phaser.Physics.Impact.Factory#sprite * @since 3.0.0 @@ -163551,15 +164467,15 @@ var Body = new Class({ }, /** - * [description] + * Reset the size and position of the physics body. * * @method Phaser.Physics.Impact.Body#resetSize * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] - * @param {number} width - [description] - * @param {number} height - [description] + * @param {number} x - The x coordinate to position the body. + * @param {number} y - The y coordinate to position the body. + * @param {number} width - The width of the body. + * @param {number} height - The height of the body. * * @return {Phaser.Physics.Impact.Body} This Body object. */ @@ -164168,6 +165084,7 @@ var Merge = __webpack_require__(96); var Plugin = __webpack_require__(500); var PluginCache = __webpack_require__(15); var World = __webpack_require__(1059); +var Vertices = __webpack_require__(76); /** * @classdesc @@ -164231,6 +165148,17 @@ var MatterPhysics = new Class({ */ this.add; + /** + * A reference to the `Matter.Vertices` module which contains methods for creating and manipulating sets of vertices. + * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. + * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). + * + * @name Phaser.Physics.Matter.MatterPhysics#verts + * @type {MatterJS.Vertices} + * @since 3.14.0 + */ + this.verts = Vertices; + // Matter plugins if (GetValue(this.config, 'plugins.attractors', false)) @@ -164500,7 +165428,7 @@ var Svg = {}; module.exports = Svg; -var Bounds = __webpack_require__(79); +var Bounds = __webpack_require__(80); var Common = __webpack_require__(33); (function() { @@ -164828,11 +165756,11 @@ var Query = {}; module.exports = Query; -var Vector = __webpack_require__(80); +var Vector = __webpack_require__(81); var SAT = __webpack_require__(502); -var Bounds = __webpack_require__(79); +var Bounds = __webpack_require__(80); var Bodies = __webpack_require__(125); -var Vertices = __webpack_require__(94); +var Vertices = __webpack_require__(76); (function() { @@ -164958,7 +165886,7 @@ var Vertices = __webpack_require__(94); * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Bounds = __webpack_require__(79); +var Bounds = __webpack_require__(80); var Class = __webpack_require__(0); var Composite = __webpack_require__(136); var Constraint = __webpack_require__(194); @@ -164967,7 +165895,7 @@ var GetFastValue = __webpack_require__(2); var Merge = __webpack_require__(96); var Sleeping = __webpack_require__(223); var Vector2 = __webpack_require__(3); -var Vertices = __webpack_require__(94); +var Vertices = __webpack_require__(76); /** * @classdesc @@ -165360,7 +166288,7 @@ var _FLAG = 4; // 0100 // Transform Component /** - * [description] + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. * * @name Phaser.Physics.Matter.Components.Transform * @since 3.0.0 @@ -165368,7 +166296,7 @@ var _FLAG = 4; // 0100 var Transform = { /** - * [description] + * The x position of this Game Object. * * @name Phaser.Physics.Matter.Components.Transform#x * @type {number} @@ -165391,7 +166319,7 @@ var Transform = { }, /** - * [description] + * The y position of this Game Object. * * @name Phaser.Physics.Matter.Components.Transform#y * @type {number} @@ -165414,7 +166342,7 @@ var Transform = { }, /** - * [description] + * The horizontal scale of this Game Object. * * @name Phaser.Physics.Matter.Components.Transform#scaleX * @type {number} @@ -165451,7 +166379,7 @@ var Transform = { }, /** - * [description] + * The vertical scale of this Game Object. * * @name Phaser.Physics.Matter.Components.Transform#scaleY * @type {number} @@ -165487,7 +166415,7 @@ var Transform = { }, /** - * [description] + * Use `angle` to set or get rotation of the physics body associated to this GameObject. Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally. * * @name Phaser.Physics.Matter.Components.Transform#angle * @type {number} @@ -165508,7 +166436,7 @@ var Transform = { }, /** - * [description] + * Use `rotation` to set or get the rotation of the physics body associated with this GameObject. The value when set must be in radians. * * @name Phaser.Physics.Matter.Components.Transform#rotation * @type {number} @@ -165531,15 +166459,15 @@ var Transform = { }, /** - * [description] + * Sets the position of the physics body along x and y axes. Both the parameters to this function are optional and if not passed any they default to 0. * * @method Phaser.Physics.Matter.Components.Transform#setPosition * @since 3.0.0 * - * @param {number} [x=0] - [description] - * @param {number} [y=x] - [description] + * @param {number} [x=0] - The horizontal position of the body. + * @param {number} [y=x] - The vertical position of the body. * - * @return{Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setPosition: function (x, y) { @@ -165561,7 +166489,7 @@ var Transform = { * * @param {number} [radians=0] - [description] * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setRotation: function (radians) { @@ -165580,7 +166508,7 @@ var Transform = { * @method Phaser.Physics.Matter.Components.Transform#setFixedRotation * @since 3.0.0 * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setFixedRotation: function () { @@ -165597,7 +166525,7 @@ var Transform = { * * @param {number} [degrees=0] - [description] * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setAngle: function (degrees) { @@ -165611,16 +166539,16 @@ var Transform = { }, /** - * [description] + * Sets the scale of this Game Object. * * @method Phaser.Physics.Matter.Components.Transform#setScale * @since 3.0.0 * - * @param {number} [x=1] - [description] - * @param {number} [y=x] - [description] - * @param {Phaser.Math.Vector2} [point] - [description] + * @param {number} [x=1] - The horizontal scale of this Game Object. + * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the x value. + * @param {Phaser.Math.Vector2} [point] - The point (Vector2) from which scaling will occur. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setScale: function (x, y, point) { @@ -165778,11 +166706,11 @@ module.exports = Sleep; var Bodies = __webpack_require__(125); var Body = __webpack_require__(67); -var Bounds = __webpack_require__(79); +var Bounds = __webpack_require__(80); var Common = __webpack_require__(33); var GetFastValue = __webpack_require__(2); -var Vector = __webpack_require__(80); -var Vertices = __webpack_require__(94); +var Vector = __webpack_require__(81); +var Vertices = __webpack_require__(76); /** * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file @@ -165957,6 +166885,7 @@ var Bodies = __webpack_require__(125); var Body = __webpack_require__(67); var GetFastValue = __webpack_require__(2); var PhysicsEditorParser = __webpack_require__(1093); +var Vertices = __webpack_require__(76); /** * [description] @@ -166060,7 +166989,11 @@ var SetBody = { } this.body = body; - this.body.gameObject = this; + + for (var i = 0; i < body.parts.length; i++) + { + body.parts[i].gameObject = this; + } var _this = this; @@ -166135,26 +167068,39 @@ var SetBody = { case 'polygon': var sides = GetFastValue(config, 'sides', 5); - var pradius = GetFastValue(config, 'radius', Math.max(bodyWidth, bodyHeight) / 2); - body = Bodies.polygon(bodyX, bodyY, sides, pradius, options); + var pRadius = GetFastValue(config, 'radius', Math.max(bodyWidth, bodyHeight) / 2); + body = Bodies.polygon(bodyX, bodyY, sides, pRadius, options); break; case 'fromVertices': case 'fromVerts': - var verts = GetFastValue(config, 'verts', []); - if (this.body) + var verts = GetFastValue(config, 'verts', null); + + if (verts) { - Body.setVertices(this.body, verts); - body = this.body; - } - else - { - var flagInternal = GetFastValue(config, 'flagInternal', false); - var removeCollinear = GetFastValue(config, 'removeCollinear', 0.01); - var minimumArea = GetFastValue(config, 'minimumArea', 10); - body = Bodies.fromVertices(bodyX, bodyY, verts, options, flagInternal, removeCollinear, minimumArea); + // Has the verts array come from Vertices.fromPath, or is it raw? + if (typeof verts === 'string') + { + verts = Vertices.fromPath(verts); + } + + if (this.body && !this.body.hasOwnProperty('temp')) + { + Body.setVertices(this.body, verts); + + body = this.body; + } + else + { + var flagInternal = GetFastValue(config, 'flagInternal', false); + var removeCollinear = GetFastValue(config, 'removeCollinear', 0.01); + var minimumArea = GetFastValue(config, 'minimumArea', 10); + + body = Bodies.fromVertices(bodyX, bodyY, verts, options, flagInternal, removeCollinear, minimumArea); + } } + break; case 'fromPhysicsEditor': @@ -166162,7 +167108,10 @@ var SetBody = { break; } - this.setExistingBody(body, config.addToWorld); + if (body) + { + this.setExistingBody(body, config.addToWorld); + } return this; } @@ -166368,7 +167317,7 @@ module.exports = Mass; */ /** - * [description] + * A component to manipulate world gravity for Matter.js bodies. * * @name Phaser.Physics.Matter.Components.Gravity * @since 3.0.0 @@ -166376,12 +167325,12 @@ module.exports = Mass; var Gravity = { /** - * [description] + * A togglable function for ignoring world gravity in real-time on the current body. * * @method Phaser.Physics.Matter.Components.Gravity#setIgnoreGravity * @since 3.0.0 * - * @param {boolean} value - [description] + * @param {boolean} value - Set to true to ignore the effect of world gravity, or false to not ignore it. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -166496,7 +167445,7 @@ module.exports = Friction; var Body = __webpack_require__(67); /** - * [description] + * A component to apply force to Matter.js bodies. * * @name Phaser.Physics.Matter.Components.Force * @since 3.0.0 @@ -166504,13 +167453,14 @@ var Body = __webpack_require__(67); var Force = { // force = vec2 / point + /** - * [description] + * Applies a force to a body. * * @method Phaser.Physics.Matter.Components.Force#applyForce * @since 3.0.0 * - * @param {Phaser.Math.Vector2} force - [description] + * @param {Phaser.Math.Vector2} force - A Vector that specifies the force to apply. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -166524,13 +167474,13 @@ var Force = { }, /** - * [description] + * Applies a force to a body from a given position. * * @method Phaser.Physics.Matter.Components.Force#applyForceFrom * @since 3.0.0 * - * @param {Phaser.Math.Vector2} position - [description] - * @param {Phaser.Math.Vector2} force - [description] + * @param {Phaser.Math.Vector2} position - The position in which the force comes from. + * @param {Phaser.Math.Vector2} force - A Vector that specifies the force to apply. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -166542,12 +167492,12 @@ var Force = { }, /** - * [description] + * Apply thrust to the forward position of the body. * * @method Phaser.Physics.Matter.Components.Force#thrust * @since 3.0.0 * - * @param {number} speed - [description] + * @param {number} speed - A speed value to be applied to a directional force. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -166563,12 +167513,12 @@ var Force = { }, /** - * [description] + * Apply thrust to the left position of the body. * * @method Phaser.Physics.Matter.Components.Force#thrustLeft * @since 3.0.0 * - * @param {number} speed - [description] + * @param {number} speed - A speed value to be applied to a directional force. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -166584,12 +167534,12 @@ var Force = { }, /** - * [description] + * Apply thrust to the right position of the body. * * @method Phaser.Physics.Matter.Components.Force#thrustRight * @since 3.0.0 * - * @param {number} speed - [description] + * @param {number} speed - A speed value to be applied to a directional force. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -166605,12 +167555,12 @@ var Force = { }, /** - * [description] + * Apply thrust to the back position of the body. * * @method Phaser.Physics.Matter.Components.Force#thrustBack * @since 3.0.0 * - * @param {number} speed - [description] + * @param {number} speed - A speed value to be applied to a directional force. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -166773,7 +167723,7 @@ var GetFastValue = __webpack_require__(2); var Vector2 = __webpack_require__(3); /** - * [description] + * Internal function to check if the object has a getter or setter. * * @function hasGetterOrSetter * @private @@ -166793,11 +167743,11 @@ function hasGetterOrSetter (def) * @function Phaser.Physics.Matter.MatterGameObject * @since 3.3.0 * - * @param {Phaser.Physics.Matter.World} world - [description] - * @param {Phaser.GameObjects.GameObject} gameObject - [description] - * @param {object} options - [description] + * @param {Phaser.Physics.Matter.World} world - The Matter world to add the body to. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will have the Matter body applied to it. + * @param {object} options - Matter options config object. * - * @return {Phaser.GameObjects.GameObject} [description] + * @return {Phaser.GameObjects.GameObject} The Game Object that was created with the Matter body. */ var MatterGameObject = function (world, gameObject, options) { @@ -166808,6 +167758,7 @@ var MatterGameObject = function (world, gameObject, options) // Temp body pos to avoid body null checks gameObject.body = { + temp: true, position: { x: x, y: y @@ -166947,6 +167898,15 @@ module.exports = { * @class MatterJS.Engine */ +/** + * @classdesc +* The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. +* A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. +* A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). +* +* @class MatterJS.Vertices +*/ + /***/ }), /* 1105 */ @@ -167390,7 +168350,8 @@ module.exports = ImpactPhysics; */ /** - * [description] + * The Impact Velocity component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Velocity * @since 3.0.0 @@ -167398,14 +168359,14 @@ module.exports = ImpactPhysics; var Velocity = { /** - * [description] + * Sets the horizontal velocity of the physics body. * * @method Phaser.Physics.Impact.Components.Velocity#setVelocityX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The horizontal velocity value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setVelocityX: function (x) { @@ -167415,14 +168376,14 @@ var Velocity = { }, /** - * [description] + * Sets the vertical velocity of the physics body. * * @method Phaser.Physics.Impact.Components.Velocity#setVelocityY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} y - The vertical velocity value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setVelocityY: function (y) { @@ -167432,15 +168393,15 @@ var Velocity = { }, /** - * [description] + * Sets the horizontal and vertical velocities of the physics body. * * @method Phaser.Physics.Impact.Components.Velocity#setVelocity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The horizontal velocity value. + * @param {number} [y=x] - The vertical velocity value. If not given, defaults to the horizontal value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setVelocity: function (x, y) { @@ -167453,15 +168414,15 @@ var Velocity = { }, /** - * [description] + * Sets the maximum velocity this body can travel at. * * @method Phaser.Physics.Impact.Components.Velocity#setMaxVelocity * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} [y=x] - [description] + * @param {number} x - The maximum allowed horizontal velocity. + * @param {number} [y=x] - The maximum allowed vertical velocity. If not given, defaults to the horizontal value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setMaxVelocity: function (x, y) { @@ -167489,7 +168450,8 @@ module.exports = Velocity; */ /** - * [description] + * The Impact Set Game Object component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.SetGameObject * @since 3.0.0 @@ -167564,7 +168526,8 @@ module.exports = SetGameObject; */ /** - * [description] + * The Impact Offset component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Offset * @since 3.0.0 @@ -167613,7 +168576,8 @@ module.exports = Offset; */ /** - * [description] + * The Impact Gravity component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Gravity * @since 3.0.0 @@ -167674,7 +168638,8 @@ module.exports = Gravity; */ /** - * [description] + * The Impact Friction component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Friction * @since 3.0.0 @@ -167750,7 +168715,8 @@ module.exports = Friction; */ /** - * [description] + * The Impact Debug component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Debug * @since 3.0.0 @@ -167884,7 +168850,8 @@ var COLLIDES = __webpack_require__(225); */ /** - * [description] + * The Impact Collides component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Collides * @since 3.0.0 @@ -168031,7 +168998,8 @@ module.exports = Collides; var TYPE = __webpack_require__(224); /** - * [description] + * The Impact Check Against component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.CheckAgainst * @since 3.0.0 @@ -168150,7 +169118,8 @@ module.exports = CheckAgainst; */ /** - * [description] + * The Impact Bounce component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Bounce * @since 3.0.0 @@ -168158,12 +169127,12 @@ module.exports = CheckAgainst; var Bounce = { /** - * [description] + * Sets the impact physics bounce, or restitution, value. * * @method Phaser.Physics.Impact.Components.Bounce#setBounce * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - A value between 0 (no rebound) and 1 (full rebound) * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -168175,12 +169144,12 @@ var Bounce = { }, /** - * [description] + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. * * @method Phaser.Physics.Impact.Components.Bounce#setMinBounceVelocity * @since 3.0.0 * - * @param {number} value - [description] + * @param {number} value - The minimum allowed velocity. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ @@ -168192,7 +169161,8 @@ var Bounce = { }, /** - * [description] + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) * * @name Phaser.Physics.Impact.Components.Bounce#bounce * @type {number} @@ -168230,7 +169200,8 @@ module.exports = Bounce; var TYPE = __webpack_require__(224); /** - * [description] + * The Impact Body Type component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.BodyType * @since 3.0.0 @@ -168311,7 +169282,8 @@ module.exports = BodyType; */ /** - * [description] + * The Impact Body Scale component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.BodyScale * @since 3.0.0 @@ -168319,15 +169291,15 @@ module.exports = BodyType; var BodyScale = { /** - * [description] + * Sets the size of the physics body. * * @method Phaser.Physics.Impact.Components.BodyScale#setBodySize * @since 3.0.0 * - * @param {number} width - [description] - * @param {number} [height=width] - [description] + * @param {number} width - The width of the body in pixels. + * @param {number} [height=width] - The height of the body in pixels. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setBodySize: function (width, height) { @@ -168340,15 +169312,15 @@ var BodyScale = { }, /** - * [description] + * Sets the scale of the physics body. * * @method Phaser.Physics.Impact.Components.BodyScale#setBodyScale * @since 3.0.0 * - * @param {number} scaleX - [description] - * @param {number} [scaleY] - [description] + * @param {number} scaleX - The horizontal scale of the body. + * @param {number} [scaleY] - The vertical scale of the body. If not given, will use the horizontal scale value. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setBodyScale: function (scaleX, scaleY) { @@ -168384,7 +169356,8 @@ module.exports = BodyScale; */ /** - * [description] + * The Impact Acceleration component. + * Should be applied as a mixin. * * @name Phaser.Physics.Impact.Components.Acceleration * @since 3.0.0 @@ -168392,14 +169365,14 @@ module.exports = BodyScale; var Acceleration = { /** - * [description] + * Sets the horizontal acceleration of this body. * * @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationX * @since 3.0.0 * - * @param {number} x - [description] + * @param {number} x - The amount of acceleration to apply. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setAccelerationX: function (x) { @@ -168409,14 +169382,14 @@ var Acceleration = { }, /** - * [description] + * Sets the vertical acceleration of this body. * * @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationY * @since 3.0.0 * - * @param {number} y - [description] + * @param {number} y - The amount of acceleration to apply. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setAccelerationY: function (y) { @@ -168426,15 +169399,15 @@ var Acceleration = { }, /** - * [description] + * Sets the horizontal and vertical acceleration of this body. * * @method Phaser.Physics.Impact.Components.Acceleration#setAcceleration * @since 3.0.0 * - * @param {number} x - [description] - * @param {number} y - [description] + * @param {number} x - The amount of horizontal acceleration to apply. + * @param {number} y - The amount of vertical acceleration to apply. * - * @return {Phaser.GameObjects.GameObject} This Game Object. + * @return {this} This Game Object. */ setAcceleration: function (x, y) { diff --git a/dist/phaser.min.js b/dist/phaser.min.js index 0765f5195..b28f6594f 100644 --- a/dist/phaser.min.js +++ b/dist/phaser.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1126)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,e,s,r){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,t.exports=n},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;no.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c0&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit("destroy",this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});a.RENDER_MASK=15,t.exports=a},function(t,e,i){var n=i(8),s=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit("filecomplete",e,i,t),this.loader.emit("filecomplete-"+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){t.exports=function(t,e,i,n,s){var r=n.alpha*i.alpha;if(r<=0)return!1;var o=t._tempMatrix1.copyFromArray(n.matrix.matrix),a=t._tempMatrix2.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),h=t._tempMatrix3;return s?(o.multiplyWithOffset(s,-n.scrollX*i.scrollFactorX,-n.scrollY*i.scrollFactorY),a.e=i.x,a.f=i.y,o.multiply(a,h)):(a.e-=n.scrollX*i.scrollFactorX,a.f-=n.scrollY*i.scrollFactorY,o.multiply(a,h)),e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=r,e.save(),h.setToContext(e),!0}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n,s,r,o=i(26),a=i(175),h=[],l=!1;t.exports={create2D:function(t,e,i){return n(t,e,i,o.CANVAS)},create:n=function(t,e,i,n,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=o.CANVAS),void 0===r&&(r=!1);var c=s(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&n===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return n(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n={VERSION:"3.13.0",BlendModes:i(66),ScaleModes:i(93),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(54),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e,i){var n=i(66),s=i(12),r=i(93);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),e.blendMode=s(i,"blendMode",n.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e){t.exports=function(t,e,i){var n=i||e.fillColor,s=e.fillAlpha,r=(16711680&n)>>>16,o=(65280&n)>>>8,a=255&n;t.fillStyle="rgba("+r+","+o+","+a+","+s+")"}},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){(function(e){var i={};t.exports=i,function(){i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i.extend=function(t,e){var n,s;"boolean"==typeof e?(n=2,s=e):(n=1,s=!0);for(var r=n;r0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i>>16,r=(65280&i)>>>8,o=255&i;t.strokeStyle="rgba("+s+","+r+","+o+","+n+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),s=i(177),r=i(377),o=i(176),a=i(376),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(4),l=i(8),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;sthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=h},function(t,e,i){var n=i(0),s=i(14),r=i(266),o=new n({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=null,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return this.getLeft(t)+this.width/2},getCenterY:function(t){return this.getTop(t)+this.height/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight-(this.height-this.baseHeight),this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.tilemapLayer;return t?t.tileset:null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.loader=t,this.type=e,this.key=i,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={};for(var s=0;s=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;ps||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,a,h,l,u,f,g,v=e&&e.length,y=v?e[0]*i:t.length,m=s(t,0,y,i,!0),x=[];if(!m)return x;if(v&&(m=function(t,e,i,n){var o,a,h,l,u,f=[];for(o=0,a=e.length;o80*i){n=h=t[0],a=l=t[1];for(var w=i;wh&&(h=u),f>l&&(l=f);g=Math.max(h-n,l-a)}return o(m,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===A(t,e,i,n)>0)for(r=e;r=e;r-=n)o=T(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!m(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),S(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(y(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&y(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(y(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!m(s,r)&&x(s,n,n.next,r)&&w(s,r)&&w(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),S(n),S(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&w(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=b(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&w(t,e)&&w(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(m(t,e)&&m(i,n)||m(t,n)&&m(i,e))||y(t,e,i)>0!=y(t,e,n)>0&&y(i,n,t)>0!=y(i,n,e)>0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new _(t.i,t.x,t.y),n=new _(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function T(t,e,i,n){var s=new _(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function _(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={SKIP_CHECK:-1,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}},function(t,e,i){var n={};t.exports=n;var s=i(94),r=i(80),o=i(223),a=i(33),h=i(79),l=i(505);!function(){n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",gameObject:null,parts:[],plugin:{},angle:0,vertices:s.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,ignoreGravity:!1,ignorePointer:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0},lineWidth:0},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,_original:null},n=a.extend(i,e);return t(n,e),n},n.nextGroup=function(t){return t?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var t=function(t,e){e=e||{},n.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),s.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),n.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var i=t.isStatic?"#2e2b44":a.choose(["#006BA6","#0496FF","#FFBC42","#D81159","#8F2D56"]);t.render.fillStyle=t.render.fillStyle||i,t.render.strokeStyle=t.render.strokeStyle||"#000",t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};n.set=function(t,e,i){var s;for(s in"string"==typeof e&&(s=e,(e={})[s]=i),e)if(e.hasOwnProperty(s))switch(i=e[s],s){case"isStatic":n.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":n.setMass(t,i);break;case"density":n.setDensity(t,i);break;case"inertia":n.setInertia(t,i);break;case"vertices":n.setVertices(t,i);break;case"position":n.setPosition(t,i);break;case"angle":n.setAngle(t,i);break;case"velocity":n.setVelocity(t,i);break;case"angularVelocity":n.setAngularVelocity(t,i);break;case"parts":n.setParts(t,i);break;default:t[s]=i}},n.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i=0&&y>=0&&v+y<1}},function(t,e,i){var n=i(0),s=i(172),r=i(9),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){var n=i(0),s=i(39),r=i(406),o=i(404),a=i(191),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation","orthogonal"),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[])}});t.exports=r},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",{}),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null)}});t.exports=r},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&et.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){var i={};t.exports=i,i.create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i||(i={});var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r,o){for(var a=n.getTintAppendFloatAlphaAndSwap(i.fillColor,i.fillAlpha*s),h=i.pathData,l=i.pathIndexes,u=0;u=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i=t.length)){for(var i=t.length-1,n=t[e],s=e;s0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return this.entries.length=t}}});t.exports=n},function(t,e,i){var n=i(63);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i}},function(t,e,i){var n=i(128),s=i(12),r=i(83),o=i(85),a=i(98),h=i(206),l=i(130),u=i(4),c=i(129),d=i(127),f=i(126);t.exports=function(t,e,i){void 0===i&&(i=n);for(var p=i.targets?i.targets:l(e),g=h(e),v=a(e,"delay",i.delay),y=a(e,"duration",i.duration),m=u(e,"easeParams",i.easeParams),x=o(u(e,"ease",i.ease),m),w=a(e,"hold",i.hold),b=a(e,"repeat",i.repeat),T=a(e,"repeatDelay",i.repeatDelay),S=r(e,"yoyo",i.yoyo),_=r(e,"flipX",i.flipX),A=r(e,"flipY",i.flipY),C=[],M=0;M=this.firstgid&&t=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(730),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,o],initialize:function(t,e,i,n,s,o,a,h,l){if(r.call(this,t,"Mesh"),n.length!==s.length)throw new Error("Mesh Vertex count must match UV count");var u,c=n.length/2|0;if(o.length>0&&o.length0&&a.lengthl&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(0),s=i(23),r=i(20),o=new n({initialize:function(t,e,i,n,s,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,d)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),y=r=s(r,0,f-i),m=this.data;if(m.trim){var x=m.spriteSourceSize,w=e+n,b=i+r;if(!(x.rw||x.y>b)){var T=Math.max(x.x,e),S=Math.max(x.y,i),_=Math.min(x.r,w)-T,A=Math.min(x.b,b)-S;v=_,y=A,p=o?h+(u-(T-x.x)-_):h+(T-x.x),g=a?l+(c-(S-x.y)-A):l+(S-x.y),e=T,i=S,n=_,r=A}else p=0,g=0,v=0,y=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var C=this.source.width,M=this.source.height;return t.u0=Math.max(0,p/C),t.v0=Math.max(0,g/M),t.u1=Math.min(1,(p+v)/C),t.v1=Math.min(1,(g+y)/M),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=y,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){var n=i(0),s=i(11),r=i(20),o=i(1),a=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=r(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=r(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=r(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=r(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit("destroy",this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=a},function(t,e,i){var n=i(0),s=i(63),r=i(11),o=i(1),a=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on("blur",function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on("focus",function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on("prestep",this.update,this),t.events.once("destroy",this.destroy,this)},add:o,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once("ended",i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once("ended",n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("pauseall",this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit("resumeall",this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit("stopall",this)},unlock:o,onBlur:o,onFocus:o,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("rate",this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("detune",this,t)}}});t.exports=a},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){var n,s=i(91),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){var n=i(0),s=i(14),r=i(31),o=i(11),a=i(9),h=i(53),l=i(178),u=i(3),c=new n({Extends:o,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.config,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new a,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new a,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new h,this.transparent=!0,this.backgroundColor=l("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new u(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new u);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOn:function(t,e){var i=.5*this.width,n=.5*this.height;return this.midPoint.set(t,e),this.scrollX=t-i,this.scrollY=e-n,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;g-y&&T>-m&&b-y&&_>-m&&Ss&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=l(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.config=t.sys.game.config,this.sceneManager=t.sys.game.scene;var e=this.config.resolution;return this.resolution=e,this._cx=this._x*e,this._cy=this._y*e,this._cw=this._width*e,this._ch=this._height*e,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.config){var t=0!==this._x||0!==this._y||this.config.width!==this._width||this.config.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit("cameradestroy",this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.config=null,this.sceneManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=c},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n0&&s.area(_)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e,i){var n=i(0),s=i(13),r=i(5),o=i(82),a=new n({initialize:function(t,e,i){this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onRepeat:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(){return this.data[0].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},isPaused:function(){return this.state===o.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){for(var n=0;n0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){if(this.state!==o.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this},play:function(t){if(this.state!==o.ACTIVE){this.state!==o.PENDING_REMOVE&&this.state!==o.REMOVED||(this.init(),this.parent.makeActive(this),t=!0);var e=this.callbacks.onStart;this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this))}},resetTweenData:function(t){for(var e=this.data,i=0;i0?(n.elapsed=n.delay,n.state=o.DELAY):n.state=o.PENDING_RENDER}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&ns.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},stop:function(t){this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parent._destroy.push(this),this.parent._toProcess++),this.state=o.PENDING_REMOVE)},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e){function i(t){return!!t.getStart&&"function"==typeof t.getStart}function n(t){return!!t.getEnd&&"function"==typeof t.getEnd}var s=function(t,e){var r,o,a=function(t,e,i){return i},h=function(t,e,i){return i},l=typeof e;if("number"===l)a=function(){return e};else if("string"===l){var u=e[0],c=parseFloat(e.substr(2));switch(u){case"+":a=function(t,e,i){return i+c};break;case"-":a=function(t,e,i){return i-c};break;case"*":a=function(t,e,i){return i*c};break;case"/":a=function(t,e,i){return i/c};break;default:a=function(){return parseFloat(e)}}}else"function"===l?a=e:"object"===l&&(i(o=e)||n(o))?(n(e)&&(a=e.getEnd),i(e)&&(h=e.getStart)):e.hasOwnProperty("value")&&(r=s(t,e.value));return r||(r={getEnd:a,getStart:h}),r};t.exports=s},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"targets",null);return null===e?e:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(29),s=i(76),r=i(218),o=i(210);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",n.ARRAY_2D,u,i,a,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new s({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){var n=i(29),s=i(77),r=i(76),o=i(55);t.exports=function(t,e,i,a,h){for(var l=new s({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],y=s[12],m=s[13],x=s[14],w=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+y)*w,this.y=(e*o+i*u+n*p+m)*w,this.z=(e*a+i*c+n*g+x)*w,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=i(344),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n=0&&r>=0&&s+r<1&&(n.push({x:e[b].x,y:e[b].y}),i)));b++);return n}},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.righte.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),s=i(108),r=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,1,1,1,0],[16777215,16777215,16777215,16777215,16777215,16777215],[1,1,1,1,1,1],n,r),this.resetPosition()},setFrame:function(t){return this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,t=this.frame,this.uv[0]=t.u0,this.uv[1]=t.v0,this.uv[2]=t.u0,this.uv[3]=t.v1,this.uv[4]=t.u1,this.uv[5]=t.v1,this.uv[6]=t.u0,this.uv[7]=t.v0,this.uv[8]=t.u1,this.uv[9]=t.v1,this.uv[10]=t.u1,this.uv[11]=t.v0,this},topLeftX:{get:function(){return this.x+this.vertices[0]},set:function(t){this.vertices[0]=t-this.x,this.vertices[6]=t-this.x}},topLeftY:{get:function(){return this.y+this.vertices[1]},set:function(t){this.vertices[1]=t-this.y,this.vertices[7]=t-this.y}},topRightX:{get:function(){return this.x+this.vertices[10]},set:function(t){this.vertices[10]=t-this.x}},topRightY:{get:function(){return this.y+this.vertices[11]},set:function(t){this.vertices[11]=t-this.y}},bottomLeftX:{get:function(){return this.x+this.vertices[2]},set:function(t){this.vertices[2]=t-this.x}},bottomLeftY:{get:function(){return this.y+this.vertices[3]},set:function(t){this.vertices[3]=t-this.y}},bottomRightX:{get:function(){return this.x+this.vertices[4]},set:function(t){this.vertices[4]=t-this.x,this.vertices[8]=t-this.x}},bottomRightY:{get:function(){return this.y+this.vertices[5]},set:function(t){this.vertices[5]=t-this.y,this.vertices[9]=t-this.y}},topLeftAlpha:{get:function(){return this.alphas[0]},set:function(t){this.alphas[0]=t,this.alphas[3]=t}},topRightAlpha:{get:function(){return this.alphas[5]},set:function(t){this.alphas[5]=t}},bottomLeftAlpha:{get:function(){return this.alphas[1]},set:function(t){this.alphas[1]=t}},bottomRightAlpha:{get:function(){return this.alphas[2]},set:function(t){this.alphas[2]=t,this.alphas[4]=t}},topLeftColor:{get:function(){return this.colors[0]},set:function(t){this.colors[0]=t,this.colors[3]=t}},topRightColor:{get:function(){return this.colors[5]},set:function(t){this.colors[5]=t}},bottomLeftColor:{get:function(){return this.colors[1]},set:function(t){this.colors[1]=t}},bottomRightColor:{get:function(){return this.colors[2]},set:function(t){this.colors[2]=t,this.colors[4]=t}},setTopLeft:function(t,e){return this.topLeftX=t,this.topLeftY=e,this},setTopRight:function(t,e){return this.topRightX=t,this.topRightY=e,this},setBottomLeft:function(t,e){return this.bottomLeftX=t,this.bottomLeftY=e,this},setBottomRight:function(t,e){return this.bottomRightX=t,this.bottomRightY=e,this},resetPosition:function(){var t=this.x,e=this.y,i=Math.floor(this.width/2),n=Math.floor(this.height/2);return this.setTopLeft(t-i,e-n),this.setTopRight(t+i,e-n),this.setBottomLeft(t-i,e+n),this.setBottomRight(t+i,e+n),this},resetAlpha:function(){var t=this.alphas;return t[0]=1,t[1]=1,t[2]=1,t[3]=1,t[4]=1,t[5]=1,this},resetColors:function(){var t=this.colors;return t[0]=16777215,t[1]=16777215,t[2]=16777215,t[3]=16777215,t[4]=16777215,t[5]=16777215,this},reset:function(){return this.resetPosition(),this.resetAlpha(),this.resetColors()}});t.exports=r},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++sl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var y=u[c].length?c:c+1,m=u.slice(y).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=m+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h0&&(a+=u.lineSpacing*p),i.rtl?o=d-o:"right"===i.align?o+=u.width-u.lineWidths[p]:"center"===i.align&&(o+=(u.width-u.lineWidths[p])/2),this.autoRound&&(o=Math.round(o),a=Math.round(a)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[p],o,a)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[p],o,a));return e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(120),s=i(24),r=i(0),o=i(14),a=i(26),h=i(113),l=i(19),u=i(816),c=i(296),d=new r({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,r,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===o&&(o=32),l.call(this,t,"RenderTexture"),this.renderer=t.sys.game.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=s.create2D(this,r,o),this.context=this.canvas.getContext("2d"),this.framebuffer=null,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(c(),this.canvas),this.frame=this.texture.get(),this._saved=!1,this.camera=new n(0,0,r,o),this.dirty=!1,this.gl=null;var h=this.renderer;if(h.type===a.WEBGL){var u=h.gl;this.gl=u,this.drawGameObject=this.batchGameObjectWebGL,this.framebuffer=h.createFramebuffer(r,o,this.frame.source.glTexture,!1)}else h.type===a.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas);this.camera.setScene(t),this.setPosition(e,i),this.setSize(r,o),this.setOrigin(0,0),this.initPipeline()},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas.width=t,this.canvas.height=e,this.gl){var i=this.gl;this.renderer.deleteTexture(this.frame.source.glTexture),this.renderer.deleteFramebuffer(this.framebuffer),this.frame.source.glTexture=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1),this.framebuffer=this.renderer.createFramebuffer(t,e,this.frame.source.glTexture,!1),this.frame.glTexture=this.frame.source.glTexture}this.frame.source.width=t,this.frame.source.height=e,this.camera.setSize(t,e),this.frame.setSize(t,e),this.width=t,this.height=e}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e){void 0===e&&(e=1);var i=255&(t>>16|0),n=255&(t>>8|0),s=255&(0|t);if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var r=this.gl;r.clearColor(i/255,n/255,s/255,e),r.clear(r.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else this.context.fillStyle="rgb("+i+","+n+","+s+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height);return this},clear:function(){if(this.dirty){if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.restore()}this.dirty=!1}return this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1,1),r){this.renderer.setFramebuffer(this.framebuffer);var o=this.pipeline;o.projOrtho(0,this.width,0,this.height,-1e3,1e3),this.batchList(t,e,i,n,s),o.flush(),this.renderer.setFramebuffer(null),o.projOrtho(0,o.width,o.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1,1),o){this.renderer.setFramebuffer(this.framebuffer);var h=this.pipeline;h.projOrtho(0,this.width,0,this.height,-1e3,1e3),h.batchTextureFrame(a,i,n,r,s,this.camera.matrix,null),h.flush(),this.renderer.setFramebuffer(null),h.projOrtho(0,h.width,h.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i,n,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;r0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),o.gl&&n&&(n.source[0].glTexture=o.canvasToTexture(s.canvas,n.source[0].glTexture))),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e,i){var n=i(109),s=i(0),r=i(833),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(163),s=i(66),r=i(0),o=i(14),a=i(19),h=i(9),l=i(836),u=i(310),c=i(3),d=new r({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.ScrollFactor,o.Transform,o.Visible,l],initialize:function(t,e,i,n){a.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new h),t.setTo(this.x,this.y,0,0),this.list.length>0)for(var e=this.list,i=new h,n=0;n-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=d},function(t,e,i){var n=i(840),s=i(837),r=i(0),o=i(14),a=i(113),h=i(19),l=i(112),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(t,e,i,n,s){h.call(this,t,"Blitter"),this.setTexture(n,s),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,r){void 0===n&&(n=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new s(this,t,e,i,n);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,n){for(var s=this.createMultiple(e,i,n),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit("start",this),this.events.emit("ready",this,t)},resize:function(t,e){this.events.emit("resize",t,e)},shutdown:function(t){this.events.off("transitioninit"),this.events.off("transitionstart"),this.events.off("transitioncomplete"),this.events.off("transitionout"),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit("destroy",this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,s=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return e.x=t.x+s*Math.cos(i)*t.width/2,e.y=t.y+s*Math.sin(i)*t.height/2,e}},function(t,e){var i={defaultPipeline:null,pipeline:null,initPipeline:function(t){void 0===t&&(t="TextureTintPipeline");var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return e&&e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t)),this},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=i},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),r=s>1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e){t.exports={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}},function(t,e,i){var n={};t.exports=n;var s=i(94),r=i(80),o=i(223),a=i(79),h=i(505),l=i(33);n._warming=.4,n._torqueDampen=1,n._minLength=1e-6,n.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,s=r.magnitude(r.sub(i,n));e.length=void 0!==e.length?e.length:s,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e,i){var n={};t.exports=n;var s=i(33);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r0){i||(i={}),n=e.split(" ");for(var l=0;lthis.vertexCapacity&&(this.flush(),y=!0);var m=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.vertexComponentCount-1;return m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=i,m[++w]=n,m[++w]=h,m[++w]=c,m[++w]=v,x[++w]=p,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=o,m[++w]=a,m[++w]=u,m[++w]=l,m[++w]=v,x[++w]=f,this.vertexCount+=6,y},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f){var p=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),p=!0);var g=this.vertexViewF32,v=this.vertexViewU32,y=this.vertexCount*this.vertexComponentCount-1;return g[++y]=t,g[++y]=e,g[++y]=o,g[++y]=a,g[++y]=f,v[++y]=u,g[++y]=i,g[++y]=n,g[++y]=o,g[++y]=l,g[++y]=f,v[++y]=c,g[++y]=s,g[++y]=r,g[++y]=h,g[++y]=l,g[++y]=f,v[++y]=d,this.vertexCount+=3,p},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,_,A,C,M,P,E){this.renderer.setPipeline(this,t);var k=this._tempMatrix1,F=this._tempMatrix2,L=this._tempMatrix3,R=y/i+C,O=m/n+M,B=(y+x)/i+C,D=(m+w)/n+M,I=o,Y=a,X=-g,z=-v;if(t.isCropped){var N=t._crop;I=N.width,Y=N.height,o=N.width,a=N.height;var U=y=N.x,V=m=N.y;c&&(U=x-N.x-N.width),d&&!e.isRenderTexture&&(V=w-N.y-N.height),R=U/i+C,O=V/n+M,B=(U+N.width)/i+C,D=(V+N.height)/n+M,X=-g+y,z=-v+m}d^=e.isRenderTexture?1:0,c&&(I*=-1,X+=o),d&&(Y*=-1,z+=a);var G=X+I,W=z+Y;F.applyITRS(s,r,u,h,l),k.copyFrom(P.matrix),E?(k.multiplyWithOffset(E,-P.scrollX*f,-P.scrollY*p),F.e=s,F.f=r,k.multiply(F,L)):(F.e-=P.scrollX*f,F.f-=P.scrollY*p,k.multiply(F,L));var H=L.getX(X,z),j=L.getY(X,z),q=L.getX(X,W),K=L.getY(X,W),J=L.getX(G,W),Z=L.getY(G,W),Q=L.getX(G,z),$=L.getY(G,z);P.roundPixels&&(H|=0,j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0),this.setTexture2D(e,0),this.batchQuad(H,j,q,K,J,Z,Q,$,R,O,B,D,b,T,S,_,A)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),y=h.getY(l,c),m=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,y,m,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n,h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),y=this.currentFrame,m=y.u0,x=y.v0,w=y.u1,b=y.v1;this.batchQuad(l,u,c,d,f,p,g,v,m,x,w,b,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,y=g.v0,m=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,y,m,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(R,O,E,k,H[0],H[1],H[2],H[3],U,V,G,W,I,Y,X,z,D):(j[0]=R,j[1]=O,j[2]=E,j[3]=k,j[4]=1),h&&j[4]?this.batchQuad(M,P,F,L,j[0],j[1],j[2],j[3],U,V,G,W,I,Y,X,z,D):(H[0]=M,H[1]=P,H[2]=F,H[3]=L,H[4]=1)}}});t.exports=d},function(t,e,i){var n=i(0),s=i(894),r=i(196),o=new n({Extends:r,initialize:function(t){t.fragShader=s.replace("%LIGHT_COUNT%",10..toString()),r.call(this,t),this.defaultNormalMap},boot:function(){this.defaultNormalMap=this.game.textures.getFrame("__DEFAULT")},onBind:function(t){r.prototype.onBind.call(this);var e=this.renderer,i=this.program;return this.mvpUpdate(),e.setInt1(i,"uNormSampler",1),e.setFloat2(i,"uResolution",this.width,this.height),t&&this.setNormalMap(t),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,10);if(0===s)return this;this.active=!0;var r,o=this.renderer,a=this.program,h=e.matrix,l={x:0,y:0},u=o.height;for(r=0;r<10;++r)o.setFloat1(a,"uLights["+r+"].radius",0);for(o.setFloat4(a,"uCamera",e.x,e.y,e.rotation,e.zoom),o.setFloat3(a,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(52);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(52);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(0),s=i(11),r=i(97),o=i(82),a=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},add:function(t){return this.queue(r(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=o.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit("loop",this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit("complete",this),this.state=o.PENDING_REMOVE}},update:function(t,e){if(this.state!==o.PAUSED){var i=e;switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var n=this.totalData,s=0;s0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var y=0;y0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(0),s=i(14),r=i(26),o=i(19),a=i(446),h=i(103),l=i(10),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=n,this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.vertexBuffer=null,this.renderer=t.sys.game.renderer,this.bufferData=null,this.vertexViewF32=null,this.vertexViewU32=null,this.dirty=!0,this.vertexCount=0,this._renderOrder=0,this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.dirty=!0,this.vertexBuffer=null},this)},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t,this.dirty=!0),this},upload:function(t){var e=this.renderer,i=e.gl,n=e.pipelines.TextureTintPipeline;if(this.dirty){var s,r,o,a=this.tileset,h=this.layer.width,l=this.layer.height,u=a.image.source[0].width,c=a.image.source[0].height,d=this.layer.data,f=this._renderOrder,p=this.vertexBuffer,g=this.bufferData,v=-1,y=h*l*n.vertexSize*6;if(this.vertexCount=0,null===g&&(g=new ArrayBuffer(y),this.bufferData=g,this.vertexViewF32=new Float32Array(g),this.vertexViewU32=new Uint32Array(g)),0===f)for(r=0;r=0;o--)(s=d[r][o])&&-1!==s.index&&s.visible&&(v=this.batchTile(v,s,a,u,c,t));else if(2===f)for(r=l-1;r>=0;r--)for(o=0;o=0;r--)for(o=h-1;o>=0;o--)(s=d[r][o])&&-1!==s.index&&s.visible&&(v=this.batchTile(v,s,a,u,c,t));this.dirty=!1,null===p?(p=e.createVertexBuffer(g,i.STATIC_DRAW),this.vertexBuffer=p):(e.setVertexBuffer(p),i.bufferSubData(i.ARRAY_BUFFER,0,g))}return n.modelIdentity(),n.modelTranslate(this.x-t.scrollX*this.scrollFactorX,this.y-t.scrollY*this.scrollFactorY,0),n.modelScale(this.scaleX,this.scaleY,1),n.viewLoad2D(t.matrix.matrix),this},batchTile:function(t,e,i,n,s,r){var o=e.pixelX,a=e.pixelY,h=o+e.width,u=a+e.height,c=i.getTileTextureCoordinates(e.index);if(c){var d=c.x/n,f=c.y/s,p=(c.x+e.width)/n,g=(c.y+e.height)/s,v=l.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),y=o,m=a,x=o,w=u,b=h,T=u,S=h,_=a;r.roundPixels&&(y|=0,m|=0,x|=0,w|=0,b|=0,T|=0,S|=0,_|=0);var A=this.vertexViewF32,C=this.vertexViewU32;return A[++t]=y,A[++t]=m,A[++t]=d,A[++t]=f,A[++t]=0,C[++t]=v,A[++t]=x,A[++t]=w,A[++t]=d,A[++t]=g,A[++t]=0,C[++t]=v,A[++t]=b,A[++t]=T,A[++t]=p,A[++t]=g,A[++t]=0,C[++t]=v,A[++t]=y,A[++t]=m,A[++t]=d,A[++t]=f,A[++t]=0,C[++t]=v,A[++t]=b,A[++t]=T,A[++t]=p,A[++t]=g,A[++t]=0,C[++t]=v,A[++t]=S,A[++t]=_,A[++t]=p,A[++t]=f,A[++t]=0,C[++t]=v,this.vertexCount+=6,t}},calculateFacesAt:function(t,e){return h.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return h.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return h.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},findByIndex:function(t,e,i){return h.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return h.FindTile(t,e,i,n,s,r,o,this.layer)},filterTiles:function(t,e,i,n,s,r,o){return h.FilterTiles(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return h.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return h.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return h.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return h.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return h.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return h.GetTilesWithinShape(t,e,i,this.layer)},hasTileAt:function(t,e){return h.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return h.HasTileAtWorldXY(t,e,i,this.layer)},renderDebug:function(t,e){return h.RenderDebug(t,e,this.layer),this},setCollision:function(t,e,i){return h.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return h.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return h.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return h.SetCollisionByExclusion(t,e,i,this.layer),this},setTileIndexCallback:function(t,e,i){return h.SetTileIndexCallback(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return h.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return h.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return h.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return h.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return h.TileToWorldXY(t,e,i,n,this.layer)},worldToTileX:function(t,e,i){return h.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return h.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return h.WorldToTileXY(t,e,i,n,s,this.layer)},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.tileset=void 0,this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this)}});t.exports=u},function(t,e,i){var n=i(0),s=i(14),r=i(449),o=i(19),a=i(103),h=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DynamicTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=n,this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=a.CullTiles,this._renderOrder=0,this.setAlpha(this.layer.alpha),this.setPosition(s,r),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline")},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.tileset=void 0,this.culledTiles.length=0,this.cullCallback=null,o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(31),r=i(209),o=i(20),a=i(29),h=i(77),l=i(243),u=i(208),c=i(55),d=i(103),f=i(99),p=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn('Invalid image key given for tileset: "'+e+'"'),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn('No data found in the JSON tilemap from Tiled matching the tileset name: "'+t+'"'),null;if(this.tilesets[l])return this.tilesets[l].setTileSize(i,n),this.tilesets[l].setSpacing(s,r),this.tilesets[l].setImage(h),this.tilesets[l];void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0);var u=new f(t,o,i,n,s,r);return u.setImage(h),this.tilesets.push(u),u},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new u(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:(null!==a&&d.Copy(t,e,i,n,s,r,o,a),this)},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===a&&(a=e.tileWidth),void 0===l&&(l=e.tileHeight),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===i&&(i=0),void 0===n&&(n=0),null!==this.getLayerIndex(t))return console.warn("Cannot create blank layer: layer with matching name already exists "+t),null;for(var u,d=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;fa&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[])}});t.exports=r},function(t,e,i){var n=i(455),s=i(215),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=n(t,o);if(a.x+=e,a.y+=i,t.gid){var h=s(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?(a.ellipse=t.ellipse,a.width=t.width,a.height=t.height):t.text?(a.width=t.width,a.height=t.height,a.text=t.text):(a.rectangle=!0,a.width=t.width,a.height=t.height);return a}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|s,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t-1}return!1}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l0&&r.motion=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;sn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e,i){var n=i(39),s=i(0),r=i(35),o=i(38),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i,n){void 0===i&&(i=this.offset.x),void 0===n&&(n=this.offset.y);var s=this.gameObject;return!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),this.offset.set(i,n),this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(314);function s(t){if(!(this instanceof s))return new s(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,y,m;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),y=Math.min(f.maxX,p.maxX),m=Math.min(f.maxY,p.maxY),o=Math.max(0,y-g)*Math.max(0,m-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;te._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=i(35);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(39),s=i(0),r=i(35),o=i(171),a=i(9),h=i(38),l=i(3),u=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x,e.y),this.prev=new l(e.x,e.y),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.physicsType=r.DYNAMIC_BODY,this._reset=!0,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY;var n=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,n=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},update:function(t){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds();var e=this.transform;if(this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter(),this.rotation=e.rotation,this.preRotation=this.rotation,this._reset&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves){this.world.updateMotion(this,t);var i=this.velocity.x,n=this.velocity.y;this.newVelocity.set(i*t,n*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(n,i),this.speed=Math.sqrt(i*i+n*n),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit("worldbounds",this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y,this.moves&&(0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.gameObject.x+=this._dx,this.gameObject.y+=this._dy,this._reset=!0),this._dx<0?this.facing=r.FACING_LEFT:this._dx>0&&(this.facing=r.FACING_RIGHT),this._dy<0?this.facing=r.FACING_UP:this._dy>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft(this.position),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height)),this.debugShowVelocity&&(t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t){return void 0===t&&(t=!0),this.collideWorldBounds=t,this},setVelocity:function(t,e){return this.velocity.set(t,e),this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},function(t,e,i){var n=i(233),s=i(23),r=i(0),o=i(232),a=i(35),h=i(51),l=i(11),u=i(249),c=i(248),d=i(247),f=i(231),p=i(230),g=i(4),v=i(229),y=i(514),m=i(9),x=i(228),w=i(513),b=i(508),T=i(507),S=i(95),_=i(226),A=i(227),C=i(53),M=i(3),P=i(52),E=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.bodies=new S,this.staticBodies=new S,this.pendingDestroy=new S,this.colliders=new v,this.gravity=new M(g(e,"gravity.x",0),g(e,"gravity.y",0)),this.bounds=new m(g(e,"x",0),g(e,"y",0),g(e,"width",t.sys.game.config.width),g(e,"height",t.sys.game.config.height)),this.checkCollision={up:g(e,"checkCollision.up",!0),down:g(e,"checkCollision.down",!0),left:g(e,"checkCollision.left",!0),right:g(e,"checkCollision.right",!0)},this.fps=g(e,"fps",60),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=g(e,"timeScale",1),this.OVERLAP_BIAS=g(e,"overlapBias",4),this.TILE_BIAS=g(e,"tileBias",16),this.forceX=g(e,"forceX",!1),this.isPaused=g(e,"isPaused",!1),this._total=0,this.drawDebug=g(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:g(e,"debugShowBody",!0),debugShowStaticBody:g(e,"debugShowStaticBody",!0),debugShowVelocity:g(e,"debugShowVelocity",!0),bodyDebugColor:g(e,"debugBodyColor",16711935),staticBodyDebugColor:g(e,"debugStaticBodyColor",255),velocityDebugColor:g(e,"debugVelocityColor",65280)},this.maxEntries=g(e,"maxEntries",16),this.useTree=g(e,"useTree",!0),this.tree=new x(this.maxEntries),this.staticTree=new x(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new C,this._tempMatrix2=new C,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=a.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=s;)this._elapsed-=s,i++,this.step(n);this.stepsLastFrame=i}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(o=(r=s.entries).length,t=0;ta.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,u=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)l.right&&(a=h(u.x,u.y,l.right,l.y)-u.radius):u.y>l.bottom&&(u.xl.right&&(a=h(u.x,u.y,l.right,l.bottom)-u.radius)),a*=-1}else a=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===a||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==a&&(t.onOverlap||e.onOverlap)&&this.emit("overlap",t.gameObject,e.gameObject,t,e),0!==a;var c=t.velocity.x,d=t.velocity.y,g=t.mass,v=e.velocity.x,y=e.velocity.y,m=e.mass,x=c*Math.cos(o)+d*Math.sin(o),w=c*Math.sin(o)-d*Math.cos(o),b=v*Math.cos(o)+y*Math.sin(o),T=v*Math.sin(o)-y*Math.cos(o),S=((g-m)*x+2*m*b)/(g+m),_=(2*g*x+(m-g)*b)/(g+m);t.immovable||(t.velocity.x=(S*Math.cos(o)-w*Math.sin(o))*t.bounce.x,t.velocity.y=(w*Math.cos(o)+S*Math.sin(o))*t.bounce.y,c=t.velocity.x,d=t.velocity.y),e.immovable||(e.velocity.x=(_*Math.cos(o)-T*Math.sin(o))*e.bounce.x,e.velocity.y=(T*Math.cos(o)+_*Math.sin(o))*e.bounce.y,v=e.velocity.x,y=e.velocity.y),Math.abs(o)0&&!t.immovable&&v>c?t.velocity.x*=-1:v<0&&!e.immovable&&c0&&!t.immovable&&y>d?t.velocity.y*=-1:y<0&&!e.immovable&&dMath.PI/2&&(c<0&&!t.immovable&&v0&&!e.immovable&&c>v?e.velocity.x*=-1:d<0&&!t.immovable&&y0&&!e.immovable&&c>y&&(e.velocity.y*=-1));var A=this._frameTime;return t.immovable||(t.x+=t.velocity.x*A-a*Math.cos(o),t.y+=t.velocity.y*A-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*A+a*Math.cos(o),e.y+=e.velocity.y*A+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),t.postUpdate(),e.postUpdate(),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f,p=e.getTilesWithinWorldXY(a,h,l,u);if(0===p.length)return!1;for(var g={left:0,right:0,top:0,bottom:0},v=0;v0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=o[s],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],y=e*o-i*r,m=e*a-n*r,x=e*h-s*r,w=i*a-n*o,b=i*h-s*o,T=n*h-s*a,S=l*p-u*f,_=l*g-c*f,A=l*v-d*f,C=u*g-c*p,M=u*v-d*p,P=c*v-d*g,E=y*P-m*M+x*C+w*A-b*_+T*S;return E?(E=1/E,t[0]=(o*P-a*M+h*C)*E,t[1]=(n*M-i*P-s*C)*E,t[2]=(p*T-g*b+v*w)*E,t[3]=(c*b-u*T-d*w)*E,t[4]=(a*A-r*P-h*_)*E,t[5]=(e*P-n*A+s*_)*E,t[6]=(g*x-f*T-v*m)*E,t[7]=(l*T-c*x+d*m)*E,t[8]=(r*M-o*A+h*S)*E,t[9]=(i*A-e*M-s*S)*E,t[10]=(f*b-p*x+v*y)*E,t[11]=(u*x-l*b-d*y)*E,t[12]=(o*_-r*C-a*S)*E,t[13]=(e*C-i*_+n*S)*E,t[14]=(p*m-f*w-g*y)*E,t[15]=(l*w-u*m+c*y)*E,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=t.val,x=m[0],w=m[1],b=m[2],T=m[3];return e[0]=x*i+w*o+b*u+T*p,e[1]=x*n+w*a+b*c+T*g,e[2]=x*s+w*h+b*d+T*v,e[3]=x*r+w*l+b*f+T*y,x=m[4],w=m[5],b=m[6],T=m[7],e[4]=x*i+w*o+b*u+T*p,e[5]=x*n+w*a+b*c+T*g,e[6]=x*s+w*h+b*d+T*v,e[7]=x*r+w*l+b*f+T*y,x=m[8],w=m[9],b=m[10],T=m[11],e[8]=x*i+w*o+b*u+T*p,e[9]=x*n+w*a+b*c+T*g,e[10]=x*s+w*h+b*d+T*v,e[11]=x*r+w*l+b*f+T*y,x=m[12],w=m[13],b=m[14],T=m[15],e[12]=x*i+w*o+b*u+T*p,e[13]=x*n+w*a+b*c+T*g,e[14]=x*s+w*h+b*d+T*v,e[15]=x*r+w*l+b*f+T*y,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],y=i[7],m=i[8],x=i[9],w=i[10],b=i[11],T=n*n*l+h,S=s*n*l+r*a,_=r*n*l-s*a,A=n*s*l-r*a,C=s*s*l+h,M=r*s*l+n*a,P=n*r*l+s*a,E=s*r*l-n*a,k=r*r*l+h;return i[0]=u*T+p*S+m*_,i[1]=c*T+g*S+x*_,i[2]=d*T+v*S+w*_,i[3]=f*T+y*S+b*_,i[4]=u*A+p*C+m*M,i[5]=c*A+g*C+x*M,i[6]=d*A+v*C+w*M,i[7]=f*A+y*C+b*M,i[8]=u*P+p*E+m*k,i[9]=c*P+g*E+x*k,i[10]=d*P+v*E+w*k,i[11]=f*P+y*E+b*k,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,y=o*h,m=o*l;return i[0]=1-(f+g),i[1]=c+m,i[2]=d-y,i[3]=0,i[4]=c-m,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+y,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,y=r*h;return e[0]=1-(d+p),e[1]=u+y,e[2]=c-v,e[3]=0,e[4]=u-y,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),y=h*(g*=v)-l*(p*=v),m=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(y*y+m*m+x*x))?(y*=v=1/v,m*=v,x*=v):(y=0,m=0,x=0);var w=p*x-g*m,b=g*y-f*x,T=f*m-p*y;return(v=Math.sqrt(w*w+b*b+T*T))?(w*=v=1/v,b*=v,T*=v):(w=0,b=0,T=0),n[0]=y,n[1]=w,n[2]=f,n[3]=0,n[4]=m,n[5]=b,n[6]=p,n[7]=0,n[8]=x,n[9]=T,n[10]=g,n[11]=0,n[12]=-(y*s+m*r+x*o),n[13]=-(w*s+b*r+T*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],y=c[5],m=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+y*h,e[4]=g*n+v*o+y*l,e[5]=g*s+v*a+y*u,e[6]=m*i+x*r+w*h,e[7]=m*n+x*o+w*l,e[8]=m*s+x*a+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,y=this.val;return y[0]=1-(c+f),y[3]=l+v,y[6]=u-g,y[1]=l-v,y[4]=1-(h+f),y[7]=d+p,y[2]=u+g,y[5]=d-p,y[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],x=n*h-s*a,w=n*l-r*a,b=n*u-o*a,T=s*l-r*h,S=s*u-o*h,_=r*u-o*l,A=c*v-d*g,C=c*y-f*g,M=c*m-p*g,P=d*y-f*v,E=d*m-p*v,k=f*m-p*y,F=x*k-w*E+b*P+T*M-S*C+_*A;return F?(F=1/F,i[0]=(h*k-l*E+u*P)*F,i[1]=(l*M-a*k-u*C)*F,i[2]=(a*E-h*M+u*A)*F,i[3]=(r*E-s*k-o*P)*F,i[4]=(n*k-r*M+o*C)*F,i[5]=(s*M-n*E-o*A)*F,i[6]=(v*_-y*S+m*T)*F,i[7]=(y*b-g*_-m*w)*F,i[8]=(g*S-v*b+m*x)*F,this):null}});t.exports=n},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e,i){var n=i(245);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),te-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)=0?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="txt";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"text",cache:t.cacheManager.text,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",function(t,e,i){if(Array.isArray(t))for(var n=0;n=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=this.threshold?this.pressed||(this.pressed=!0,this.events.emit("down",e,this,t),this.pad.emit("down",i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit("up",e,this,t),this.pad.emit("up",i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){t.exports={CircleToCircle:i(702),CircleToRectangle:i(701),GetRectangleIntersection:i(700),LineToCircle:i(273),LineToLine:i(107),LineToRectangle:i(699),PointToLine:i(272),PointToLineSegment:i(698),RectangleToRectangle:i(147),RectangleToTriangle:i(697),RectangleToValues:i(696),TriangleToCircle:i(695),TriangleToLine:i(694),TriangleToTriangle:i(693)}},function(t,e,i){t.exports={Circle:i(722),Ellipse:i(712),Intersects:i(274),Line:i(692),Point:i(674),Polygon:i(660),Rectangle:i(266),Triangle:i(631)}},function(t,e,i){var n=i(0),s=i(277),r=i(197),o=i(10),a=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1},enable:function(){return this.active=!0,this},disable:function(){return this.active=!1,this},cull:function(t){var e=this.lights,i=this.culledLights,n=e.length,s=t.x+t.width/2,o=t.y+t.height/2,a=(t.width+t.height)/2,h={x:0,y:0},l=t.matrix,u=this.systems.game.config.height;i.length=0;for(var c=0;c0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],r):h=new s(t,e,i,a[0],a[1],a[2],r),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=a},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t,e,i,n,s,r,o){this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1},set:function(t,e,i,n,s,r,o){return this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1,this},setScrollFactor:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this},setColor:function(t){var e=s.getFloatsFromUintRGB(t);return this.r=e[0],this.g=e[1],this.b=e[2],this},setIntensity:function(t){return this.intensity=t,this},setPosition:function(t,e){return this.x=t,this.y=e,this},setRadius:function(t){return this.radius=t,this}});t.exports=r},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e,i){var n=i(6),s=i(65);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(0),s=i(27),r=i(59),o=i(771),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),s.call(this,t,"Triangle",new r(n,o,a,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,s,r){return this.geom.setTo(t,e,i,n,s,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(774),s=i(0),r=i(64),o=i(27),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(65),s=i(54);t.exports=function(t){for(var e=t.points,i=0,r=0;rc+v)){var y=g.getPoint((u-c)/v);o.push(y);break}c+=v}return o}},function(t,e,i){var n=i(9);t.exports=function(t,e){void 0===e&&(e=new n);for(var i,s=1/0,r=1/0,o=-s,a=-r,h=0;h0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=i(66),s=i(0),r=i(14),o=i(302),a=i(301),h=i(821),l=i(2),u=i(161),c=i(299),d=i(84),f=i(304),p=i(298),g=i(9),v=i(110),y=i(3),m=i(52),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0),this.y=new h(e,"y",0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3),this.angle=new h(e,"angle",{min:0,max:360}),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new y,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0?n.pop():new this.particleClass(this)).fire(e,i),this.particleBringToTop?this.alive.push(r):this.alive.unshift(r),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,r,this),this.atLimit())break}return r}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);for(var n=this.manager.getProcessors(),s=this.alive,r=s.length,o=0;o0){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y},indexSortCallback:function(t,e){return t.index-e.index}});t.exports=x},function(t,e,i){var n=i(0),s=i(31),r=i(51),o=new n({initialize:function(t){this.emitter=t,this.frame=null,this.index=0,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint"),this.index=i.alive.length},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s>>16,m=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+y+","+m+","+x+","+d+")",c.lineWidth=v,w+=3;break;case n.FILL_STYLE:g=l[w+1],f=l[w+2],y=(16711680&g)>>>16,m=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+y+","+m+","+x+","+f+")",w+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[w+1],l[w+2],l[w+3],l[w+4]):c.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.fill(),w+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.stroke(),w+=6;break;case n.LINE_TO:c.lineTo(l[w+1],l[w+2]),w+=2;break;case n.MOVE_TO:c.moveTo(l[w+1],l[w+2]),w+=2;break;case n.LINE_FX_TO:c.lineTo(l[w+1],l[w+2]),w+=5;break;case n.MOVE_FX_TO:c.moveTo(l[w+1],l[w+2]),w+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[w+1],l[w+2]),w+=2;break;case n.SCALE:c.scale(l[w+1],l[w+2]),w+=2;break;case n.ROTATE:c.rotate(l[w+1]),w+=1;break;case n.GRADIENT_FILL_STYLE:w+=5;break;case n.GRADIENT_LINE_STYLE:w+=6;break;case n.SET_TEXTURE:w+=2}c.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var n=i(307),s=i(155),r=i(92),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(4),s=i(121),r=function(t,e,i){for(var n=[],s=0;sr;){if(o-r>600){var h=o-r+1,l=e-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*c/h+d)),p=Math.min(o,Math.floor(e+(h-l)*c/h+d));i(t,e,f,p,a)}var g=t[e],v=r,y=o;for(n(t,r,e),a(t[o],g)>0&&n(t,r,o);v0;)y--}0===a(t[r],g)?n(t,r,y):n(t,++y,o),y<=e&&(r=y+1),e<=y&&(o=y-1)}};function n(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function s(t,e){return te?1:0}t.exports=i},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s-1;r--)n[s][r]=t[r][s]}return n}},function(t,e,i){t.exports={AtlasXML:i(885),Canvas:i(884),Image:i(883),JSONArray:i(882),JSONHash:i(881),SpriteSheet:i(880),SpriteSheetFromAtlas:i(879),UnityYAML:i(878)}},function(t,e,i){var n=i(24),s=i(0),r=i(117),o=i(93),a=new s({initialize:function(t,e,i,n){var s=t.manager.game;this.renderer=s.renderer,this.texture=t,this.source=e,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.width||0,this.height=n||e.naturalHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isRenderTexture="RenderTexture"===e.type,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.init(s)},init:function(t){this.renderer&&(this.renderer.gl?this.isCanvas?this.glTexture=this.renderer.canvasToTexture(this.image):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=this.renderer.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.glTexture=this.renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t)},update:function(){this.renderer.gl&&this.isCanvas&&(this.glTexture=this.renderer.canvasToTexture(this.image,this.glTexture))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&n.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},function(t,e,i){var n=i(24),s=i(886),r=i(0),o=i(37),a=i(26),h=i(11),l=i(358),u=i(4),c=i(317),d=i(164),f=new r({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=n.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once("boot",this.boot,this)},boot:function(){this._pending=2,this.on("onload",this.updatePending,this),this.on("onerror",this.updatePending,this),this.addBase64("__DEFAULT",this.game.config.defaultImage),this.addBase64("__MISSING",this.game.config.missingImage),this.game.events.once("destroy",this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off("onload"),this.off("onerror"),this.game.events.emit("texturesready"))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(delete this.list[t.key],t.destroy(),this.emit("removetexture",t.key)),this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,n=new Image;n.onerror=function(){i.emit("onerror",t)},n.onload=function(){var e=i.create(t,n);c.Image(e,0),i.emit("addtexture",t,e),i.emit("onload",t,e)},n.src=e}return this},getBase64:function(t,e,i,s){void 0===i&&(i="image/png"),void 0===s&&(s=.92);var r="",o=this.getFrame(t,e);if(o){var a=o.canvasData,h=n.create2D(this,a.width,a.height);h.getContext("2d").drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=h.toDataURL(i,s),n.remove(h)}return r},addImage:function(t,e,i){var n=null;return this.checkKey(t)&&(n=this.create(t,e),c.Image(n,0),i&&n.setDataSource(i),this.emit("addtexture",t,n)),n},addRenderTexture:function(t,e){var i=null;return this.checkKey(t)&&((i=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),this.emit("addtexture",t,i)),i},generate:function(t,e){if(this.checkKey(t)){var i=n.create(this,1,1);return e.canvas=i,l(e),this.addCanvas(t,i)}return null},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var s=n.create(this,e,i,a.CANVAS,!0);return this.addCanvas(t,s)}return null},addCanvas:function(t,e,i){void 0===i&&(i=!1);var n=null;return i?n=new s(this,t,e,e.width,e.height):this.checkKey(t)&&(n=new s(this,t,e,e.width,e.height),this.list[t]=n,this.emit("addtexture",t,n)),n},addAtlas:function(t,e,i,n){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,n):this.addAtlasJSONHash(t,e,i,n)},addAtlasJSONArray:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=1===i.length,o=0;o=r.x&&t=r.y&&e=r.x&&t=r.y&&e0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit("resume",this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit("stop",this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,"rate",t)||(this.calculateRate(),this.emit("rate",this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,"detune",t)||(this.calculateRate(),this.emit("detune",this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit("loop",this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(115),s=i(0),r=i(324),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var n=0;n-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit("transitioninit",n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once("complete",this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},resize:function(t,e){for(var i=0;i=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e,i){var n=i(0),s=i(11),r=i(7),o=i(13),a=i(5),h=i(2),l=i(15),u=i(331),c=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once("boot",this.boot,this)},boot:function(){var t,e,i,n,s,r,o,a=this.game.config,l=a.installGlobalPlugins;for(l=l.concat(this._pendingGlobal),t=0;t10&&(t=10-this.pointersTotal);for(var i=0;i0},queueTouchStart:function(t){if(this.queue.push(s.TOUCH_START,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueTouchMove:function(t){if(this.queue.push(s.TOUCH_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueTouchEnd:function(t){if(this.queue.push(s.TOUCH_END,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},queueMouseDown:function(t){if(this.queue.push(s.MOUSE_DOWN,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueMouseMove:function(t){if(this.queue.push(s.MOUSE_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueMouseUp:function(t){if(this.queue.push(s.MOUSE_UP,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},addUpCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.upOnce.push(t):this.domCallbacks.up.push(t),this._hasUpCallback=!0,this},addDownCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.downOnce.push(t):this.domCallbacks.down.push(t),this._hasDownCallback=!0,this},addMoveCallback:function(t,e){return void 0===e&&(e=!1),e?this.domCallbacks.moveOnce.push(t):this.domCallbacks.move.push(t),this._hasMoveCallback=!0,this},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var n=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){n=!1;break}s=s.parentContainer}while(s);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;1!==i.resolution&&(a+=i._x,h+=i._y),i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this._tempMatrix,d=this._tempMatrix2,f=0;f1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e,i){var n=i(37);n.ColorToRGBA=i(914),n.ComponentToHex=i(347),n.GetColor=i(177),n.GetColor32=i(377),n.HexStringToColor=i(378),n.HSLToColor=i(913),n.HSVColorWheel=i(912),n.HSVToRGB=i(176),n.HueToComponent=i(346),n.IntegerToColor=i(375),n.IntegerToRGB=i(374),n.Interpolate=i(911),n.ObjectToColor=i(373),n.RandomRGB=i(910),n.RGBStringToColor=i(372),n.RGBToHSV=i(376),n.RGBToString=i(909),n.ValueToColor=i(178),t.exports=n},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(170),s=i(0),r=i(70),o=i(3),a=new s({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;ei;)n-=i;n16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(37),s=i(374);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(ef.right&&(p=u(p,p+(v-f.right),this.lerp.x)),yf.bottom&&(g=u(g,g+(y-f.bottom),this.lerp.y))):(p=u(p,v-l,this.lerp.x),g=u(g,y-c,this.lerp.y))}this.useBounds&&(p=this.clampX(p),g=this.clampY(g)),this.roundPixels&&(l=Math.round(l),c=Math.round(c)),this.scrollX=p,this.scrollY=g;var m=p+s,x=g+o;this.midPoint.set(m,x);var w=i/a,b=n/a;this.worldView.setTo(m-w/2,x-b/2,w,b),h.loadIdentity(),h.scale(e,e),h.translate(this.x+l,this.y+c),h.rotate(this.rotation),h.scale(a,a),h.translate(-l,-c),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(381),s=new(i(0))({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once("destroy",this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","text","html","obj","tilemap","xml"],e=0;ee.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=i(23),s=i(0),r=i(384),o=i(383),a=i(4),h=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,a(i,"frames",[]),a(i,"defaultTextureKey",null)),this.frameRate=a(i,"frameRate",null),this.duration=a(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=a(i,"skipMissedFrames",!0),this.delay=a(i,"delay",0),this.repeat=a(i,"repeat",0),this.repeatDelay=a(i,"repeatDelay",0),this.yoyo=a(i,"yoyo",!1),this.showOnStart=a(i,"showOnStart",!1),this.hideOnComplete=a(i,"hideOnComplete",!1),this.paused=!1,this.manager.on("pauseall",this.pause,this),this.manager.on("resumeall",this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=l[0],l[0].prevFrame=s;var v=1/(l.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),r(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);t._repeatDelay>0&&!1===t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay):(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter)))},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off("pauseall",this.pause,this),this.manager.off("resumeall",this.resume,this),this.manager.remove(this.key);for(var t=0;t-h&&(c-=h,n+=l),f=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(16),s=i(53),r=i(200),o=i(199),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t}};t.exports=a},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){this.geometryMask=t},preRenderWebGL:function(t,e,i){var n=t.gl,s=this.geometryMask;t.flush(),n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.NOTEQUAL,1,1),n.stencilOp(n.REPLACE,n.REPLACE,n.REPLACE),s.renderWebGL(t,s,0,i),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilFunc(n.EQUAL,1,1),n.stencilOp(n.KEEP,n.KEEP,n.KEEP)},postRenderWebGL:function(t){var e=t.gl;t.flush(),e.disable(e.STENCIL_TEST)},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){var i=t.sys.game.renderer;if(this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,i&&i.gl){var n=i.width,s=i.height,r=0==(n&n-1)&&0==(s&s-1),o=i.gl,a=r?o.REPEAT:o.CLAMP_TO_EDGE,h=o.LINEAR;this.mainTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.maskTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.mainFramebuffer=i.createFramebuffer(n,s,this.mainTexture,!1),this.maskFramebuffer=i.createFramebuffer(n,s,this.maskTexture,!1),i.onContextRestored(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,o=s.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!1),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!1)},this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t){t.pipelines.BitmapMaskPipeline.endMask(this)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null;var t=this.renderer;t&&t.gl&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer)),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null,this.renderer=null}});t.exports=n},function(t,e,i){var n=i(395),s=i(394),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&this.texture&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*s-a*r+e,t.y=o*r+a*s+i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var n=i(190),s=i(123);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e,i){var n=i(23),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var n=i(403),s=i(192),r=i(92),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;i--){var n=Math.floor(this.frac()*(e+1)),s=t[n];t[n]=t[i],t[i]=s}return t}});t.exports=n},function(t,e,i){var n=i(192),s=i(92),r=i(16),o=i(6);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(43),s=i(41),r=i(42),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(45),s=i(41),r=i(44),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(41),r=i(74),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(43),r=i(73),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(72),s=i(45),r=i(73),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(74),s=i(73);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(412),s=i(75),r=i(72);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(47),s=i(43),r=i(46),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(45),r=i(46),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(75),r=i(46),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(193),s=[];s[n.BOTTOM_CENTER]=i(416),s[n.BOTTOM_LEFT]=i(415),s[n.BOTTOM_RIGHT]=i(414),s[n.CENTER]=i(413),s[n.LEFT_CENTER]=i(411),s[n.RIGHT_CENTER]=i(410),s[n.TOP_CENTER]=i(409),s[n.TOP_LEFT]=i(408),s[n.TOP_RIGHT]=i(407);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){t.exports={Angle:i(1049),Call:i(1048),GetFirst:i(1047),GetLast:i(1046),GridAlign:i(1045),IncAlpha:i(1034),IncX:i(1033),IncXY:i(1032),IncY:i(1031),PlaceOnCircle:i(1030),PlaceOnEllipse:i(1029),PlaceOnLine:i(1028),PlaceOnRectangle:i(1027),PlaceOnTriangle:i(1026),PlayAnimation:i(1025),PropertyValueInc:i(32),PropertyValueSet:i(25),RandomCircle:i(1024),RandomEllipse:i(1023),RandomLine:i(1022),RandomRectangle:i(1021),RandomTriangle:i(1020),Rotate:i(1019),RotateAround:i(1018),RotateAroundDistance:i(1017),ScaleX:i(1016),ScaleXY:i(1015),ScaleY:i(1014),SetAlpha:i(1013),SetBlendMode:i(1012),SetDepth:i(1011),SetHitArea:i(1010),SetOrigin:i(1009),SetRotation:i(1008),SetScale:i(1007),SetScaleX:i(1006),SetScaleY:i(1005),SetTint:i(1004),SetVisible:i(1003),SetX:i(1002),SetXY:i(1001),SetY:i(1e3),ShiftPosition:i(999),Shuffle:i(998),SmootherStep:i(997),SmoothStep:i(996),Spread:i(995),ToggleVisible:i(994),WrapInRectangle:i(993)}},function(t,e){var i={};t.exports=i,i.create=function(t,e){var n=t.bodyA,s=t.bodyB,r={id:i.id(n,s),bodyA:n,bodyB:s,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||s.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(r,t,e),r},i.update=function(t,e,n){if(t.collision=e,e.collided){var s=e.supports,r=t.activeContacts,o=e.parentA,a=e.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h0&&n>0&&s.scissor(t,this.drawingBufferHeight-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},setBlendMode:function(t){var e=this.gl,i=this.blendModes[t];return t!==r.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),i.func.length>2?e.blendFuncSeparate(i.func[0],i.func[1],i.func[2],i.func[3]):e.blendFunc(i.func[0],i.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>16&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e){var i=this.gl;return t!==this.currentTextures[e]&&(this.flush(),this.currentActiveTextureUnit!==e&&(i.activeTexture(i.TEXTURE0+e),this.currentActiveTextureUnit=e),i.bindTexture(i.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t){var e=this.gl,i=this.width,n=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(i=t.renderTexture.width,n=t.renderTexture.height):this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),e.viewport(0,0,i,n),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,a=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,o(e,i)&&(h=s.REPEAT),n===r.ScaleModes.LINEAR&&this.config.antialias&&(a=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,a,h,h,s.RGBA,t):this.createTexture2D(0,a,a,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&a(this.nativeTextures,e),this.gl.deleteTexture(t),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,s=t._ch,r=this.pipelines.TextureTintPipeline,o=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-s),this.setFramebuffer(t.framebuffer);var a=this.gl;a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),r.projOrtho(e,n+e,i,s+i,-1e3,1e3),o.alphaGL>0&&r.drawFillRect(e,i,n+e,s+i,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL),t.emit("prerender",t)}else o.alphaGL>0?(this.pushScissor(e,i,n,s),r.drawFillRect(e,i,n,s,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL)):this.pushScissor(e,i,n,s)},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,l.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,l.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit("postrender",t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=l.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n in this.config.clearBeforeRender&&(t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)),t.enable(t.SCISSOR_TEST),i)i[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,o=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=0;l=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===m&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(y,m),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=u},function(t,e,i){var n=new(i(0))({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once("remove",this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,this._timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this._delay=0,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this.forward=!0,this._reverse=!1,this.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},setDelay:function(t){return void 0===t&&(t=0),this._delay=t,this.parent},getDelay:function(){return this._delay},delayedPlay:function(t,e,i){return this.play(e,!0,i),this.nextTick+=t,this.parent},getCurrentKey:function(){if(this.currentAnim)return this.currentAnim.key},load:function(t,e){return void 0===e&&(e=0),this.isPlaying&&this.stop(),this.animationManager.load(this,t,e),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.updateFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.updateFrame(t),this.parent},isPaused:{get:function(){return this._paused}},play:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!0,this._reverse=!1,this._startAnimation(t,i))},playReverse:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!1,this._reverse=!0,this._startAnimation(t,i))},_startAnimation:function(t,e){this.load(t,e);var i=this.currentAnim,n=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,i.showOnStart&&(n.visible=!0),n.emit("animationstart",this.currentAnim,this.currentFrame),n},reverse:function(t){return this.isPlaying&&this.currentAnim.key===t?(this._reverse=!this._reverse,this.forward=!this.forward,this.parent):this.parent},getProgress:function(){var t=this.currentFrame.progress;return this.forward||(t=1-t),t},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},remove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},getRepeat:function(){return this._repeat},setRepeat:function(t){return this._repeat=t,this.repeatCounter=0,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){return void 0===t&&(t=!1),this.currentAnim.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(this.currentAnim.frames[0]),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent;return t.emit("animationcomplete",this.currentAnim,this.currentFrame),t},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopOnRepeat:function(){return this._pendingStop=2,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},setTimeScale:function(t){return void 0===t&&(t=1),this._timeScale=t,this.parent},getTimeScale:function(){return this._timeScale},getTotalFrames:function(){return this.currentAnim.frames.length},update:function(t,e){if(this.currentAnim&&this.isPlaying&&!this.currentAnim.paused){if(this.accumulator+=e*this._timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.currentAnim.completeAnimation(this);this.accumulator>=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit("animationupdate",i,t),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off("remove",this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=n},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,function(t,i){return e[Number(i)-1]})}},function(t,e,i){t.exports={Format:i(429),Pad:i(179),Reverse:i(428),UppercaseFirst:i(328),UUID:i(296)}},function(t,e,i){var n=i(63);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)&&(i[s]=e[s]);return i}},function(t,e){t.exports=function(t,e){for(var i=0;i-1&&(e.state=a.REMOVED,s.splice(r,1)):(e.state=a.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t0){var s=t.gl,r=this.pipeline,o=r.vertexBuffer,a=e.tileset.glTexture;t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer,t.setPipeline(r),t.setTexture2D(a,0),s.drawArrays(r.topology,0,e.vertexCount),r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}}},function(t,e,i){var n=i(1),s=i(1);n=i(445),s=i(444),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.tileset,c=t.currentContext,d=u.image.getSourceImage();c.save(),l.copyToContext(c);for(var f=n.alpha*e.alpha,p=0;p-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(20);t.exports=function(t){for(var e,i,s,r,o,a=0;a>>0;return n}},function(t,e,i){var n=i(458),s=i(2),r=i(77),o=i(215),a=i(55);t.exports=function(t,e){for(var i=[],h=0;h0){var y=new a(u,v.gid,c,f.length,t.tilewidth,t.tileheight);y.rotation=v.rotation,y.flipX=v.flipped,d.push(y)}else{var m=e?null:new a(u,-1,c,f.length,t.tilewidth,t.tileheight);d.push(m)}++c===l.width&&(f.push(d),c=0,d=[])}u.data=f,i.push(u)}}return i}},function(t,e,i){t.exports={Parse:i(218),Parse2DArray:i(132),ParseCSV:i(217),Impact:i(211),Tiled:i(216)}},function(t,e,i){var n=i(49),s=i(48),r=i(3);t.exports=function(t,e,i,o,a,h){return void 0===o&&(o=new r(0,0)),o.x=n(t,i,a,h),o.y=s(e,i,a,h),o}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o){if(void 0!==r){var a,h=n(t,e,i,s,null,o),l=0;for(a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e,i){var n=i(56),s=i(34),r=i(84);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;ae)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(56),s=i(34),r=i(133);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=m;a--)for(o=v;o=m;a--)for(o=y;o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(101),s=i(100),r=i(17),o=i(221);t.exports=function(t,e,i,a,h,l){void 0===i&&(i={}),Array.isArray(t)||(t=[t]);var u=l.tilemapLayer;void 0===a&&(a=u.scene),void 0===h&&(h=a.cameras.main);var c,d=r(0,0,l.width,l.height,null,l),f=[];for(c=0;c=0&&p=0&&g=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("update",this.step,this),t.events.emit("transitioncomplete",this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i){return this.manager.add(t,e,i),this},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off("shutdown",this.shutdown,this),t.off("postupdate",this.step,this),t.off("transitionout")},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",a,"scenePlugin"),t.exports=a},function(t,e,i){var n=i(116),s=i(20),r={SceneManager:i(330),ScenePlugin:i(495),Settings:i(327),Systems:i(165)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(222),s=new(i(0))({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=s},function(t,e,i){t.exports={BasePlugin:i(222),DefaultPlugins:i(166),PluginCache:i(15),PluginManager:i(332),ScenePlugin:i(497)}},function(t,e,i){var n={};t.exports=n;var s=i(136),r=(i(194),i(33));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){var n={};t.exports=n;var s=i(33);n._registry={},n.register=function(t){if(n.isPlugin(t)||s.warn("Plugin.register:",n.toString(t),"does not implement all required fields."),t.name in n._registry){var e=n._registry[t.name],i=n.versionParse(t.version).number,r=n.versionParse(e.version).number;i>r?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n=i(1064);n.Body=i(67),n.Composite=i(136),n.World=i(499),n.Detector=i(503),n.Grid=i(1063),n.Pairs=i(1062),n.Pair=i(419),n.Query=i(1088),n.Resolver=i(1061),n.SAT=i(502),n.Constraint=i(194),n.Common=i(33),n.Engine=i(1060),n.Events=i(195),n.Sleeping=i(223),n.Plugin=i(500),n.Bodies=i(125),n.Composites=i(1067),n.Axes=i(505),n.Bounds=i(79),n.Svg=i(1086),n.Vector=i(80),n.Vertices=i(94),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,t.exports=n},function(t,e,i){var n={};t.exports=n;var s=i(94),r=i(80);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlaps?s=a:a=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n=i(125),s=i(67),r=i(0),o=i(420),a=i(2),h=i(84),l=i(94),u=new r({Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var n=a(i,"body",null),s=a(i,"addToWorld",!0);if(n)this.setBody(n,s);else{var r=e.getCollisionGroup();a(r,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(80),r=i(33);n.fromVertices=function(t){for(var e={},i=0;i0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){var n=i(231);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(509);t.exports=function(t,e,i,s,r){var o=0;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y0&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom>i&&(o=t.bottom-i)>r&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:n(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(511);t.exports=function(t,e,i,s,r){var o=0;return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x0&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right>i&&(o=t.right-i)>r&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:n(t,o)),o}},function(t,e,i){var n=i(512),s=i(510),r=i(227);t.exports=function(t,e,i,o,a,h){var l=o.left,u=o.top,c=o.right,d=o.bottom,f=i.faceLeft||i.faceRight,p=i.faceTop||i.faceBottom;if(!f&&!p)return!1;var g=0,v=0,y=0,m=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l>i&&(n=h,i=l)}return n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(t,e)},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});u.register("ArcadePhysics",f,"arcadePhysics"),t.exports=f},function(t,e,i){var n=i(35),s=i(20),r={ArcadePhysics:i(527),Body:i(233),Collider:i(232),Factory:i(239),Group:i(236),Image:i(238),Sprite:i(104),StaticBody:i(226),StaticGroup:i(235),World:i(234)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(137),s=i(241),r=i(240),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o1?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t){for(var e=0,i=0;i0&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(295),IsSize:i(117),IsValue:i(549)}},function(t,e,i){var n=i(182);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(119);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return e<0?n(t[0],t[1],s):e>1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(170);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return t[0]===t[i]?(e<0&&(r=Math.floor(s=i*(1+e))),n(s-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(n(-s,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("update",this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit("progress",this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e,i){var n=i(0),s=i(11),r=i(4),o=i(106),a=i(257),h=i(142),l=i(256),u=i(602),c=i(601),d=i(600),f=i(141),p=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.keys=[],this.combos=[],this.queue=[],this.onKeyHandler,this.time=0,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.settings.input,e=this.scene.sys.game.config;this.enabled=r(t,"keyboard",e.inputKeyboard),this.target=r(t,"keyboard.target",e.inputKeyboardEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=function(e){if(!e.defaultPrevented&&t.isActive()){t.queue.push(e);var i=t.keys[e.keyCode];i&&i.preventDefault&&e.preventDefault()}};this.onKeyHandler=e,this.target.addEventListener("keydown",e,!1),this.target.addEventListener("keyup",e,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("keydown",this.onKeyHandler),this.target.removeEventListener("keyup",this.onKeyHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},createCursorKeys:function(){return this.addKeys({up:h.UP,down:h.DOWN,left:h.LEFT,right:h.RIGHT,space:h.SPACE,shift:h.SHIFT})},addKeys:function(t){var e={};if("string"==typeof t){t=t.split(",");for(var i=0;i-1?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new a(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);i>-1&&(this.keys[i]=void 0)}else"string"==typeof t&&(t=h[t.toUpperCase()]);e[t]&&(e[t]=void 0)},createCombo:function(t,e){return new l(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=f(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(t){this.time=t;var e=this.queue.length;if(this.enabled&&0!==e)for(var i=this.queue.splice(0,e),n=this.keys,s=0;s=e}}},function(t,e,i){var n=i(71),s=i(39),r=i(0),o=i(261),a=i(608),h=i(51),l=i(89),u=i(88),c=i(11),d=i(2),f=i(106),p=i(8),g=i(15),v=i(9),y=i(38),m=i(59),x=i(69),w=new r({Extends:c,initialize:function(t){c.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new c,this.enabled=!0,this.displayList,this.cameras,f.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once("destroy",this.destroy,this),this.pluginEvents.emit("boot")},start:function(){var t=this.systems.events;t.on("transitionstart",this.transitionIn,this),t.on("transitionout",this.transitionOut,this),t.on("transitioncomplete",this.transitionComplete,this),t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.enabled=!0,this.pluginEvents.emit("start")},preUpdate:function(){this.pluginEvents.emit("preUpdate");var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r-1&&(s.splice(a,1),this.clear(o))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},update:function(t,e){if(this.isActive()){this.pluginEvents.emit("update",t,e);var i=this.manager;if(!i.globalTopOnly||!i.ignoreEvents){var n=i.dirty||0===this.pollRate;if(this.pollRate>-1&&(this._pollTimer-=e,this._pollTimer<0&&(n=!0,this._pollTimer=this.pollRate)),n)for(var s=this.manager.pointers,r=0;r0&&i.globalTopOnly&&(i.ignoreEvents=!0)}}}},clear:function(t){var e=t.input;if(e){this.queueForRemoval(t),e.gameObject=void 0,e.target=void 0,e.hitArea=void 0,e.hitAreaCallback=void 0,e.callbackContext=void 0,this.manager.resetCursor(e),t.input=null;var i=this._draggable.indexOf(t);return i>-1&&this._draggable.splice(i,1),(i=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(i,1),(i=this._over[0].indexOf(t))>-1&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0?t.dragState=1:t.dragState>0&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i1&&(this.sortGameObjects(a),this.topOnly&&a.splice(1)),this._drag[t.id]=a,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(this.dragDistanceThreshold>0&&h(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),this.dragTimeThreshold>0&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(s=this._drag[t.id],i=0;i0?(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),l[0]?(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):r.target=null)}else!r.target&&l[0]&&(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target));var c=t.x-n.input.dragX,d=t.y-n.input.dragY;n.emit("drag",t,c,d),this.emit("drag",t,n,c,d)}return s.length}if(5===t.dragState){for(s=this._drag[t.id],i=0;i0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return a(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,a=!1;if(p(e)){var h=e;e=d(h,"hitArea",null),i=d(h,"hitAreaCallback",null),n=d(h,"draggable",!1),s=d(h,"dropZone",!1),r=d(h,"cursor",!1),a=d(h,"useHandCursor",!1);var l=d(h,"pixelPerfect",!1),u=d(h,"alphaTolerance",1);l&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)e.x&&t.ye.y}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),s=Math.max(t.right,e);t.x=n,t.width=s-n;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var s=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=s,t.height=r-s,t}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;on(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){var n=i(144);t.exports=function(t,e){var i=n(t);return ii&&(i=h.x),h.xr&&(r=h.y),h.ye.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e,i){var n=i(69),s=i(107);t.exports=function(t,e){return!!(n(t,e.getPointA())||n(t,e.getPointB())||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},function(t,e,i){var n=i(273),s=i(69);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottomt.right+r||it.bottom+r||st.right||e.rightt.bottom||e.bottom0}},function(t,e,i){var n=i(272);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(9),s=i(147);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){var n=i(51);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(88);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(88);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(89);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(89);n.Area=i(711),n.Circumference=i(307),n.CircumferencePoint=i(155),n.Clone=i(710),n.Contains=i(88),n.ContainsPoint=i(709),n.ContainsRect=i(708),n.CopyFrom=i(707),n.Equals=i(706),n.GetBounds=i(705),n.GetPoint=i(309),n.GetPoints=i(308),n.Offset=i(704),n.OffsetPoint=i(703),n.Random=i(185),t.exports=n},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e,i){var n=i(39);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(39);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(71);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(71);n.Area=i(721),n.Circumference=i(403),n.CircumferencePoint=i(192),n.Clone=i(720),n.Contains=i(39),n.ContainsPoint=i(719),n.ContainsRect=i(718),n.CopyFrom=i(717),n.Equals=i(716),n.GetBounds=i(715),n.GetPoint=i(406),n.GetPoints=i(404),n.Offset=i(714),n.OffsetPoint=i(713),n.Random=i(191),t.exports=n},function(t,e,i){var n=i(0),s=i(276),r=i(15),o=new n({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once("boot",this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on("shutdown",this.shutdown,this),t.on("destroy",this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(148);s.register("quad",function(t,e){void 0===t&&(t={});var i=r(t,"x",0),s=r(t,"y",0),a=r(t,"key",null),h=r(t,"frame",null),l=new o(this.scene,i,s,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l})},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(4),a=i(108);s.register("mesh",function(t,e){void 0===t&&(t={});var i=r(t,"key",null),s=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"colors",[]),u=o(t,"alphas",[]),c=o(t,"uv",[]),d=new a(this.scene,0,0,h,c,l,u,i,s);return void 0!==e&&(t.add=e),n(this.scene,d,t),d})},function(t,e,i){var n=i(148);i(5).register("quad",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(108);i(5).register("mesh",function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))})},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=this.pipeline;t.setPipeline(o,e);var a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.frame.glTexture,c=e.vertices,d=e.uv,f=e.colors,p=e.alphas,g=c.length,v=Math.floor(.5*g);o.vertexCount+v>=o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var y=o.vertexViewF32,m=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,w=0,b=e.tintFill,T=0;T0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0){var F=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(F.TL=L,F.TR=L,F.BL=L,F.BR=L,C=1;Cr;h--){for(l=0;l0&&r.maxLines1&&(d+=f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(4);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,y={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},m=0,x=0;x?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(812),s=i(20),r={Parse:i(811)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r),t.setBlankTexture(!0)}},function(t,e,i){var n=i(1),s=i(1);n=i(815),s=i(814),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(302),EdgeZone:i(301),RandomZone:i(298)}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.emitters.list,o=r.length;if(0!==o){var a=t._tempMatrix1.copyFrom(n.matrix),h=t._tempMatrix2,l=t._tempMatrix3,u=t._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);a.multiply(u);var c=n.roundPixels,d=t.currentContext;d.save();for(var f=0;f0&&(Y=Y%T-T):Y>T?Y=T:Y<0&&(Y=T+Y%T),null===C&&(C=new o(O+Math.cos(I)*D,B+Math.sin(I)*D,v),S.push(C),R+=.01);R<1+z;)b=Y*R+I,x=O+Math.cos(b)*D,w=B+Math.sin(b)*D,C.points.push(new r(x,w,v)),R+=.01;b=Y+I,x=O+Math.cos(b)*D,w=B+Math.sin(b)*D,C.points.push(new r(x,w,v));break;case n.FILL_RECT:u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==C?C.points.push(new r(p[++P],p[++P],v)):(C=new o(p[++P],p[++P],v),S.push(C));break;case n.MOVE_TO:C=new o(p[++P],p[++P],v),S.push(C);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:O=p[++P],B=p[++P],f.translate(O,B);break;case n.SCALE:O=p[++P],B=p[++P],f.scale(O,B);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var N=p[++P],U=p[++P];u.currentFrame=N,t.setTexture2D(N.glTexture,0),u.tintEffect=U;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,t.setTexture2D(t.blankTexture.glTexture,0),u.tintEffect=2}}}},function(t,e,i){var n=i(1),s=i(1);n=i(829),s=i(306),s=i(306),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(22);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length,h=t.currentContext;if(0!==a&&n(t,h,e,s,r)){var l=e.frame,u=e.displayCallback,c=s.scrollX*e.scrollFactorX,d=s.scrollY*e.scrollFactorY,f=e.fontData.chars,p=e.fontData.lineHeight,g=0,v=0,y=0,m=0,x=null,w=0,b=0,T=0,S=0,_=0,A=0,C=null,M=0,P=e.frame.source.image,E=l.cutX,k=l.cutY,F=0,L=e.fontSize/e.fontData.size;e.cropWidth>0&&e.cropHeight>0&&(h.save(),h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var R=0;R0&&e.cropHeight>0&&h.restore(),h.restore()}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length;if(0!==a){var h=this.pipeline;t.setPipeline(h,e);var l=e.cropWidth>0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,y=p.cutY,m=g.width,x=g.height,w=e._isTinted&&e.tintFill,b=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),T=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),_=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var A,C,M=0,P=0,E=0,k=0,F=e.letterSpacing,L=0,R=0,O=0,B=0,D=e.scrollX,I=e.scrollY,Y=e.fontData,X=Y.chars,z=Y.lineHeight,N=e.fontSize/Y.size,U=0,V=e._align,G=0,W=0;e.getTextBounds(!1);var H=e._bounds.lines;1===V?W=(H.longest-H.lengths[0])/2:2===V&&(W=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;Jv&&(r=v),o>y&&(o=y);var k=v+g.xAdvance,F=y+u;aA&&(A=M),M<_&&(_=M),C++,M=0;S[C]=M,M>A&&(A=M),M<_&&(_=M);var L=i.local,R=i.global,O=i.lines;return L.x=r*m,L.y=o*m,L.width=a*m,L.height=h*m,R.x=t.x-t.displayOriginX+r*x,R.y=t.y-t.displayOriginY+o*w,R.width=a*x,R.height=h*w,O.shortest=_,O.longest=A,O.lengths=S,e&&(L.x=Math.round(L.x),L.y=Math.round(L.y),L.width=Math.round(L.width),L.height=Math.round(L.height),R.x=Math.round(R.x),R.y=Math.round(R.y),R.width=Math.round(R.width),R.height=Math.round(R.height),O.shortest=Math.round(_),O.longest=Math.round(A)),i}},function(t,e,i){var n=i(0),s=i(15),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this)},add:function(t){return-1===this._list.indexOf(t)&&-1===this._pendingInsertion.indexOf(t)&&this._pendingInsertion.push(t),t},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;i0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e,i){var n=i(90);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return n(t,s)}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(s)for(var h=0;ht.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){var n=i(315);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],r=Math.max(n((e-t)/(i||1)),0),o=0;o=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var o=s;o0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t},tick:function(){this.step(window.performance.now())},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime=window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step(window.performance.now())},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e){var i=0,n=function(t,e,n,s){var r=i-s.y-s.height;t.add(n,e,s.x,r,s.width,s.height)};t.exports=function(t,e,s){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height),i=r.height;for(var o=s.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;cx||a<-x)&&(a=0),a<0&&(a=x+a),-1!==h&&(x=a+(h+1));for(var C=l,M=l,P=0,E=e.sourceIndex,k=0;kg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,y=f,m=0,x=0,w=0;wr&&(m=b-r),T>o&&(x=T-o),t.add(w,e,i+v,s+y,h-m,l-x),(v+=h+p)+h>r&&(v=f,y+=l+p)}return t}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);var r,o=i.frames;for(var a in o){var h=o[a];r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted()),r.customData=n(h)}for(var l in i)"frames"!==l&&(Array.isArray(i[l])?t.customData[l]=i[l].slice(0):t.customData[l]=i[l]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames||i.textures){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e,i){var n=i(91),s=i(118),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),n.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},function(t,e,i){var n=i(0),s=i(26),r=i(341),o=i(2),a=i(4),h=i(8),l=i(16),u=i(1),c=i(166),d=i(178),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",null),this.scaleMode=a(t,"scaleMode",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND.init(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.autoResize=a(i,"autoResize",!0),this.antialias=a(i,"antialias",!0),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",!1),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){var n=i(168),s=i(382),r=i(380),o=i(24),a=i(0),h=i(902),l=i(897),u=i(122),c=i(890),d=i(341),f=i(345),p=i(11),g=i(339),v=i(15),y=i(332),m=i(330),x=i(326),w=i(319),b=i(877),T=i(876),S=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new p,this.anims=new s(this),this.textures=new w(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new m(this,this.config.sceneConfig),this.device=d,this.sound=x.create(this),this.loop=new b(this,this.config.fps),this.plugins=new y(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){v.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),l(this),c(this),n(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("texturesready",this.texturesReady,this)):console.warn("Core Phaser Plugins missing. Cannot start.")},texturesReady:function(){this.events.emit("ready"),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),T(this);var t=this.events;t.on("hidden",this.onHidden,this),t.on("visible",this.onVisible,this),t.on("blur",this.onBlur,this),t.on("focus",this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e);var n=this.renderer;n.preRender(),i.emit("prerender",n,t,e),this.scene.render(n),n.postRender(),i.emit("postrender",n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e),i.emit("prerender"),i.emit("postrender")},onHidden:function(){this.loop.pause(),this.events.emit("pause")},onVisible:function(){this.loop.resume(),this.events.emit("resume")},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},resize:function(t,e){this.config.width=t,this.config.height=e,this.renderer.resize(t,e),this.input.resize(),this.scene.resize(t,e),this.events.emit("resize",t,e)},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit("destroy"),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=S},function(t,e,i){var n=i(0),s=i(11),r=i(15),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){t.exports={EventEmitter:i(904)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c1)for(var i=1;i>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e){t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(i){t.style[i+"user-select"]=e}),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e,i){t.exports={CanvasInterpolation:i(349),CanvasPool:i(24),Smoothing:i(175),TouchAction:i(916),UserSelect:i(915)}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e,i){t.exports={CenterOn:i(412),GetBottom:i(47),GetCenterX:i(75),GetCenterY:i(72),GetLeft:i(45),GetOffsetX:i(919),GetOffsetY:i(918),GetRight:i(43),GetTop:i(41),SetBottom:i(46),SetCenterX:i(74),SetCenterY:i(73),SetLeft:i(44),SetRight:i(42),SetTop:i(40)}},function(t,e,i){var n=i(43),s=i(41),r=i(46),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(45),s=i(41),r=i(46),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(41),r=i(46),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(43),s=i(41),r=i(44),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(43),r=i(73),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(43),r=i(46),o=i(44);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(45),s=i(41),r=i(42),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(45),r=i(73),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(45),r=i(46),o=i(42);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(43),r=i(42),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(45),r=i(44),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)+a),t}},function(t,e,i){var n=i(47),s=i(75),r=i(74),o=i(40);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){t.exports={BottomCenter:i(932),BottomLeft:i(931),BottomRight:i(930),LeftBottom:i(929),LeftCenter:i(928),LeftTop:i(927),RightBottom:i(926),RightCenter:i(925),RightTop:i(924),TopCenter:i(923),TopLeft:i(922),TopRight:i(921)}},function(t,e,i){t.exports={BottomCenter:i(416),BottomLeft:i(415),BottomRight:i(414),Center:i(413),LeftCenter:i(411),QuickSet:i(417),RightCenter:i(410),TopCenter:i(409),TopLeft:i(408),TopRight:i(407)}},function(t,e,i){var n=i(193),s=i(20),r={In:i(934),To:i(933)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(935),Bounds:i(920),Canvas:i(917),Color:i(348),Masks:i(908)}},function(t,e,i){var n=i(0),s=i(122),r=i(15),o=new n({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.events=this.systems.events,this.events.once("destroy",this.destroy,this)},start:function(){this.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},function(t,e,i){t.exports={DataManager:i(122),DataManagerPlugin:i(937)}},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},function(t,e,i){var n=i(0),s=i(356),r=i(354),o=i(5),a=i(353),h=i(939),l=i(352),u=i(9),c=i(350),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e0&&(h.preRender(r,o),t.render(n,e,i,h))}},resetAll:function(){for(var t=0;t=1?1:1/e*(1+(e*t|0))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e,i){var n=i(23),s=i(0),r=i(3),o=i(173),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new r,this.current=new r,this.destination=new r,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,a){void 0===i&&(i=1e3),void 0===n&&(n=o.Linear),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning?h:(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(h.scrollX,h.scrollY),this.destination.set(t,e),h.getScroll(t,e,this.current),"string"==typeof n&&o.hasOwnProperty(n)?this.ease=o[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=a,this.camera.emit("camerapanstart",this.camera,this,i,t,e),h)},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=s(t,"speed.x",0),this.speedY=s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={FixedKeyControl:i(988),SmoothedKeyControl:i(987)}},function(t,e,i){t.exports={Controls:i(989),Scene2D:i(986)}},function(t,e,i){t.exports={BaseCache:i(381),CacheManager:i(380)}},function(t,e,i){t.exports={Animation:i(385),AnimationFrame:i(383),AnimationManager:i(382)}},function(t,e,i){var n=i(52);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){var i={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=i},function(t,e){var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.frame.realWidth},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return this.scaleY*this.frame.realHeight},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){var n=i(93),s={_scaleMode:n.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==n.LINEAR&&t!==n.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=s},function(t,e){var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=Math.round(this.originX*this.width),this._displayOriginY=Math.round(this.originY*this.height),this}};t.exports=i},function(t,e,i){var n=i(9),s=i(397),r=i(3),o={getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getTopRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBounds:function(t){var e,i,s,r,o,a,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),s=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,s,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,s,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e,i){var n=i(417),s=i(193),r=i(2),o=i(1),a=new(i(124))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=r(e,"width",-1),o=r(e,"height",-1),h=r(e,"cellWidth",1),l=r(e,"cellHeight",h),u=r(e,"position",s.TOP_LEFT),c=r(e,"x",0),d=r(e,"y",0),f=0,p=0,g=i*h,v=o*l;a.setPosition(c,d),a.setSize(h,l);for(var y=0;y>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionstart",e,i,n)}),d.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionactive",e,i,n)}),d.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionend",e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&p.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&p.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return p.add(this.localWorld,o),o},add:function(t){return p.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return o.removeBody(this.localWorld,i,e),this},removeConstraint:function(t,e){return o.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i0&&u.trigger(t,"collisionStart",{pairs:w.collisionStart}),o.preSolvePosition(w.list),s=0;s0&&u.trigger(t,"collisionActive",{pairs:w.collisionActive}),w.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:w.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(y),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;sf.friction*f.frictionStatic*O*i&&(D=F,B=o.clamp(f.friction*L*i,-D,D));var I=r.cross(_,y),Y=r.cross(A,y),X=w/(g.inverseMass+v.inverseMass+g.inverseInertia*I*I+v.inverseInertia*Y*Y);if(R*=X,B*=X,E<0&&E*E>n._restingThresh*i)T.normalImpulse=0;else{var z=T.normalImpulse;T.normalImpulse=Math.min(T.normalImpulse+R,0),R=T.normalImpulse-z}if(k*k>n._restingThreshTangent*i)T.tangentImpulse=0;else{var N=T.tangentImpulse;T.tangentImpulse=o.clamp(T.tangentImpulse+B,-D,D),B=T.tangentImpulse-N}s.x=y.x*R+m.x*B,s.y=y.y*R+m.y*B,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(_,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(A,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(419),r=i(33);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;ou.bounds.max.x||p.bounds.max.yu.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var y=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,m=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!y&&m&&m&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||y&&!m||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(500),r=i(33);n.name="matter-js",n.version="0.14.2",n.uses=[],n.used=[],n.use=function(){s.use(n,Array.prototype.slice.call(arguments))},n.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(n,t,e)},n.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(n,t,e)}},function(t,e,i){var n=i(427),s=i(0),r=i(420),o=i(19),a=i(2),h=i(186),l=i(61),u=i(3),c=new s({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,s,r,h){o.call(this,t.scene,"Image"),this.anims=new n(this),this.setTexture(s,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=c},function(t,e,i){var n=i(0),s=i(420),r=i(19),o=i(2),a=i(86),h=i(186),l=i(3),u=new n({Extends:a,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,h],initialize:function(t,e,i,n,s,a){r.call(this,t.scene,"Image"),this.setTexture(n,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(136),r=i(194),o=i(33),a=i(67),h=i(125);n.stack=function(t,e,i,n,r,o,h){for(var l,u=s.create({label:"Stack"}),c=t,d=e,f=0,p=0;pg&&(g=m),a.translate(y,{x:.5*x,y:.5*m}),c=y.bounds.max.x+r,s.addBody(u,y),l=y,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;l=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var F=0;F_&&(_+=e.length),S=Number.MAX_VALUE,_3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);r(f(t,e-1),f(t,e),f(t,e+1))||function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))r.ACTIVE&&c(this,t,e))},setCollidesNever:function(t){for(var e=0;e1)for(var h=i/a,l=n/a,u=0;u0?r:0,y=n<0?f:0,m=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var w=Math.floor((e+v)/f);if((l>0||u===w||w<0||w>=p)&&(w=-1),u>=0&&u1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,w,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+y,e=t.pos.x,a=0;break}}if(s){var b=s>0?o:0,T=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),_=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+b)/f);var A=Math.floor((i+b)/f);if((l>0||c===A||A<0||A>=g)&&(A=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,A));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-b+T;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],y=i+s+(g<0?o:0)-d,m=n+r+(p>0?a:0)-f;if(p*m-g*y>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),w=g/x,b=-p/x,T=y*w+m*b,S=w*T,_=b*T;return S*S+_*_>=s*s+r*r?v||p*(m-r)-g*(y-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-_,t.collision.slope={x:p,y:g,nx:w,ny:b},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(225),r=i(1123),o=i(224),a=i(1122),h=new n({initialize:function(t,e,i,n,r){void 0===n&&(n=16),void 0===r&&(r=n),this.world=t,this.gameObject=null,this.enabled=!0,this.parent,this.id=t.getNextID(),this.name="",this.size={x:n,y:r},this.offset={x:0,y:0},this.pos={x:e,y:i},this.last={x:e,y:i},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:t.defaults.maxVelocityX,y:t.defaults.maxVelocityY},this.standing=!1,this.gravityFactor=t.defaults.gravityFactor,this.bounciness=t.defaults.bounciness,this.minBounceVelocity=t.defaults.minBounceVelocity,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER,this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.updateCallback,this.slopeStanding={min:.767944870877505,max:2.3736477827122884}},reset:function(t,e){this.pos={x:t,y:e},this.last={x:t,y:e},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:100,y:100},this.standing=!1,this.gravityFactor=1,this.bounciness=0,this.minBounceVelocity=40,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER},update:function(t){var e=this.pos;this.last.x=e.x,this.last.y=e.y,this.vel.y+=this.world.gravity*t*this.gravityFactor,this.vel.x=r(t,this.vel.x,this.accel.x,this.friction.x,this.maxVel.x),this.vel.y=r(t,this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var i=this.vel.x*t,n=this.vel.y*t,s=this.world.collisionMap.trace(e.x,e.y,i,n,this.size.x,this.size.y);this.handleMovementTrace(s)&&a(this,s);var o=this.gameObject;o&&(o.x=e.x-this.offset.x+o.displayOriginX*o.scaleX,o.y=e.y-this.offset.y+o.displayOriginY*o.scaleY),this.updateCallback&&this.updateCallback(this)},drawDebug:function(t){var e=this.pos;if(this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.size.x,this.size.y)),this.debugShowVelocity){var i=e.x+this.size.x/2,n=e.y+this.size.y/2;t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.vel.x,n+this.vel.y)}},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},skipHash:function(){return!this.enabled||0===this.type&&0===this.checkAgainst&&0===this.collides},touches:function(t){return!(this.pos.x>=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},,function(t,e,i){t.exports={BitmapMaskPipeline:i(421),ForwardDiffuseLightPipeline:i(197),TextureTintPipeline:i(196)}},function(t,e,i){t.exports={Utils:i(10),WebGLPipeline:i(198),WebGLRenderer:i(423),Pipelines:i(1078),BYTE:0,SHORT:1,UNSIGNED_BYTE:2,UNSIGNED_SHORT:3,FLOAT:4}},function(t,e,i){t.exports={Canvas:i(425),WebGL:i(422)}},function(t,e,i){t.exports={CanvasRenderer:i(426),GetBlendModes:i(424),SetTransform:i(22)}},function(t,e,i){t.exports={Canvas:i(1081),Snapshot:i(1080),WebGL:i(1079)}},function(t,e,i){var n=i(501),s={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Engine.update",function(){s.Engine.update(this)})},Engine:{update:function(t){for(var e=t.world,i=n.Composite.allBodies(e),r=n.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y0)for(var a=s+1;a1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),y=f+t,m=p+e}},w=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":y=t.x,m=t.y;break;case"H":y=t.x;break;case"V":m=t.y}x(y,m,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i1?1:0;n0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e){t.exports=function(t,e,i,n){var s=e.pos.x+e.size.x-i.pos.x;if(n){var r=e===n?i:e;n.vel.x=-n.vel.x*n.bounciness+r.vel.x;var o=t.collisionMap.trace(n.pos.x,n.pos.y,n===e?-s:s,0,n.size.x,n.size.y);n.pos.x=o.pos.x}else{var a=(e.vel.x-i.vel.x)/2;e.vel.x=-a,i.vel.x=a;var h=t.collisionMap.trace(e.pos.x,e.pos.y,-s/2,0,e.size.x,e.size.y);e.pos.x=Math.floor(h.pos.x);var l=t.collisionMap.trace(i.pos.x,i.pos.y,s/2,0,i.size.x,i.size.y);i.pos.x=Math.ceil(l.pos.x)}}},function(t,e,i){var n=i(225),s=i(1106),r=i(1105);t.exports=function(t,e,i){var o=null;e.collides===n.LITE||i.collides===n.FIXED?o=e:i.collides!==n.LITE&&e.collides!==n.FIXED||(o=i),e.last.x+e.size.x>i.last.x&&e.last.xi.last.y&&e.last.y0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&o0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e,i){t.exports={Body:i(1076),COLLIDES:i(225),CollisionMap:i(1075),Factory:i(1074),Image:i(1072),ImpactBody:i(1073),ImpactPhysics:i(1108),Sprite:i(1071),TYPE:i(224),World:i(1070)}},function(t,e,i){t.exports={Arcade:i(528),Impact:i(1124),Matter:i(1104)}},function(t,e,i){(function(e){i(1058);var n=i(26),s=i(20),r={Actions:i(418),Animation:i(992),Cache:i(991),Cameras:i(990),Class:i(0),Create:i(947),Curves:i(941),Data:i(938),Display:i(936),DOM:i(907),Events:i(905),Game:i(903),GameObjects:i(875),Geom:i(275),Input:i(616),Loader:i(593),Math:i(570),Physics:i(1125),Plugins:i(498),Renderer:i(1082),Scene:i(329),Scenes:i(496),Sound:i(494),Structs:i(493),Textures:i(492),Tilemaps:i(490),Time:i(441),Tweens:i(439),Utils:i(435)};r=s(!1,r,n),t.exports=r,e.Phaser=r}).call(this,i(201))}])}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1126)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,e,s,r){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,t.exports=n},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;no.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c0&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit("destroy",this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});a.RENDER_MASK=15,t.exports=a},function(t,e,i){var n=i(8),s=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit("filecomplete",e,i,t),this.loader.emit("filecomplete-"+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){t.exports=function(t,e,i,n,s){var r=n.alpha*i.alpha;if(r<=0)return!1;var o=t._tempMatrix1.copyFromArray(n.matrix.matrix),a=t._tempMatrix2.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),h=t._tempMatrix3;return s?(o.multiplyWithOffset(s,-n.scrollX*i.scrollFactorX,-n.scrollY*i.scrollFactorY),a.e=i.x,a.f=i.y,o.multiply(a,h)):(a.e-=n.scrollX*i.scrollFactorX,a.f-=n.scrollY*i.scrollFactorY,o.multiply(a,h)),e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=r,e.save(),h.setToContext(e),!0}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n,s,r,o=i(26),a=i(175),h=[],l=!1;t.exports={create2D:function(t,e,i){return n(t,e,i,o.CANVAS)},create:n=function(t,e,i,n,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=o.CANVAS),void 0===r&&(r=!1);var c=s(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&n===o.CANVAS&&a.disable(u.getContext("2d")),u},createWebGL:function(t,e,i){return n(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:s=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n={VERSION:"3.14.0",BlendModes:i(66),ScaleModes:i(94),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(54),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e,i){var n=i(66),s=i(12),r=i(94);t.exports=function(t,e,i){e.x=s(i,"x",0),e.y=s(i,"y",0),e.depth=s(i,"depth",0),e.flipX=s(i,"flipX",!1),e.flipY=s(i,"flipY",!1);var o=s(i,"scale",null);"number"==typeof o?e.setScale(o):null!==o&&(e.scaleX=s(o,"x",1),e.scaleY=s(o,"y",1));var a=s(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=s(a,"x",1),e.scrollFactorY=s(a,"y",1)),e.rotation=s(i,"rotation",0);var h=s(i,"angle",null);null!==h&&(e.angle=h),e.alpha=s(i,"alpha",1);var l=s(i,"origin",null);if("number"==typeof l)e.setOrigin(l);else if(null!==l){var u=s(l,"x",.5),c=s(l,"y",.5);e.setOrigin(u,c)}return e.scaleMode=s(i,"scaleMode",r.DEFAULT),e.blendMode=s(i,"blendMode",n.NORMAL),e.visible=s(i,"visible",!0),s(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e){t.exports=function(t,e,i){var n=i||e.fillColor,s=e.fillAlpha,r=(16711680&n)>>>16,o=(65280&n)>>>8,a=255&n;t.fillStyle="rgba("+r+","+o+","+a+","+s+")"}},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){(function(e){var i={};t.exports=i,function(){i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i.extend=function(t,e){var n,s;"boolean"==typeof e?(n=2,s=e):(n=1,s=!0);for(var r=n;r0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i>>16,r=(65280&i)>>>8,o=255&i;t.strokeStyle="rgba("+s+","+r+","+o+","+n+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),s=i(177),r=i(377),o=i(176),a=i(376),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,n,s,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},scaleY:{get:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[5]=s*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,s,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*i,a=n*n,h=s*s,l=r*r,u=Math.sqrt(o+h),c=Math.sqrt(a+l);return t.translateX=e[4],t.translateY=e[5],t.scaleX=u,t.scaleY=c,t.rotation=Math.acos(i/u)*(Math.atan(-s/i)<0?-1:1),t},applyITRS:function(t,e,i,n,s){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(r*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=r*c*e+-o*c*t+(-u*r+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=r},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(4),l=i(8),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;sthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=h},function(t,e,i){var n=i(0),s=i(14),r=i(266),o=new n({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=null,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return this.getLeft(t)+this.width/2},getCenterY:function(t){return this.getTop(t)+this.height/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight-(this.height-this.baseHeight),this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.tilemapLayer;return t?t.tileset:null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.loader=t,this.type=e,this.key=i,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={};for(var s=0;s=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;ps||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,a,h,l,u,f,g,v=e&&e.length,y=v?e[0]*i:t.length,m=s(t,0,y,i,!0),x=[];if(!m)return x;if(v&&(m=function(t,e,i,n){var o,a,h,l,u,f=[];for(o=0,a=e.length;o80*i){n=h=t[0],a=l=t[1];for(var w=i;wh&&(h=u),f>l&&(l=f);g=Math.max(h-n,l-a)}return o(m,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===A(t,e,i,n)>0)for(r=e;r=e;r-=n)o=T(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!m(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(S(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),S(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(y(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&y(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(y(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!m(s,r)&&x(s,n,n.next,r)&&w(s,r)&&w(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),S(n),S(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&w(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=b(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&w(t,e)&&w(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(m(t,e)&&m(i,n)||m(t,n)&&m(i,e))||y(t,e,i)>0!=y(t,e,n)>0&&y(i,n,t)>0!=y(i,n,e)>0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new _(t.i,t.x,t.y),n=new _(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function T(t,e,i,n){var s=new _(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function _(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={SKIP_CHECK:-1,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}},function(t,e,i){var n={};t.exports=n;var s=i(76),r=i(81),o=i(223),a=i(33),h=i(80),l=i(505);!function(){n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",gameObject:null,parts:[],plugin:{},angle:0,vertices:s.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,ignoreGravity:!1,ignorePointer:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0},lineWidth:0},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,_original:null},n=a.extend(i,e);return t(n,e),n},n.nextGroup=function(t){return t?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var t=function(t,e){e=e||{},n.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),s.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),n.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var i=t.isStatic?"#2e2b44":a.choose(["#006BA6","#0496FF","#FFBC42","#D81159","#8F2D56"]);t.render.fillStyle=t.render.fillStyle||i,t.render.strokeStyle=t.render.strokeStyle||"#000",t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};n.set=function(t,e,i){var s;for(s in"string"==typeof e&&(s=e,(e={})[s]=i),e)if(e.hasOwnProperty(s))switch(i=e[s],s){case"isStatic":n.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":n.setMass(t,i);break;case"density":n.setDensity(t,i);break;case"inertia":n.setInertia(t,i);break;case"vertices":n.setVertices(t,i);break;case"position":n.setPosition(t,i);break;case"angle":n.setAngle(t,i);break;case"velocity":n.setVelocity(t,i);break;case"angularVelocity":n.setAngularVelocity(t,i);break;case"parts":n.setParts(t,i);break;default:t[s]=i}},n.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i=0&&y>=0&&v+y<1}},function(t,e,i){var n=i(0),s=i(172),r=i(9),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){var n=i(0),s=i(40),r=i(406),o=i(404),a=i(191),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e,i){var n={};t.exports=n;var s=i(81),r=i(33);n.create=function(t,e){for(var i=[],n=0;n0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation","orthogonal"),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[])}});t.exports=r},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",{}),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null)}});t.exports=r},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&et.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){var i={};t.exports=i,i.create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i||(i={});var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r,o){for(var a=n.getTintAppendFloatAlphaAndSwap(i.fillColor,i.fillAlpha*s),h=i.pathData,l=i.pathIndexes,u=0;u=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i=t.length)){for(var i=t.length-1,n=t[e],s=e;s-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t=this.firstgid&&t=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(730),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,o],initialize:function(t,e,i,n,s,o,a,h,l){if(r.call(this,t,"Mesh"),n.length!==s.length)throw new Error("Mesh Vertex count must match UV count");var u,c=n.length/2|0;if(o.length>0&&o.length0&&a.lengthl&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(0),s=i(23),r=i(20),o=new n({initialize:function(t,e,i,n,s,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,d)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),y=r=s(r,0,f-i),m=this.data;if(m.trim){var x=m.spriteSourceSize,w=e+(n=s(n,0,u-e)),b=i+(r=s(r,0,c-i));if(!(x.rw||x.y>b)){var T=Math.max(x.x,e),S=Math.max(x.y,i),_=Math.min(x.r,w)-T,A=Math.min(x.b,b)-S;v=_,y=A,p=o?h+(u-(T-x.x)-_):h+(T-x.x),g=a?l+(c-(S-x.y)-A):l+(S-x.y),e=T,i=S,n=_,r=A}else p=0,g=0,v=0,y=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var C=this.source.width,M=this.source.height;return t.u0=Math.max(0,p/C),t.v0=Math.max(0,g/M),t.u1=Math.min(1,(p+v)/C),t.v1=Math.min(1,(g+y)/M),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=y,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){var n=i(0),s=i(11),r=i(20),o=i(1),a=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=r(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=r(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=r(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=r(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit("destroy",this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=a},function(t,e,i){var n=i(0),s=i(63),r=i(11),o=i(1),a=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on("blur",function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on("focus",function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on("prestep",this.update,this),t.events.once("destroy",this.destroy,this)},add:o,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once("ended",i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once("ended",n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("pauseall",this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit("resumeall",this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit("stopall",this)},unlock:o,onBlur:o,onFocus:o,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n.pendingRemove||t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("rate",this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("detune",this,t)}}});t.exports=a},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){var n,s=i(92),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){var n=i(0),s=i(14),r=i(31),o=i(11),a=i(9),h=i(38),l=i(178),u=i(3),c=new n({Extends:o,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.config,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new a,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new a,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new h,this.transparent=!0,this.backgroundColor=l("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new u(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new u);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOn:function(t,e){var i=.5*this.width,n=.5*this.height;return this.midPoint.set(t,e),this.scrollX=t-i,this.scrollY=e-n,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;g-y&&T>-m&&b-y&&_>-m&&Ss&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=l(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.config=t.sys.game.config,this.sceneManager=t.sys.game.scene;var e=this.config.resolution;return this.resolution=e,this._cx=this._x*e,this._cy=this._y*e,this._cw=this._width*e,this._ch=this._height*e,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.config){var t=0!==this._x||0!==this._y||this.config.width!==this._width||this.config.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit("cameradestroy",this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.config=null,this.sceneManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=c},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n0&&s.area(_)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e,i){var n=i(0),s=i(13),r=i(5),o=i(83),a=new n({initialize:function(t,e,i){this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onRepeat:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(){return this.data[0].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},isPaused:function(){return this.state===o.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){for(var n=0;n0&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},pause:function(){if(this.state!==o.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=o.PAUSED,this},play:function(t){if(this.state!==o.ACTIVE){this.state!==o.PENDING_REMOVE&&this.state!==o.REMOVED||(this.init(),this.parent.makeActive(this),t=!0);var e=this.callbacks.onStart;this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.ACTIVE):(this.countdown=this.calculatedOffset,this.state=o.OFFSET_DELAY)):this.paused?(this.paused=!1,this.parent.makeActive(this)):(this.resetTweenData(t),this.state=o.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.parent.makeActive(this))}},resetTweenData:function(t){for(var e=this.data,i=0;i0?(n.elapsed=n.delay,n.state=o.DELAY):n.state=o.PENDING_RENDER}},resume:function(){return this.state===o.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&ns.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=o.PENDING_REMOVE}},stop:function(t){this.state===o.ACTIVE&&void 0!==t&&this.seek(t),this.state!==o.REMOVED&&(this.state!==o.PAUSED&&this.state!==o.PENDING_ADD||(this.parent._destroy.push(this),this.parent._toProcess++),this.state=o.PENDING_REMOVE)},update:function(t,e){if(this.state===o.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var i=!1,n=0;n0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},setStateFromStart:function(t,e,i){if(e.repeatCounter>0){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,o.REPEAT_DELAY):o.PLAYING_FORWARD}return o.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case o.PLAYING_FORWARD:case o.PLAYING_BACKWARD:if(!e.target){e.state=o.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var a,h=e.state===o.PLAYING_FORWARD,l=n/s;a=h?e.ease(l):e.ease(1-l),e.current=e.start+(e.end-e.start)*a,e.target[e.key]=e.current,e.elapsed=n,e.progress=l;var u=t.callbacks.onUpdate;u&&(u.params[1]=e.target,u.func.apply(u.scope,u.params)),1===l&&(h?e.hold>0?(e.elapsed=e.hold-r,e.state=o.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case o.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PENDING_RENDER);break;case o.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=o.PLAYING_FORWARD);break;case o.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case o.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=o.PLAYING_FORWARD):e.state=o.COMPLETE}return e.state!==o.COMPLETE}});a.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=a},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e){function i(t){return!!t.getStart&&"function"==typeof t.getStart}function n(t){return!!t.getEnd&&"function"==typeof t.getEnd}var s=function(t,e){var r,o,a=function(t,e,i){return i},h=function(t,e,i){return i},l=typeof e;if("number"===l)a=function(){return e};else if("string"===l){var u=e[0],c=parseFloat(e.substr(2));switch(u){case"+":a=function(t,e,i){return i+c};break;case"-":a=function(t,e,i){return i-c};break;case"*":a=function(t,e,i){return i*c};break;case"/":a=function(t,e,i){return i/c};break;default:a=function(){return parseFloat(e)}}}else"function"===l?a=e:"object"===l&&(i(o=e)||n(o))?(n(e)&&(a=e.getEnd),i(e)&&(h=e.getStart)):e.hasOwnProperty("value")&&(r=s(t,e.value));return r||(r={getEnd:a,getStart:h}),r};t.exports=s},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"targets",null);return null===e?e:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(29),s=i(77),r=i(218),o=i(210);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",n.ARRAY_2D,u,i,a,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new s({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){var n=i(29),s=i(78),r=i(77),o=i(55);t.exports=function(t,e,i,a,h){for(var l=new s({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],y=s[12],m=s[13],x=s[14],w=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+y)*w,this.y=(e*o+i*u+n*p+m)*w,this.z=(e*a+i*c+n*g+x)*w,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=i(344),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n=0&&r>=0&&s+r<1&&(n.push({x:e[b].x,y:e[b].y}),i)));b++);return n}},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.righte.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),s=i(108),r=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,1,1,1,0],[16777215,16777215,16777215,16777215,16777215,16777215],[1,1,1,1,1,1],n,r),this.resetPosition()},setFrame:function(t){return this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,t=this.frame,this.uv[0]=t.u0,this.uv[1]=t.v0,this.uv[2]=t.u0,this.uv[3]=t.v1,this.uv[4]=t.u1,this.uv[5]=t.v1,this.uv[6]=t.u0,this.uv[7]=t.v0,this.uv[8]=t.u1,this.uv[9]=t.v1,this.uv[10]=t.u1,this.uv[11]=t.v0,this},topLeftX:{get:function(){return this.x+this.vertices[0]},set:function(t){this.vertices[0]=t-this.x,this.vertices[6]=t-this.x}},topLeftY:{get:function(){return this.y+this.vertices[1]},set:function(t){this.vertices[1]=t-this.y,this.vertices[7]=t-this.y}},topRightX:{get:function(){return this.x+this.vertices[10]},set:function(t){this.vertices[10]=t-this.x}},topRightY:{get:function(){return this.y+this.vertices[11]},set:function(t){this.vertices[11]=t-this.y}},bottomLeftX:{get:function(){return this.x+this.vertices[2]},set:function(t){this.vertices[2]=t-this.x}},bottomLeftY:{get:function(){return this.y+this.vertices[3]},set:function(t){this.vertices[3]=t-this.y}},bottomRightX:{get:function(){return this.x+this.vertices[4]},set:function(t){this.vertices[4]=t-this.x,this.vertices[8]=t-this.x}},bottomRightY:{get:function(){return this.y+this.vertices[5]},set:function(t){this.vertices[5]=t-this.y,this.vertices[9]=t-this.y}},topLeftAlpha:{get:function(){return this.alphas[0]},set:function(t){this.alphas[0]=t,this.alphas[3]=t}},topRightAlpha:{get:function(){return this.alphas[5]},set:function(t){this.alphas[5]=t}},bottomLeftAlpha:{get:function(){return this.alphas[1]},set:function(t){this.alphas[1]=t}},bottomRightAlpha:{get:function(){return this.alphas[2]},set:function(t){this.alphas[2]=t,this.alphas[4]=t}},topLeftColor:{get:function(){return this.colors[0]},set:function(t){this.colors[0]=t,this.colors[3]=t}},topRightColor:{get:function(){return this.colors[5]},set:function(t){this.colors[5]=t}},bottomLeftColor:{get:function(){return this.colors[1]},set:function(t){this.colors[1]=t}},bottomRightColor:{get:function(){return this.colors[2]},set:function(t){this.colors[2]=t,this.colors[4]=t}},setTopLeft:function(t,e){return this.topLeftX=t,this.topLeftY=e,this},setTopRight:function(t,e){return this.topRightX=t,this.topRightY=e,this},setBottomLeft:function(t,e){return this.bottomLeftX=t,this.bottomLeftY=e,this},setBottomRight:function(t,e){return this.bottomRightX=t,this.bottomRightY=e,this},resetPosition:function(){var t=this.x,e=this.y,i=Math.floor(this.width/2),n=Math.floor(this.height/2);return this.setTopLeft(t-i,e-n),this.setTopRight(t+i,e-n),this.setBottomLeft(t-i,e+n),this.setBottomRight(t+i,e+n),this},resetAlpha:function(){var t=this.alphas;return t[0]=1,t[1]=1,t[2]=1,t[3]=1,t[4]=1,t[5]=1,this},resetColors:function(){var t=this.colors;return t[0]=16777215,t[1]=16777215,t[2]=16777215,t[3]=16777215,t[4]=16777215,t[5]=16777215,this},reset:function(){return this.resetPosition(),this.resetAlpha(),this.resetColors()}});t.exports=r},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++sl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var y=u[c].length?c:c+1,m=u.slice(y).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=m+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h0&&(a+=u.lineSpacing*p),i.rtl?o=d-o:"right"===i.align?o+=u.width-u.lineWidths[p]:"center"===i.align&&(o+=(u.width-u.lineWidths[p])/2),this.autoRound&&(o=Math.round(o),a=Math.round(a)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[p],o,a)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[p],o,a));return e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(120),s=i(24),r=i(0),o=i(14),a=i(26),h=i(113),l=i(19),u=i(816),c=i(296),d=new r({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,u],initialize:function(t,e,i,r,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=32),void 0===o&&(o=32),l.call(this,t,"RenderTexture"),this.renderer=t.sys.game.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=s.create2D(this,r,o),this.context=this.canvas.getContext("2d"),this.framebuffer=null,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(c(),this.canvas),this.frame=this.texture.get(),this._saved=!1,this.camera=new n(0,0,r,o),this.dirty=!1,this.gl=null;var h=this.renderer;if(h.type===a.WEBGL){var u=h.gl;this.gl=u,this.drawGameObject=this.batchGameObjectWebGL,this.framebuffer=h.createFramebuffer(r,o,this.frame.source.glTexture,!1)}else h.type===a.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas);this.camera.setScene(t),this.setPosition(e,i),this.setSize(r,o),this.setOrigin(0,0),this.initPipeline()},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas.width=t,this.canvas.height=e,this.gl){var i=this.gl;this.renderer.deleteTexture(this.frame.source.glTexture),this.renderer.deleteFramebuffer(this.framebuffer),this.frame.source.glTexture=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1),this.framebuffer=this.renderer.createFramebuffer(t,e,this.frame.source.glTexture,!1),this.frame.glTexture=this.frame.source.glTexture}this.frame.source.width=t,this.frame.source.height=e,this.camera.setSize(t,e),this.frame.setSize(t,e),this.width=t,this.height=e}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e){void 0===e&&(e=1);var i=255&(t>>16|0),n=255&(t>>8|0),s=255&(0|t);if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var r=this.gl;r.clearColor(i/255,n/255,s/255,e),r.clear(r.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else this.context.fillStyle="rgb("+i+","+n+","+s+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height);return this},clear:function(){if(this.dirty){if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.restore()}this.dirty=!1}return this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1,1),r){this.renderer.setFramebuffer(this.framebuffer);var o=this.pipeline;o.projOrtho(0,this.width,0,this.height,-1e3,1e3),this.batchList(t,e,i,n,s),o.flush(),this.renderer.setFramebuffer(null),o.projOrtho(0,o.width,o.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1,1),o){this.renderer.setFramebuffer(this.framebuffer);var h=this.pipeline;h.projOrtho(0,this.width,0,this.height,-1e3,1e3),h.batchTextureFrame(a,i,n,r,s,this.camera.matrix,null),h.flush(),this.renderer.setFramebuffer(null),h.projOrtho(0,h.width,h.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i,n,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;r0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e,i){var n=i(109),s=i(0),r=i(833),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(163),s=i(66),r=i(0),o=i(14),a=i(19),h=i(9),l=i(836),u=i(310),c=i(3),d=new r({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.ScrollFactor,o.Transform,o.Visible,l],initialize:function(t,e,i,n){a.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new h),t.setTo(this.x,this.y,0,0),this.list.length>0)for(var e=this.list,i=new h,n=0;n-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=d},function(t,e,i){var n=i(840),s=i(837),r=i(0),o=i(14),a=i(113),h=i(19),l=i(112),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(t,e,i,n,s){h.call(this,t,"Blitter"),this.setTexture(n,s),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,r){void 0===n&&(n=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new s(this,t,e,i,n);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,n){for(var s=this.createMultiple(e,i,n),r=0;r0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit("start",this),this.events.emit("ready",this,t)},resize:function(t,e){this.events.emit("resize",t,e)},shutdown:function(t){this.events.off("transitioninit"),this.events.off("transitionstart"),this.events.off("transitioncomplete"),this.events.off("transitionout"),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit("destroy",this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,s=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,s=Math.sqrt(Math.random());return e.x=t.x+s*Math.cos(i)*t.width/2,e.y=t.y+s*Math.sin(i)*t.height/2,e}},function(t,e){var i={defaultPipeline:null,pipeline:null,initPipeline:function(t){void 0===t&&(t="TextureTintPipeline");var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return e&&e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t)),this},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=i},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),s=Math.random()+Math.random(),r=s>1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e){t.exports={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}},function(t,e,i){var n={};t.exports=n;var s=i(76),r=i(81),o=i(223),a=i(80),h=i(505),l=i(33);n._warming=.4,n._torqueDampen=1,n._minLength=1e-6,n.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,s=r.magnitude(r.sub(i,n));e.length=void 0!==e.length?e.length:s,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e,i){var n={};t.exports=n;var s=i(33);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r0){i||(i={}),n=e.split(" ");for(var l=0;lthis.vertexCapacity&&(this.flush(),y=!0);var m=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.vertexComponentCount-1;return m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=i,m[++w]=n,m[++w]=h,m[++w]=c,m[++w]=v,x[++w]=p,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=o,m[++w]=a,m[++w]=u,m[++w]=l,m[++w]=v,x[++w]=f,this.vertexCount+=6,y},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f){var p=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),p=!0);var g=this.vertexViewF32,v=this.vertexViewU32,y=this.vertexCount*this.vertexComponentCount-1;return g[++y]=t,g[++y]=e,g[++y]=o,g[++y]=a,g[++y]=f,v[++y]=u,g[++y]=i,g[++y]=n,g[++y]=o,g[++y]=l,g[++y]=f,v[++y]=c,g[++y]=s,g[++y]=r,g[++y]=h,g[++y]=l,g[++y]=f,v[++y]=d,this.vertexCount+=3,p},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,_,A,C,M,P,E,k){this.renderer.setPipeline(this,t);var F=this._tempMatrix1,L=this._tempMatrix2,R=this._tempMatrix3,O=y/i+C,B=m/n+M,D=(y+x)/i+C,I=(m+w)/n+M,Y=o,X=a,z=-g,N=-v;if(t.isCropped){var U=t._crop;Y=U.width,X=U.height,o=U.width,a=U.height;var V=y=U.x,G=m=U.y;c&&(V=x-U.x-U.width),d&&!e.isRenderTexture&&(G=w-U.y-U.height),O=V/i+C,B=G/n+M,D=(V+U.width)/i+C,I=(G+U.height)/n+M,z=-g+y,N=-v+m}d^=!k&&e.isRenderTexture?1:0,c&&(Y*=-1,z+=o),d&&(X*=-1,N+=a);var W=z+Y,H=N+X;L.applyITRS(s,r,u,h,l),F.copyFrom(P.matrix),E?(F.multiplyWithOffset(E,-P.scrollX*f,-P.scrollY*p),L.e=s,L.f=r,F.multiply(L,R)):(L.e-=P.scrollX*f,L.f-=P.scrollY*p,F.multiply(L,R));var j=R.getX(z,N),q=R.getY(z,N),K=R.getX(z,H),J=R.getY(z,H),Z=R.getX(W,H),Q=R.getY(W,H),$=R.getX(W,N),tt=R.getY(W,N);P.roundPixels&&(j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0,tt|=0),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,O,B,D,I,b,T,S,_,A)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),y=h.getY(l,c),m=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,y,m,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n,h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),y=this.currentFrame,m=y.u0,x=y.v0,w=y.u1,b=y.v1;this.batchQuad(l,u,c,d,f,p,g,v,m,x,w,b,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,y=g.v0,m=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,y,m,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(R,O,E,k,H[0],H[1],H[2],H[3],U,V,G,W,I,Y,X,z,D):(j[0]=R,j[1]=O,j[2]=E,j[3]=k,j[4]=1),h&&j[4]?this.batchQuad(M,P,F,L,j[0],j[1],j[2],j[3],U,V,G,W,I,Y,X,z,D):(H[0]=M,H[1]=P,H[2]=F,H[3]=L,H[4]=1)}}});t.exports=d},function(t,e,i){var n=i(0),s=i(894),r=i(196),o=new n({Extends:r,initialize:function(t){t.fragShader=s.replace("%LIGHT_COUNT%",10..toString()),r.call(this,t),this.defaultNormalMap},boot:function(){this.defaultNormalMap=this.game.textures.getFrame("__DEFAULT")},onBind:function(t){r.prototype.onBind.call(this);var e=this.renderer,i=this.program;return this.mvpUpdate(),e.setInt1(i,"uNormSampler",1),e.setFloat2(i,"uResolution",this.width,this.height),t&&this.setNormalMap(t),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,10);if(0===s)return this;this.active=!0;var r,o=this.renderer,a=this.program,h=e.matrix,l={x:0,y:0},u=o.height;for(r=0;r<10;++r)o.setFloat1(a,"uLights["+r+"].radius",0);for(o.setFloat4(a,"uCamera",e.x,e.y,e.rotation,e.zoom),o.setFloat3(a,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(53);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(53);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=i(0),s=i(11),r=i(97),o=i(83),a=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING_ADD,this._pausedState=o.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===o.ACTIVE},add:function(t){return this.queue(r(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"===typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=o.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit("loop",this,this.loopCounter),this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=o.LOOP_DELAY):this.state=o.ACTIVE}else if(this.completeDelay>0)this.countdown=this.completeDelay,this.state=o.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit("complete",this),this.state=o.PENDING_REMOVE}},update:function(t,e){if(this.state!==o.PAUSED){var i=e;switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case o.ACTIVE:for(var n=this.totalData,s=0;s0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var y=0;y0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(0),s=i(14),r=i(26),o=i(19),a=i(446),h=i(103),l=i(38),u=i(10),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===r.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===y?(y=i.createVertexBuffer(m,n.STATIC_DRAW),this.vertexBuffer[e]=y):(i.setVertexBuffer(y),n.bufferSubData(n.ARRAY_BUFFER,0,m))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=a.x/n,l=a.y/s,c=(a.x+e.width)/n,d=(a.y+e.height)/s,f=this._tempMatrix,p=e.width,g=e.height,v=p/2,y=g/2,m=-v,x=-y;e.flipX&&(p*=-1,m+=e.width),e.flipY&&(g*=-1,x+=e.height);var w=m+p,b=x+g;f.applyITRS(v+e.pixelX,y+e.pixelY,e.rotation,1,1);var T=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),S=f.getX(m,x),_=f.getY(m,x),A=f.getX(m,b),C=f.getY(m,b),M=f.getX(w,b),P=f.getY(w,b),E=f.getX(w,x),k=f.getY(w,x);r.roundPixels&&(S|=0,_|=0,A|=0,C|=0,M|=0,P|=0,E|=0,k|=0);var F=this.vertexViewF32[o],L=this.vertexViewU32[o];return F[++t]=S,F[++t]=_,F[++t]=h,F[++t]=l,F[++t]=0,L[++t]=T,F[++t]=A,F[++t]=C,F[++t]=h,F[++t]=d,F[++t]=0,L[++t]=T,F[++t]=M,F[++t]=P,F[++t]=c,F[++t]=d,F[++t]=0,L[++t]=T,F[++t]=S,F[++t]=_,F[++t]=h,F[++t]=l,F[++t]=0,L[++t]=T,F[++t]=M,F[++t]=P,F[++t]=c,F[++t]=d,F[++t]=0,L[++t]=T,F[++t]=E,F[++t]=k,F[++t]=c,F[++t]=l,F[++t]=0,L[++t]=T,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(31),r=i(209),o=i(20),a=i(29),h=i(78),l=i(243),u=i(208),c=i(55),d=i(103),f=i(99),p=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new f(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new u(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:(null!==a&&d.Copy(t,e,i,n,s,r,o,a),this)},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===a&&(a=e.tileWidth),void 0===l&&(l=e.tileHeight),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===i&&(i=0),void 0===n&&(n=0),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,d=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;fa&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[])}});t.exports=r},function(t,e,i){var n=i(455),s=i(215),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=n(t,o);if(a.x+=e,a.y+=i,t.gid){var h=s(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?(a.ellipse=t.ellipse,a.width=t.width,a.height=t.height):t.text?(a.width=t.width,a.height=t.height,a.text=t.text):(a.rectangle=!0,a.width=t.width,a.height=t.height);return a}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|s,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t-1}return!1}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l0&&r.motion=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;sn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e,i){var n=i(40),s=i(0),r=i(35),o=i(39),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i,n){void 0===i&&(i=this.offset.x),void 0===n&&(n=this.offset.y);var s=this.gameObject;return!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),this.offset.set(i,n),this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(314);function s(t){if(!(this instanceof s))return new s(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,y,m;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),y=Math.min(f.maxX,p.maxX),m=Math.min(f.maxY,p.maxY),o=Math.max(0,y-g)*Math.max(0,m-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;te._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=i(35);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(40),s=i(0),r=i(35),o=i(171),a=i(9),h=i(39),l=i(3),u=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x,e.y),this.prev=new l(e.x,e.y),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.physicsType=r.DYNAMIC_BODY,this._reset=!0,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var n=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,n=!0}else{var r=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===r&&this._sy===a||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*a,this._sx=r,this._sy=a,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},update:function(t){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds();var e=this.transform;if(this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter(),this.rotation=e.rotation,this.preRotation=this.rotation,this._reset&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves){this.world.updateMotion(this,t);var i=this.velocity.x,n=this.velocity.y;this.newVelocity.set(i*t,n*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(n,i),this.speed=Math.sqrt(i*i+n*n),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit("worldbounds",this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y,this.moves&&(0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.gameObject.x+=this._dx,this.gameObject.y+=this._dy,this._reset=!0),this._dx<0?this.facing=r.FACING_LEFT:this._dx>0&&(this.facing=r.FACING_RIGHT),this._dy<0?this.facing=r.FACING_UP:this._dy>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft(this.position),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height)),this.debugShowVelocity&&(t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t){return void 0===t&&(t=!0),this.collideWorldBounds=t,this},setVelocity:function(t,e){return this.velocity.set(t,e),this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},function(t,e,i){var n=i(233),s=i(23),r=i(0),o=i(232),a=i(35),h=i(52),l=i(11),u=i(249),c=i(248),d=i(247),f=i(231),p=i(230),g=i(4),v=i(229),y=i(514),m=i(9),x=i(228),w=i(513),b=i(508),T=i(507),S=i(95),_=i(226),A=i(227),C=i(38),M=i(3),P=i(53),E=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.bodies=new S,this.staticBodies=new S,this.pendingDestroy=new S,this.colliders=new v,this.gravity=new M(g(e,"gravity.x",0),g(e,"gravity.y",0)),this.bounds=new m(g(e,"x",0),g(e,"y",0),g(e,"width",t.sys.game.config.width),g(e,"height",t.sys.game.config.height)),this.checkCollision={up:g(e,"checkCollision.up",!0),down:g(e,"checkCollision.down",!0),left:g(e,"checkCollision.left",!0),right:g(e,"checkCollision.right",!0)},this.fps=g(e,"fps",60),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=g(e,"timeScale",1),this.OVERLAP_BIAS=g(e,"overlapBias",4),this.TILE_BIAS=g(e,"tileBias",16),this.forceX=g(e,"forceX",!1),this.isPaused=g(e,"isPaused",!1),this._total=0,this.drawDebug=g(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:g(e,"debugShowBody",!0),debugShowStaticBody:g(e,"debugShowStaticBody",!0),debugShowVelocity:g(e,"debugShowVelocity",!0),bodyDebugColor:g(e,"debugBodyColor",16711935),staticBodyDebugColor:g(e,"debugStaticBodyColor",255),velocityDebugColor:g(e,"debugVelocityColor",65280)},this.maxEntries=g(e,"maxEntries",16),this.useTree=g(e,"useTree",!0),this.tree=new x(this.maxEntries),this.staticTree=new x(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new C,this._tempMatrix2=new C,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=a.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=s;)this._elapsed-=s,i++,this.step(n);this.stepsLastFrame=i}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(o=(r=s.entries).length,t=0;ta.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,u=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)l.right&&(a=h(u.x,u.y,l.right,l.y)-u.radius):u.y>l.bottom&&(u.xl.right&&(a=h(u.x,u.y,l.right,l.bottom)-u.radius)),a*=-1}else a=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===a||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==a&&(t.onOverlap||e.onOverlap)&&this.emit("overlap",t.gameObject,e.gameObject,t,e),0!==a;var c=t.velocity.x,d=t.velocity.y,g=t.mass,v=e.velocity.x,y=e.velocity.y,m=e.mass,x=c*Math.cos(o)+d*Math.sin(o),w=c*Math.sin(o)-d*Math.cos(o),b=v*Math.cos(o)+y*Math.sin(o),T=v*Math.sin(o)-y*Math.cos(o),S=((g-m)*x+2*m*b)/(g+m),_=(2*g*x+(m-g)*b)/(g+m);t.immovable||(t.velocity.x=(S*Math.cos(o)-w*Math.sin(o))*t.bounce.x,t.velocity.y=(w*Math.cos(o)+S*Math.sin(o))*t.bounce.y,c=t.velocity.x,d=t.velocity.y),e.immovable||(e.velocity.x=(_*Math.cos(o)-T*Math.sin(o))*e.bounce.x,e.velocity.y=(T*Math.cos(o)+_*Math.sin(o))*e.bounce.y,v=e.velocity.x,y=e.velocity.y),Math.abs(o)0&&!t.immovable&&v>c?t.velocity.x*=-1:v<0&&!e.immovable&&c0&&!t.immovable&&y>d?t.velocity.y*=-1:y<0&&!e.immovable&&dMath.PI/2&&(c<0&&!t.immovable&&v0&&!e.immovable&&c>v?e.velocity.x*=-1:d<0&&!t.immovable&&y0&&!e.immovable&&c>y&&(e.velocity.y*=-1));var A=this._frameTime;return t.immovable||(t.x+=t.velocity.x*A-a*Math.cos(o),t.y+=t.velocity.y*A-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*A+a*Math.cos(o),e.y+=e.velocity.y*A+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),t.postUpdate(),e.postUpdate(),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f,p=e.getTilesWithinWorldXY(a,h,l,u);if(0===p.length)return!1;for(var g={left:0,right:0,top:0,bottom:0},v=0;v0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=o[s],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],y=e*o-i*r,m=e*a-n*r,x=e*h-s*r,w=i*a-n*o,b=i*h-s*o,T=n*h-s*a,S=l*p-u*f,_=l*g-c*f,A=l*v-d*f,C=u*g-c*p,M=u*v-d*p,P=c*v-d*g,E=y*P-m*M+x*C+w*A-b*_+T*S;return E?(E=1/E,t[0]=(o*P-a*M+h*C)*E,t[1]=(n*M-i*P-s*C)*E,t[2]=(p*T-g*b+v*w)*E,t[3]=(c*b-u*T-d*w)*E,t[4]=(a*A-r*P-h*_)*E,t[5]=(e*P-n*A+s*_)*E,t[6]=(g*x-f*T-v*m)*E,t[7]=(l*T-c*x+d*m)*E,t[8]=(r*M-o*A+h*S)*E,t[9]=(i*A-e*M-s*S)*E,t[10]=(f*b-p*x+v*y)*E,t[11]=(u*x-l*b-d*y)*E,t[12]=(o*_-r*C-a*S)*E,t[13]=(e*C-i*_+n*S)*E,t[14]=(p*m-f*w-g*y)*E,t[15]=(l*w-u*m+c*y)*E,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=t.val,x=m[0],w=m[1],b=m[2],T=m[3];return e[0]=x*i+w*o+b*u+T*p,e[1]=x*n+w*a+b*c+T*g,e[2]=x*s+w*h+b*d+T*v,e[3]=x*r+w*l+b*f+T*y,x=m[4],w=m[5],b=m[6],T=m[7],e[4]=x*i+w*o+b*u+T*p,e[5]=x*n+w*a+b*c+T*g,e[6]=x*s+w*h+b*d+T*v,e[7]=x*r+w*l+b*f+T*y,x=m[8],w=m[9],b=m[10],T=m[11],e[8]=x*i+w*o+b*u+T*p,e[9]=x*n+w*a+b*c+T*g,e[10]=x*s+w*h+b*d+T*v,e[11]=x*r+w*l+b*f+T*y,x=m[12],w=m[13],b=m[14],T=m[15],e[12]=x*i+w*o+b*u+T*p,e[13]=x*n+w*a+b*c+T*g,e[14]=x*s+w*h+b*d+T*v,e[15]=x*r+w*l+b*f+T*y,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],y=i[7],m=i[8],x=i[9],w=i[10],b=i[11],T=n*n*l+h,S=s*n*l+r*a,_=r*n*l-s*a,A=n*s*l-r*a,C=s*s*l+h,M=r*s*l+n*a,P=n*r*l+s*a,E=s*r*l-n*a,k=r*r*l+h;return i[0]=u*T+p*S+m*_,i[1]=c*T+g*S+x*_,i[2]=d*T+v*S+w*_,i[3]=f*T+y*S+b*_,i[4]=u*A+p*C+m*M,i[5]=c*A+g*C+x*M,i[6]=d*A+v*C+w*M,i[7]=f*A+y*C+b*M,i[8]=u*P+p*E+m*k,i[9]=c*P+g*E+x*k,i[10]=d*P+v*E+w*k,i[11]=f*P+y*E+b*k,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,y=o*h,m=o*l;return i[0]=1-(f+g),i[1]=c+m,i[2]=d-y,i[3]=0,i[4]=c-m,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+y,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,y=r*h;return e[0]=1-(d+p),e[1]=u+y,e[2]=c-v,e[3]=0,e[4]=u-y,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),y=h*(g*=v)-l*(p*=v),m=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(y*y+m*m+x*x))?(y*=v=1/v,m*=v,x*=v):(y=0,m=0,x=0);var w=p*x-g*m,b=g*y-f*x,T=f*m-p*y;return(v=Math.sqrt(w*w+b*b+T*T))?(w*=v=1/v,b*=v,T*=v):(w=0,b=0,T=0),n[0]=y,n[1]=w,n[2]=f,n[3]=0,n[4]=m,n[5]=b,n[6]=p,n[7]=0,n[8]=x,n[9]=T,n[10]=g,n[11]=0,n[12]=-(y*s+m*r+x*o),n[13]=-(w*s+b*r+T*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],y=c[5],m=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+y*h,e[4]=g*n+v*o+y*l,e[5]=g*s+v*a+y*u,e[6]=m*i+x*r+w*h,e[7]=m*n+x*o+w*l,e[8]=m*s+x*a+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,y=this.val;return y[0]=1-(c+f),y[3]=l+v,y[6]=u-g,y[1]=l-v,y[4]=1-(h+f),y[7]=d+p,y[2]=u+g,y[5]=d-p,y[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],x=n*h-s*a,w=n*l-r*a,b=n*u-o*a,T=s*l-r*h,S=s*u-o*h,_=r*u-o*l,A=c*v-d*g,C=c*y-f*g,M=c*m-p*g,P=d*y-f*v,E=d*m-p*v,k=f*m-p*y,F=x*k-w*E+b*P+T*M-S*C+_*A;return F?(F=1/F,i[0]=(h*k-l*E+u*P)*F,i[1]=(l*M-a*k-u*C)*F,i[2]=(a*E-h*M+u*A)*F,i[3]=(r*E-s*k-o*P)*F,i[4]=(n*k-r*M+o*C)*F,i[5]=(s*M-n*E-o*A)*F,i[6]=(v*_-y*S+m*T)*F,i[7]=(y*b-g*_-m*w)*F,i[8]=(g*S-v*b+m*x)*F,this):null}});t.exports=n},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e,i){var n=i(245);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),te-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)=0?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(18),r=i(21),o=i(7),a=i(2),h=i(8),l=new n({Extends:r,initialize:function(t,e,i,n){var s="txt";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"text",cache:t.cacheManager.text,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",function(t,e,i){if(Array.isArray(t))for(var n=0;n=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=this.threshold?this.pressed||(this.pressed=!0,this.events.emit("down",e,this,t),this.pad.emit("down",i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit("up",e,this,t),this.pad.emit("up",i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){t.exports={CircleToCircle:i(702),CircleToRectangle:i(701),GetRectangleIntersection:i(700),LineToCircle:i(273),LineToLine:i(107),LineToRectangle:i(699),PointToLine:i(272),PointToLineSegment:i(698),RectangleToRectangle:i(147),RectangleToTriangle:i(697),RectangleToValues:i(696),TriangleToCircle:i(695),TriangleToLine:i(694),TriangleToTriangle:i(693)}},function(t,e,i){t.exports={Circle:i(722),Ellipse:i(712),Intersects:i(274),Line:i(692),Point:i(674),Polygon:i(660),Rectangle:i(266),Triangle:i(631)}},function(t,e,i){var n=i(0),s=i(277),r=i(197),o=i(10),a=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1},enable:function(){return this.active=!0,this},disable:function(){return this.active=!1,this},cull:function(t){var e=this.lights,i=this.culledLights,n=e.length,s=t.x+t.width/2,o=t.y+t.height/2,a=(t.width+t.height)/2,h={x:0,y:0},l=t.matrix,u=this.systems.game.config.height;i.length=0;for(var c=0;c0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],r):h=new s(t,e,i,a[0],a[1],a[2],r),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=a},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t,e,i,n,s,r,o){this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1},set:function(t,e,i,n,s,r,o){return this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1,this},setScrollFactor:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this},setColor:function(t){var e=s.getFloatsFromUintRGB(t);return this.r=e[0],this.g=e[1],this.b=e[2],this},setIntensity:function(t){return this.intensity=t,this},setPosition:function(t,e){return this.x=t,this.y=e,this},setRadius:function(t){return this.radius=t,this}});t.exports=r},function(t,e,i){var n=i(65),s=i(6);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e,i){var n=i(6),s=i(65);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(0),s=i(27),r=i(59),o=i(771),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),s.call(this,t,"Triangle",new r(n,o,a,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,s,r){return this.geom.setTo(t,e,i,n,s,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(774),s=i(0),r=i(64),o=i(27),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(65),s=i(54);t.exports=function(t){for(var e=t.points,i=0,r=0;rc+v)){var y=g.getPoint((u-c)/v);o.push(y);break}c+=v}return o}},function(t,e,i){var n=i(9);t.exports=function(t,e){void 0===e&&(e=new n);for(var i,s=1/0,r=1/0,o=-s,a=-r,h=0;h0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=i(66),s=i(0),r=i(14),o=i(302),a=i(301),h=i(821),l=i(2),u=i(161),c=i(299),d=i(85),f=i(304),p=i(298),g=i(9),v=i(110),y=i(3),m=i(53),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0),this.y=new h(e,"y",0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3),this.angle=new h(e,"angle",{min:0,max:360}),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new y,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0?n.pop():new this.particleClass(this)).fire(e,i),this.particleBringToTop?this.alive.push(r):this.alive.unshift(r),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,r,this),this.atLimit())break}return r}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);for(var n=this.manager.getProcessors(),s=this.alive,r=s.length,o=0;o0){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y},indexSortCallback:function(t,e){return t.index-e.index}});t.exports=x},function(t,e,i){var n=i(0),s=i(31),r=i(52),o=new n({initialize:function(t){this.emitter=t,this.frame=null,this.index=0,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint"),this.index=i.alive.length},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s>>16,m=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+y+","+m+","+x+","+d+")",c.lineWidth=v,w+=3;break;case n.FILL_STYLE:g=l[w+1],f=l[w+2],y=(16711680&g)>>>16,m=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+y+","+m+","+x+","+f+")",w+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[w+1],l[w+2],l[w+3],l[w+4]):c.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.fill(),w+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[w+1],l[w+2]),c.lineTo(l[w+3],l[w+4]),c.lineTo(l[w+5],l[w+6]),c.closePath(),h||c.stroke(),w+=6;break;case n.LINE_TO:c.lineTo(l[w+1],l[w+2]),w+=2;break;case n.MOVE_TO:c.moveTo(l[w+1],l[w+2]),w+=2;break;case n.LINE_FX_TO:c.lineTo(l[w+1],l[w+2]),w+=5;break;case n.MOVE_FX_TO:c.moveTo(l[w+1],l[w+2]),w+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[w+1],l[w+2]),w+=2;break;case n.SCALE:c.scale(l[w+1],l[w+2]),w+=2;break;case n.ROTATE:c.rotate(l[w+1]),w+=1;break;case n.GRADIENT_FILL_STYLE:w+=5;break;case n.GRADIENT_LINE_STYLE:w+=6;break;case n.SET_TEXTURE:w+=2}c.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var n=i(307),s=i(155),r=i(93),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(4),s=i(121),r=function(t,e,i){for(var n=[],s=0;sr;){if(o-r>600){var h=o-r+1,l=e-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*c/h+d)),p=Math.min(o,Math.floor(e+(h-l)*c/h+d));i(t,e,f,p,a)}var g=t[e],v=r,y=o;for(n(t,r,e),a(t[o],g)>0&&n(t,r,o);v0;)y--}0===a(t[r],g)?n(t,r,y):n(t,++y,o),y<=e&&(r=y+1),e<=y&&(o=y-1)}};function n(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function s(t,e){return te?1:0}t.exports=i},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s-1;r--)n[s][r]=t[r][s]}return n}},function(t,e,i){t.exports={AtlasXML:i(885),Canvas:i(884),Image:i(883),JSONArray:i(882),JSONHash:i(881),SpriteSheet:i(880),SpriteSheetFromAtlas:i(879),UnityYAML:i(878)}},function(t,e,i){var n=i(24),s=i(0),r=i(117),o=i(94),a=new s({initialize:function(t,e,i,n){var s=t.manager.game;this.renderer=s.renderer,this.texture=t,this.source=e,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.width||0,this.height=n||e.naturalHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isRenderTexture="RenderTexture"===e.type,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.init(s)},init:function(t){this.renderer&&(this.renderer.gl?this.isCanvas?this.glTexture=this.renderer.canvasToTexture(this.image):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=this.renderer.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.glTexture=this.renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t)},update:function(){if(this.renderer.gl&&this.isCanvas){this.glTexture=this.renderer.canvasToTexture(this.image,this.glTexture);for(var t=this.texture.getTextureSourceIndex(this),e=this.texture.getFramesFromTextureSource(t,!0),i=0;i=r.x&&t=r.y&&e=r.x&&t=r.y&&e0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit("resume",this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit("stop",this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,"rate",t)||(this.calculateRate(),this.emit("rate",this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,"detune",t)||(this.calculateRate(),this.emit("detune",this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit("loop",this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(115),s=i(0),r=i(324),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each(function(e,i){for(var n=0;n-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit("transitioninit",n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once("complete",this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},resize:function(t,e){for(var i=0;i=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e,i){var n=i(0),s=i(11),r=i(7),o=i(13),a=i(5),h=i(2),l=i(15),u=i(331),c=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once("boot",this.boot,this)},boot:function(){var t,e,i,n,s,r,o,a=this.game.config,l=a.installGlobalPlugins;for(l=l.concat(this._pendingGlobal),t=0;t10&&(t=10-this.pointersTotal);for(var i=0;i0},queueTouchStart:function(t){if(this.queue.push(s.TOUCH_START,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueTouchMove:function(t){if(this.queue.push(s.TOUCH_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueTouchEnd:function(t){if(this.queue.push(s.TOUCH_END,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},queueMouseDown:function(t){if(this.queue.push(s.MOUSE_DOWN,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueMouseMove:function(t){if(this.queue.push(s.MOUSE_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueMouseUp:function(t){if(this.queue.push(s.MOUSE_UP,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},addUpCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.upOnce.push(t):this.domCallbacks.up.push(t),this._hasUpCallback=!0,this},addDownCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.downOnce.push(t):this.domCallbacks.down.push(t),this._hasDownCallback=!0,this},addMoveCallback:function(t,e){return void 0===e&&(e=!1),e?this.domCallbacks.moveOnce.push(t):this.domCallbacks.move.push(t),this._hasMoveCallback=!0,this},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var n=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){n=!1;break}s=s.parentContainer}while(s);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;1!==i.resolution&&(a+=i._x,h+=i._y),i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this._tempMatrix,d=this._tempMatrix2,f=0;f1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e,i){var n=i(37);n.ColorToRGBA=i(914),n.ComponentToHex=i(347),n.GetColor=i(177),n.GetColor32=i(377),n.HexStringToColor=i(378),n.HSLToColor=i(913),n.HSVColorWheel=i(912),n.HSVToRGB=i(176),n.HueToComponent=i(346),n.IntegerToColor=i(375),n.IntegerToRGB=i(374),n.Interpolate=i(911),n.ObjectToColor=i(373),n.RandomRGB=i(910),n.RGBStringToColor=i(372),n.RGBToHSV=i(376),n.RGBToString=i(909),n.ValueToColor=i(178),t.exports=n},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(170),s=i(0),r=i(70),o=i(3),a=new s({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;ei;)n-=i;n16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(37),s=i(374);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(ef.right&&(p=u(p,p+(v-f.right),this.lerp.x)),yf.bottom&&(g=u(g,g+(y-f.bottom),this.lerp.y))):(p=u(p,v-l,this.lerp.x),g=u(g,y-c,this.lerp.y))}this.useBounds&&(p=this.clampX(p),g=this.clampY(g)),this.roundPixels&&(l=Math.round(l),c=Math.round(c)),this.scrollX=p,this.scrollY=g;var m=p+s,x=g+o;this.midPoint.set(m,x);var w=i/a,b=n/a;this.worldView.setTo(m-w/2,x-b/2,w,b),h.loadIdentity(),h.scale(e,e),h.translate(this.x+l,this.y+c),h.rotate(this.rotation),h.scale(a,a),h.translate(-l,-c),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(381),s=new(i(0))({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once("destroy",this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","text","html","obj","tilemap","xml"],e=0;ee.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=i(23),s=i(0),r=i(384),o=i(383),a=i(4),h=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,a(i,"frames",[]),a(i,"defaultTextureKey",null)),this.frameRate=a(i,"frameRate",null),this.duration=a(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=a(i,"skipMissedFrames",!0),this.delay=a(i,"delay",0),this.repeat=a(i,"repeat",0),this.repeatDelay=a(i,"repeatDelay",0),this.yoyo=a(i,"yoyo",!1),this.showOnStart=a(i,"showOnStart",!1),this.hideOnComplete=a(i,"hideOnComplete",!1),this.paused=!1,this.manager.on("pauseall",this.pause,this),this.manager.on("resumeall",this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=l[0],l[0].prevFrame=s;var v=1/(l.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),r(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);t._repeatDelay>0&&!1===t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay):(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter,t.parent)))},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i1&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off("pauseall",this.pause,this),this.manager.off("resumeall",this.resume,this),this.manager.remove(this.key);for(var t=0;t-h&&(c-=h,n+=l),f=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(16),s=i(38),r=i(200),o=i(199),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t}};t.exports=a},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){this.geometryMask=t},preRenderWebGL:function(t,e,i){var n=t.gl,s=this.geometryMask;t.flush(),n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.NOTEQUAL,1,1),n.stencilOp(n.REPLACE,n.REPLACE,n.REPLACE),s.renderWebGL(t,s,0,i),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilFunc(n.EQUAL,1,1),n.stencilOp(n.KEEP,n.KEEP,n.KEEP)},postRenderWebGL:function(t){var e=t.gl;t.flush(),e.disable(e.STENCIL_TEST)},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){var i=t.sys.game.renderer;if(this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,i&&i.gl){var n=i.width,s=i.height,r=0==(n&n-1)&&0==(s&s-1),o=i.gl,a=r?o.REPEAT:o.CLAMP_TO_EDGE,h=o.LINEAR;this.mainTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.maskTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.mainFramebuffer=i.createFramebuffer(n,s,this.mainTexture,!1),this.maskFramebuffer=i.createFramebuffer(n,s,this.maskTexture,!1),i.onContextRestored(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,o=s.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!1),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!1)},this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t){t.pipelines.BitmapMaskPipeline.endMask(this)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null;var t=this.renderer;t&&t.gl&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer)),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null,this.renderer=null}});t.exports=n},function(t,e,i){var n=i(395),s=i(394),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&this.texture&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*s-a*r+e,t.y=o*r+a*s+i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var n=i(190),s=i(123);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e,i){var n=i(23),s={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,s){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=s},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var n=i(403),s=i(192),r=i(93),o=i(16);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;h>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;i--){var n=Math.floor(this.frac()*(e+1)),s=t[n];t[n]=t[i],t[i]=s}return t}});t.exports=n},function(t,e,i){var n=i(192),s=i(93),r=i(16),o=i(6);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(44),s=i(42),r=i(43),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(46),s=i(42),r=i(45),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(42),r=i(74),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(44),r=i(73),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(72),s=i(46),r=i(73),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(74),s=i(73);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(412),s=i(75),r=i(72);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(48),s=i(44),r=i(47),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(75),r=i(47),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(193),s=[];s[n.BOTTOM_CENTER]=i(416),s[n.BOTTOM_LEFT]=i(415),s[n.BOTTOM_RIGHT]=i(414),s[n.CENTER]=i(413),s[n.LEFT_CENTER]=i(411),s[n.RIGHT_CENTER]=i(410),s[n.TOP_CENTER]=i(409),s[n.TOP_LEFT]=i(408),s[n.TOP_RIGHT]=i(407);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){t.exports={Angle:i(1049),Call:i(1048),GetFirst:i(1047),GetLast:i(1046),GridAlign:i(1045),IncAlpha:i(1034),IncX:i(1033),IncXY:i(1032),IncY:i(1031),PlaceOnCircle:i(1030),PlaceOnEllipse:i(1029),PlaceOnLine:i(1028),PlaceOnRectangle:i(1027),PlaceOnTriangle:i(1026),PlayAnimation:i(1025),PropertyValueInc:i(32),PropertyValueSet:i(25),RandomCircle:i(1024),RandomEllipse:i(1023),RandomLine:i(1022),RandomRectangle:i(1021),RandomTriangle:i(1020),Rotate:i(1019),RotateAround:i(1018),RotateAroundDistance:i(1017),ScaleX:i(1016),ScaleXY:i(1015),ScaleY:i(1014),SetAlpha:i(1013),SetBlendMode:i(1012),SetDepth:i(1011),SetHitArea:i(1010),SetOrigin:i(1009),SetRotation:i(1008),SetScale:i(1007),SetScaleX:i(1006),SetScaleY:i(1005),SetTint:i(1004),SetVisible:i(1003),SetX:i(1002),SetXY:i(1001),SetY:i(1e3),ShiftPosition:i(999),Shuffle:i(998),SmootherStep:i(997),SmoothStep:i(996),Spread:i(995),ToggleVisible:i(994),WrapInRectangle:i(993)}},function(t,e){var i={};t.exports=i,i.create=function(t,e){var n=t.bodyA,s=t.bodyB,r={id:i.id(n,s),bodyA:n,bodyB:s,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||s.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(r,t,e),r},i.update=function(t,e,n){if(t.collision=e,e.collided){var s=e.supports,r=t.activeContacts,o=e.parentA,a=e.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h0&&n>0&&s.scissor(t,this.drawingBufferHeight-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},setBlendMode:function(t){var e=this.gl,i=this.blendModes[t];return t!==r.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),i.func.length>2?e.blendFuncSeparate(i.func[0],i.func[1],i.func[2],i.func[3]):e.blendFunc(i.func[0],i.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>16&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e){var i=this.gl;return t!==this.currentTextures[e]&&(this.flush(),this.currentActiveTextureUnit!==e&&(i.activeTexture(i.TEXTURE0+e),this.currentActiveTextureUnit=e),i.bindTexture(i.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t){var e=this.gl,i=this.width,n=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(i=t.renderTexture.width,n=t.renderTexture.height):this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),e.viewport(0,0,i,n),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,a=s.NEAREST,h=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,o(e,i)&&(h=s.REPEAT),n===r.ScaleModes.LINEAR&&this.config.antialias&&(a=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,a,h,h,s.RGBA,t):this.createTexture2D(0,a,a,h,h,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=void 0===l||null===l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null===o||void 0===o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&a(this.nativeTextures,e),this.gl.deleteTexture(t),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,s=t._ch,r=this.pipelines.TextureTintPipeline,o=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-s),this.setFramebuffer(t.framebuffer);var a=this.gl;a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),r.projOrtho(e,n+e,i,s+i,-1e3,1e3),o.alphaGL>0&&r.drawFillRect(e,i,n+e,s+i,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL),t.emit("prerender",t)}else this.pushScissor(e,i,n,s),o.alphaGL>0&&r.drawFillRect(e,i,n,s,l.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL)},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,l.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,l.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit("postrender",t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=l.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n in this.config.clearBeforeRender&&(t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)),t.enable(t.SCISSOR_TEST),i)i[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,o=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);this.preRenderCamera(n);for(var l=0;l=0?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===m&&(v>=0?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.scale(y,m),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=u},function(t,e,i){var n=new(i(0))({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once("remove",this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,this._timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this._delay=0,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this.forward=!0,this._reverse=!1,this.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},setDelay:function(t){return void 0===t&&(t=0),this._delay=t,this.parent},getDelay:function(){return this._delay},delayedPlay:function(t,e,i){return this.play(e,!0,i),this.nextTick+=t,this.parent},getCurrentKey:function(){if(this.currentAnim)return this.currentAnim.key},load:function(t,e){return void 0===e&&(e=0),this.isPlaying&&this.stop(),this.animationManager.load(this,t,e),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.updateFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.updateFrame(t),this.parent},isPaused:{get:function(){return this._paused}},play:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!0,this._reverse=!1,this._startAnimation(t,i))},playReverse:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!1,this._reverse=!0,this._startAnimation(t,i))},_startAnimation:function(t,e){this.load(t,e);var i=this.currentAnim,n=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,i.showOnStart&&(n.visible=!0),n.emit("animationstart",this.currentAnim,this.currentFrame,n),n},reverse:function(t){return this.isPlaying&&this.currentAnim.key===t?(this._reverse=!this._reverse,this.forward=!this.forward,this.parent):this.parent},getProgress:function(){var t=this.currentFrame.progress;return this.forward||(t=1-t),t},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},remove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},getRepeat:function(){return this._repeat},setRepeat:function(t){return this._repeat=t,this.repeatCounter=0,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){void 0===t&&(t=!1),this.currentAnim.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(this.currentAnim.frames[0]);var e=this.parent;return e.emit("animationrestart",this.currentAnim,this.currentFrame,e),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent;return t.emit("animationcomplete",this.currentAnim,this.currentFrame,t),t},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopOnRepeat:function(){return this._pendingStop=2,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},setTimeScale:function(t){return void 0===t&&(t=1),this._timeScale=t,this.parent},getTimeScale:function(){return this._timeScale},getTotalFrames:function(){return this.currentAnim.frames.length},update:function(t,e){if(this.currentAnim&&this.isPlaying&&!this.currentAnim.paused){if(this.accumulator+=e*this._timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.currentAnim.completeAnimation(this);this.accumulator>=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit("animationupdate",i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off("remove",this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=n},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,function(t,i){return e[Number(i)-1]})}},function(t,e,i){t.exports={Format:i(429),Pad:i(179),Reverse:i(428),UppercaseFirst:i(328),UUID:i(296)}},function(t,e,i){var n=i(63);t.exports=function(t,e){var i=n(t);for(var s in e)i.hasOwnProperty(s)&&(i[s]=e[s]);return i}},function(t,e){t.exports=function(t,e){for(var i=0;i-1&&(e.state=a.REMOVED,s.splice(r,1)):(e.state=a.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e,i){var n=i(1),s=i(1);n=i(445),s=i(444),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,a.multiply(h,l));var u=t.currentContext,c=e.gidMap;u.save(),l.copyToContext(u);for(var d=n.alpha*e.alpha,f=0;f-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(20);t.exports=function(t){for(var e,i,s,r,o,a=0;a1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f>>0;return n}},function(t,e,i){var n=i(458),s=i(2),r=i(78),o=i(215),a=i(55);t.exports=function(t,e){for(var i=[],h=0;h0){var y=new a(u,v.gid,c,f.length,t.tilewidth,t.tileheight);y.rotation=v.rotation,y.flipX=v.flipped,d.push(y)}else{var m=e?null:new a(u,-1,c,f.length,t.tilewidth,t.tileheight);d.push(m)}++c===l.width&&(f.push(d),c=0,d=[])}u.data=f,i.push(u)}}return i}},function(t,e,i){t.exports={Parse:i(218),Parse2DArray:i(132),ParseCSV:i(217),Impact:i(211),Tiled:i(216)}},function(t,e,i){var n=i(50),s=i(49),r=i(3);t.exports=function(t,e,i,o,a,h){return void 0===o&&(o=new r(0,0)),o.x=n(t,i,a,h),o.y=s(e,i,a,h),o}},function(t,e,i){var n=i(17);t.exports=function(t,e,i,s,r,o){if(void 0!==r){var a,h=n(t,e,i,s,null,o),l=0;for(a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e,i){var n=i(56),s=i(34),r=i(85);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;ae)){for(var h=t;h<=e;h++)r(h,i,a);for(var l=0;l=t&&c.index<=e&&n(c,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(56),s=i(34),r=i(133);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=m;a--)for(o=v;o=m;a--)for(o=y;o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(101),s=i(100),r=i(17),o=i(221);t.exports=function(t,e,i,a,h,l){void 0===i&&(i={}),Array.isArray(t)||(t=[t]);var u=l.tilemapLayer;void 0===a&&(a=u.scene),void 0===h&&(h=a.cameras.main);var c,d=r(0,0,l.width,l.height,null,l),f=[];for(c=0;c=0&&p=0&&g=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("update",this.step,this),t.events.emit("transitioncomplete",this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i){return this.manager.add(t,e,i),this},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off("shutdown",this.shutdown,this),t.off("postupdate",this.step,this),t.off("transitionout")},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});o.register("ScenePlugin",a,"scenePlugin"),t.exports=a},function(t,e,i){var n=i(116),s=i(20),r={SceneManager:i(330),ScenePlugin:i(495),Settings:i(327),Systems:i(165)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(222),s=new(i(0))({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=s},function(t,e,i){t.exports={BasePlugin:i(222),DefaultPlugins:i(166),PluginCache:i(15),PluginManager:i(332),ScenePlugin:i(497)}},function(t,e,i){var n={};t.exports=n;var s=i(136),r=(i(194),i(33));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){var n={};t.exports=n;var s=i(33);n._registry={},n.register=function(t){if(n.isPlugin(t)||s.warn("Plugin.register:",n.toString(t),"does not implement all required fields."),t.name in n._registry){var e=n._registry[t.name],i=n.versionParse(t.version).number,r=n.versionParse(e.version).number;i>r?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n=i(1064);n.Body=i(67),n.Composite=i(136),n.World=i(499),n.Detector=i(503),n.Grid=i(1063),n.Pairs=i(1062),n.Pair=i(419),n.Query=i(1088),n.Resolver=i(1061),n.SAT=i(502),n.Constraint=i(194),n.Common=i(33),n.Engine=i(1060),n.Events=i(195),n.Sleeping=i(223),n.Plugin=i(500),n.Bodies=i(125),n.Composites=i(1067),n.Axes=i(505),n.Bounds=i(80),n.Svg=i(1086),n.Vector=i(81),n.Vertices=i(76),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,t.exports=n},function(t,e,i){var n={};t.exports=n;var s=i(76),r=i(81);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlaps?s=a:a=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n=i(125),s=i(67),r=i(0),o=i(420),a=i(2),h=i(85),l=i(76),u=new r({Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var n=a(i,"body",null),s=a(i,"addToWorld",!0);if(n)this.setBody(n,s);else{var r=e.getCollisionGroup();a(r,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(81),r=i(33);n.fromVertices=function(t){for(var e={},i=0;i0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){var n=i(231);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(509);t.exports=function(t,e,i,s,r){var o=0;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y0&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom>i&&(o=t.bottom-i)>r&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:n(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(511);t.exports=function(t,e,i,s,r){var o=0;return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x0&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right>i&&(o=t.right-i)>r&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:n(t,o)),o}},function(t,e,i){var n=i(512),s=i(510),r=i(227);t.exports=function(t,e,i,o,a,h){var l=o.left,u=o.top,c=o.right,d=o.bottom,f=i.faceLeft||i.faceRight,p=i.faceTop||i.faceBottom;if(!f&&!p)return!1;var g=0,v=0,y=0,m=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l=0;a--){var h=e[a],l=o(s,r,h.x,h.y);l>i&&(n=h,i=l)}return n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(t,e)},shutdown:function(){if(this.world){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});u.register("ArcadePhysics",f,"arcadePhysics"),t.exports=f},function(t,e,i){var n=i(35),s=i(20),r={ArcadePhysics:i(527),Body:i(233),Collider:i(232),Factory:i(239),Group:i(236),Image:i(238),Sprite:i(104),StaticBody:i(226),StaticGroup:i(235),World:i(234)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(137),s=i(241),r=i(240),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o1?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t){for(var e=0,i=0;i0&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(295),IsSize:i(117),IsValue:i(549)}},function(t,e,i){var n=i(182);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(119);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return e<0?n(t[0],t[1],s):e>1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(170);t.exports=function(t,e){var i=t.length-1,s=i*e,r=Math.floor(s);return t[0]===t[i]?(e<0&&(r=Math.floor(s=i*(1+e))),n(s-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(n(-s,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("update",this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit("progress",this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.size'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e,i){var n=i(0),s=i(11),r=i(4),o=i(106),a=i(257),h=i(142),l=i(256),u=i(602),c=i(601),d=i(600),f=i(141),p=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.keys=[],this.combos=[],this.queue=[],this.onKeyHandler,this.time=0,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.settings.input,e=this.scene.sys.game.config;this.enabled=r(t,"keyboard",e.inputKeyboard),this.target=r(t,"keyboard.target",e.inputKeyboardEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=function(e){if(!e.defaultPrevented&&t.isActive()){t.queue.push(e);var i=t.keys[e.keyCode];i&&i.preventDefault&&e.preventDefault()}};this.onKeyHandler=e,this.target.addEventListener("keydown",e,!1),this.target.addEventListener("keyup",e,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("keydown",this.onKeyHandler),this.target.removeEventListener("keyup",this.onKeyHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},createCursorKeys:function(){return this.addKeys({up:h.UP,down:h.DOWN,left:h.LEFT,right:h.RIGHT,space:h.SPACE,shift:h.SHIFT})},addKeys:function(t){var e={};if("string"==typeof t){t=t.split(",");for(var i=0;i-1?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new a(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);i>-1&&(this.keys[i]=void 0)}else"string"==typeof t&&(t=h[t.toUpperCase()]);e[t]&&(e[t]=void 0)},createCombo:function(t,e){return new l(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=f(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(t){this.time=t;var e=this.queue.length;if(this.enabled&&0!==e)for(var i=this.queue.splice(0,e),n=this.keys,s=0;s=e}}},function(t,e,i){var n=i(71),s=i(40),r=i(0),o=i(261),a=i(608),h=i(52),l=i(90),u=i(89),c=i(11),d=i(2),f=i(106),p=i(8),g=i(15),v=i(9),y=i(39),m=i(59),x=i(69),w=new r({Extends:c,initialize:function(t){c.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new c,this.enabled=!0,this.displayList,this.cameras,f.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once("destroy",this.destroy,this),this.pluginEvents.emit("boot")},start:function(){var t=this.systems.events;t.on("transitionstart",this.transitionIn,this),t.on("transitionout",this.transitionOut,this),t.on("transitioncomplete",this.transitionComplete,this),t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.enabled=!0,this.pluginEvents.emit("start")},preUpdate:function(){this.pluginEvents.emit("preUpdate");var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r-1&&(s.splice(a,1),this.clear(o))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},update:function(t,e){if(this.isActive()){this.pluginEvents.emit("update",t,e);var i=this.manager;if(!i.globalTopOnly||!i.ignoreEvents){var n=i.dirty||0===this.pollRate;if(this.pollRate>-1&&(this._pollTimer-=e,this._pollTimer<0&&(n=!0,this._pollTimer=this.pollRate)),n)for(var s=this.manager.pointers,r=0;r0&&i.globalTopOnly&&(i.ignoreEvents=!0)}}}},clear:function(t){var e=t.input;if(e){this.queueForRemoval(t),e.gameObject=void 0,e.target=void 0,e.hitArea=void 0,e.hitAreaCallback=void 0,e.callbackContext=void 0,this.manager.resetCursor(e),t.input=null;var i=this._draggable.indexOf(t);return i>-1&&this._draggable.splice(i,1),(i=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(i,1),(i=this._over[0].indexOf(t))>-1&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0?t.dragState=1:t.dragState>0&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i1&&(this.sortGameObjects(a),this.topOnly&&a.splice(1)),this._drag[t.id]=a,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(this.dragDistanceThreshold>0&&h(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),this.dragTimeThreshold>0&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(s=this._drag[t.id],i=0;i0?(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),l[0]?(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):r.target=null)}else!r.target&&l[0]&&(r.target=l[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target));var c=t.x-n.input.dragX,d=t.y-n.input.dragY;n.emit("drag",t,c,d),this.emit("drag",t,n,c,d)}return s.length}if(5===t.dragState){for(s=this._drag[t.id],i=0;i0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return a(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,a=!1;if(p(e)){var h=e;e=d(h,"hitArea",null),i=d(h,"hitAreaCallback",null),n=d(h,"draggable",!1),s=d(h,"dropZone",!1),r=d(h,"cursor",!1),a=d(h,"useHandCursor",!1);var l=d(h,"pixelPerfect",!1),u=d(h,"alphaTolerance",1);l&&(e={},i=this.makePixelPerfect(u)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var c=0;c0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)e.x&&t.ye.y}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),s=Math.max(t.right,e);t.x=n,t.width=s-n;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var s=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=s,t.height=r-s,t}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;on(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){var n=i(144);t.exports=function(t,e){var i=n(t);return ii&&(i=h.x),h.xr&&(r=h.y),h.ye.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e,i){var n=i(69),s=i(107);t.exports=function(t,e){return!!(n(t,e.getPointA())||n(t,e.getPointB())||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},function(t,e,i){var n=i(273),s=i(69);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottomt.right+r||it.bottom+r||st.right||e.rightt.bottom||e.bottom0}},function(t,e,i){var n=i(272);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(9),s=i(147);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){var n=i(52);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(89);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(89);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(90);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(90);n.Area=i(711),n.Circumference=i(307),n.CircumferencePoint=i(155),n.Clone=i(710),n.Contains=i(89),n.ContainsPoint=i(709),n.ContainsRect=i(708),n.CopyFrom=i(707),n.Equals=i(706),n.GetBounds=i(705),n.GetPoint=i(309),n.GetPoints=i(308),n.Offset=i(704),n.OffsetPoint=i(703),n.Random=i(185),t.exports=n},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e,i){var n=i(40);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(40);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(71);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(71);n.Area=i(721),n.Circumference=i(403),n.CircumferencePoint=i(192),n.Clone=i(720),n.Contains=i(40),n.ContainsPoint=i(719),n.ContainsRect=i(718),n.CopyFrom=i(717),n.Equals=i(716),n.GetBounds=i(715),n.GetPoint=i(406),n.GetPoints=i(404),n.Offset=i(714),n.OffsetPoint=i(713),n.Random=i(191),t.exports=n},function(t,e,i){var n=i(0),s=i(276),r=i(15),o=new n({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once("boot",this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on("shutdown",this.shutdown,this),t.on("destroy",this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(148);s.register("quad",function(t,e){void 0===t&&(t={});var i=r(t,"x",0),s=r(t,"y",0),a=r(t,"key",null),h=r(t,"frame",null),l=new o(this.scene,i,s,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l})},function(t,e,i){var n=i(28),s=i(13),r=i(12),o=i(4),a=i(108);s.register("mesh",function(t,e){void 0===t&&(t={});var i=r(t,"key",null),s=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"colors",[]),u=o(t,"alphas",[]),c=o(t,"uv",[]),d=new a(this.scene,0,0,h,c,l,u,i,s);return void 0!==e&&(t.add=e),n(this.scene,d,t),d})},function(t,e,i){var n=i(148);i(5).register("quad",function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))})},function(t,e,i){var n=i(108);i(5).register("mesh",function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))})},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=this.pipeline;t.setPipeline(o,e);var a=o._tempMatrix1,h=o._tempMatrix2,l=o._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(s.matrix),r?(a.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l)):(h.e-=s.scrollX*e.scrollFactorX,h.f-=s.scrollY*e.scrollFactorY,a.multiply(h,l));var u=e.frame.glTexture,c=e.vertices,d=e.uv,f=e.colors,p=e.alphas,g=c.length,v=Math.floor(.5*g);o.vertexCount+v>=o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var y=o.vertexViewF32,m=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,w=0,b=e.tintFill,T=0;T0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,M=0;M0){var F=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(F.TL=L,F.TR=L,F.BL=L,F.BR=L,C=1;Cr;h--){for(l=0;l0&&r.maxLines1&&(d+=f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(4);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,y={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},m=0,x=0;x?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(812),s=i(20),r={Parse:i(811)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r),t.setBlankTexture(!0)}},function(t,e,i){var n=i(1),s=i(1);n=i(815),s=i(814),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(302),EdgeZone:i(301),RandomZone:i(298)}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.emitters.list,o=r.length;if(0!==o){var a=t._tempMatrix1.copyFrom(n.matrix),h=t._tempMatrix2,l=t._tempMatrix3,u=t._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);a.multiply(u);var c=n.roundPixels,d=t.currentContext;d.save();for(var f=0;f0&&(Y=Y%T-T):Y>T?Y=T:Y<0&&(Y=T+Y%T),null===C&&(C=new o(O+Math.cos(I)*D,B+Math.sin(I)*D,v),S.push(C),R+=.01);R<1+z;)b=Y*R+I,x=O+Math.cos(b)*D,w=B+Math.sin(b)*D,C.points.push(new r(x,w,v)),R+=.01;b=Y+I,x=O+Math.cos(b)*D,w=B+Math.sin(b)*D,C.points.push(new r(x,w,v));break;case n.FILL_RECT:u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==C?C.points.push(new r(p[++P],p[++P],v)):(C=new o(p[++P],p[++P],v),S.push(C));break;case n.MOVE_TO:C=new o(p[++P],p[++P],v),S.push(C);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:O=p[++P],B=p[++P],f.translate(O,B);break;case n.SCALE:O=p[++P],B=p[++P],f.scale(O,B);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var N=p[++P],U=p[++P];u.currentFrame=N,t.setTexture2D(N.glTexture,0),u.tintEffect=U;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,t.setTexture2D(t.blankTexture.glTexture,0),u.tintEffect=2}}}},function(t,e,i){var n=i(1),s=i(1);n=i(829),s=i(306),s=i(306),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(22);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length,h=t.currentContext;if(0!==a&&n(t,h,e,s,r)){var l=e.frame,u=e.displayCallback,c=s.scrollX*e.scrollFactorX,d=s.scrollY*e.scrollFactorY,f=e.fontData.chars,p=e.fontData.lineHeight,g=0,v=0,y=0,m=0,x=null,w=0,b=0,T=0,S=0,_=0,A=0,C=null,M=0,P=e.frame.source.image,E=l.cutX,k=l.cutY,F=0,L=e.fontSize/e.fontData.size;e.cropWidth>0&&e.cropHeight>0&&(h.save(),h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var R=0;R0&&e.cropHeight>0&&h.restore(),h.restore()}}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.text,a=o.length;if(0!==a){var h=this.pipeline;t.setPipeline(h,e);var l=e.cropWidth>0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,y=p.cutY,m=g.width,x=g.height,w=e._isTinted&&e.tintFill,b=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),T=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),S=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),_=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var A,C,M=0,P=0,E=0,k=0,F=e.letterSpacing,L=0,R=0,O=0,B=0,D=e.scrollX,I=e.scrollY,Y=e.fontData,X=Y.chars,z=Y.lineHeight,N=e.fontSize/Y.size,U=0,V=e._align,G=0,W=0;e.getTextBounds(!1);var H=e._bounds.lines;1===V?W=(H.longest-H.lengths[0])/2:2===V&&(W=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;Jv&&(r=v),o>y&&(o=y);var k=v+g.xAdvance,F=y+u;aA&&(A=M),M<_&&(_=M),C++,M=0;S[C]=M,M>A&&(A=M),M<_&&(_=M);var L=i.local,R=i.global,O=i.lines;return L.x=r*m,L.y=o*m,L.width=a*m,L.height=h*m,R.x=t.x-t.displayOriginX+r*x,R.y=t.y-t.displayOriginY+o*w,R.width=a*x,R.height=h*w,O.shortest=_,O.longest=A,O.lengths=S,e&&(L.x=Math.round(L.x),L.y=Math.round(L.y),L.width=Math.round(L.width),L.height=Math.round(L.height),R.x=Math.round(R.x),R.y=Math.round(R.y),R.width=Math.round(R.width),R.height=Math.round(R.height),O.shortest=Math.round(_),O.longest=Math.round(A)),i}},function(t,e,i){var n=i(0),s=i(15),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this)},add:function(t){return-1===this._list.indexOf(t)&&-1===this._pendingInsertion.indexOf(t)&&this._pendingInsertion.push(t),t},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i-1&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;i0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e,i){var n=i(91);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return n(t,s)}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(s)for(var h=0;ht.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){var n=i(315);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var s=[],r=Math.max(n((e-t)/(i||1)),0),o=0;o=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e,i){var n=i(62);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var o=s;o0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t},tick:function(){this.step(window.performance.now())},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime=window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step(window.performance.now())},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e){var i=0,n=function(t,e,n,s){var r=i-s.y-s.height;t.add(n,e,s.x,r,s.width,s.height)};t.exports=function(t,e,s){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height),i=r.height;for(var o=s.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;cx||a<-x)&&(a=0),a<0&&(a=x+a),-1!==h&&(x=a+(h+1));for(var C=l,M=l,P=0,E=e.sourceIndex,k=0;kg||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,y=f,m=0,x=0,w=0;wr&&(m=b-r),T>o&&(x=T-o),t.add(w,e,i+v,s+y,h-m,l-x),(v+=h+p)+h>r&&(v=f,y+=l+p)}return t}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);var r,o=i.frames;for(var a in o){var h=o[a];r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted()),r.customData=n(h)}for(var l in i)"frames"!==l&&(Array.isArray(i[l])?t.customData[l]=i[l].slice(0):t.customData[l]=i[l]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var n=i(63);t.exports=function(t,e,i){if(i.frames||i.textures){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e,i){var n=i(92),s=i(118),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),n.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},function(t,e,i){var n=i(0),s=i(26),r=i(341),o=i(2),a=i(4),h=i(8),l=i(16),u=i(1),c=i(166),d=i(178),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",null),this.scaleMode=a(t,"scaleMode",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND.init(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.autoResize=a(i,"autoResize",!0),this.antialias=a(i,"antialias",!0),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",!1),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){var n=i(168),s=i(382),r=i(380),o=i(24),a=i(0),h=i(902),l=i(897),u=i(122),c=i(890),d=i(341),f=i(345),p=i(11),g=i(339),v=i(15),y=i(332),m=i(330),x=i(326),w=i(319),b=i(877),T=i(876),S=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new p,this.anims=new s(this),this.textures=new w(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new m(this,this.config.sceneConfig),this.device=d,this.sound=x.create(this),this.loop=new b(this,this.config.fps),this.plugins=new y(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){v.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),l(this),c(this),n(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("texturesready",this.texturesReady,this)):console.warn("Core Phaser Plugins missing. Cannot start.")},texturesReady:function(){this.events.emit("ready"),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),T(this);var t=this.events;t.on("hidden",this.onHidden,this),t.on("visible",this.onVisible,this),t.on("blur",this.onBlur,this),t.on("focus",this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e);var n=this.renderer;n.preRender(),i.emit("prerender",n,t,e),this.scene.render(n),n.postRender(),i.emit("postrender",n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e),i.emit("prerender"),i.emit("postrender")},onHidden:function(){this.loop.pause(),this.events.emit("pause")},onVisible:function(){this.loop.resume(),this.events.emit("resume")},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},resize:function(t,e){this.config.width=t,this.config.height=e,this.renderer.resize(t,e),this.input.resize(),this.scene.resize(t,e),this.events.emit("resize",t,e)},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit("destroy"),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=S},function(t,e,i){var n=i(0),s=i(11),r=i(15),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){t.exports={EventEmitter:i(904)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c1)for(var i=1;i>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e){t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(i){t.style[i+"user-select"]=e}),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e,i){t.exports={CanvasInterpolation:i(349),CanvasPool:i(24),Smoothing:i(175),TouchAction:i(916),UserSelect:i(915)}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e,i){t.exports={CenterOn:i(412),GetBottom:i(48),GetCenterX:i(75),GetCenterY:i(72),GetLeft:i(46),GetOffsetX:i(919),GetOffsetY:i(918),GetRight:i(44),GetTop:i(42),SetBottom:i(47),SetCenterX:i(74),SetCenterY:i(73),SetLeft:i(45),SetRight:i(43),SetTop:i(41)}},function(t,e,i){var n=i(44),s=i(42),r=i(47),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(46),s=i(42),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)-a),t}},function(t,e,i){var n=i(75),s=i(42),r=i(47),o=i(74);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)-a),t}},function(t,e,i){var n=i(44),s=i(42),r=i(45),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(44),r=i(73),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(44),r=i(47),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(46),s=i(42),r=i(43),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(72),s=i(46),r=i(73),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(47),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(44),r=i(43),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(46),r=i(45),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)+a),t}},function(t,e,i){var n=i(48),s=i(75),r=i(74),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)+a),t}},function(t,e,i){t.exports={BottomCenter:i(932),BottomLeft:i(931),BottomRight:i(930),LeftBottom:i(929),LeftCenter:i(928),LeftTop:i(927),RightBottom:i(926),RightCenter:i(925),RightTop:i(924),TopCenter:i(923),TopLeft:i(922),TopRight:i(921)}},function(t,e,i){t.exports={BottomCenter:i(416),BottomLeft:i(415),BottomRight:i(414),Center:i(413),LeftCenter:i(411),QuickSet:i(417),RightCenter:i(410),TopCenter:i(409),TopLeft:i(408),TopRight:i(407)}},function(t,e,i){var n=i(193),s=i(20),r={In:i(934),To:i(933)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(935),Bounds:i(920),Canvas:i(917),Color:i(348),Masks:i(908)}},function(t,e,i){var n=i(0),s=i(122),r=i(15),o=new n({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.events=this.systems.events,this.events.once("destroy",this.destroy,this)},start:function(){this.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},function(t,e,i){t.exports={DataManager:i(122),DataManagerPlugin:i(937)}},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},function(t,e,i){var n=i(0),s=i(356),r=i(354),o=i(5),a=i(353),h=i(939),l=i(352),u=i(9),c=i(350),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e0&&(h.preRender(r,o),t.render(n,e,i,h))}},resetAll:function(){for(var t=0;t=1?1:1/e*(1+(e*t|0))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e,i){var n=i(23),s=i(0),r=i(3),o=i(173),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new r,this.current=new r,this.destination=new r,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,a){void 0===i&&(i=1e3),void 0===n&&(n=o.Linear),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning?h:(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(h.scrollX,h.scrollY),this.destination.set(t,e),h.getScroll(t,e,this.current),"string"==typeof n&&o.hasOwnProperty(n)?this.ease=o[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=a,this.camera.emit("camerapanstart",this.camera,this,i,t,e),h)},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var s=this.camera;if(this._elapsed0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=s(t,"speed.x",0),this.speedY=s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={FixedKeyControl:i(988),SmoothedKeyControl:i(987)}},function(t,e,i){t.exports={Controls:i(989),Scene2D:i(986)}},function(t,e,i){t.exports={BaseCache:i(381),CacheManager:i(380)}},function(t,e,i){t.exports={Animation:i(385),AnimationFrame:i(383),AnimationManager:i(382)}},function(t,e,i){var n=i(53);t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=0;s1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){var i={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=i},function(t,e){var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.frame.realWidth},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return this.scaleY*this.frame.realHeight},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){var n=i(94),s={_scaleMode:n.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==n.LINEAR&&t!==n.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=s},function(t,e){var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=Math.round(this.originX*this.width),this._displayOriginY=Math.round(this.originY*this.height),this}};t.exports=i},function(t,e,i){var n=i(9),s=i(397),r=i(3),o={getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getTopRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomLeft:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBottomRight:function(t,e){(t||(t=new r),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&s(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getBounds:function(t){var e,i,s,r,o,a,h,l;if(void 0===t&&(t=new n),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),s=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),s=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,s,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,s,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e,i){var n=i(417),s=i(193),r=i(2),o=i(1),a=new(i(124))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=r(e,"width",-1),o=r(e,"height",-1),h=r(e,"cellWidth",1),l=r(e,"cellHeight",h),u=r(e,"position",s.TOP_LEFT),c=r(e,"x",0),d=r(e,"y",0),f=0,p=0,g=i*h,v=o*l;a.setPosition(c,d),a.setSize(h,l);for(var y=0;y>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionstart",e,i,n)}),d.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionactive",e,i,n)}),d.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit("collisionend",e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&p.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&p.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return p.add(this.localWorld,o),o},add:function(t){return p.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return o.removeBody(this.localWorld,i,e),this},removeConstraint:function(t,e){return o.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i1?1:0;r1?1:0;s0&&u.trigger(t,"collisionStart",{pairs:w.collisionStart}),o.preSolvePosition(w.list),s=0;s0&&u.trigger(t,"collisionActive",{pairs:w.collisionActive}),w.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:w.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(y),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;sf.friction*f.frictionStatic*O*i&&(D=F,B=o.clamp(f.friction*L*i,-D,D));var I=r.cross(_,y),Y=r.cross(A,y),X=w/(g.inverseMass+v.inverseMass+g.inverseInertia*I*I+v.inverseInertia*Y*Y);if(R*=X,B*=X,E<0&&E*E>n._restingThresh*i)T.normalImpulse=0;else{var z=T.normalImpulse;T.normalImpulse=Math.min(T.normalImpulse+R,0),R=T.normalImpulse-z}if(k*k>n._restingThreshTangent*i)T.tangentImpulse=0;else{var N=T.tangentImpulse;T.tangentImpulse=o.clamp(T.tangentImpulse+B,-D,D),B=T.tangentImpulse-N}s.x=y.x*R+m.x*B,s.y=y.y*R+m.y*B,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(_,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(A,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(419),r=i(33);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;ou.bounds.max.x||p.bounds.max.yu.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var y=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,m=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!y&&m&&m&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||y&&!m||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(500),r=i(33);n.name="matter-js",n.version="0.14.2",n.uses=[],n.used=[],n.use=function(){s.use(n,Array.prototype.slice.call(arguments))},n.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(n,t,e)},n.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(n,t,e)}},function(t,e,i){var n=i(427),s=i(0),r=i(420),o=i(19),a=i(2),h=i(186),l=i(61),u=i(3),c=new s({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,s,r,h){o.call(this,t.scene,"Image"),this.anims=new n(this),this.setTexture(s,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=c},function(t,e,i){var n=i(0),s=i(420),r=i(19),o=i(2),a=i(87),h=i(186),l=i(3),u=new n({Extends:a,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,h],initialize:function(t,e,i,n,s,a){r.call(this,t.scene,"Image"),this.setTexture(n,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(136),r=i(194),o=i(33),a=i(67),h=i(125);n.stack=function(t,e,i,n,r,o,h){for(var l,u=s.create({label:"Stack"}),c=t,d=e,f=0,p=0;pg&&(g=m),a.translate(y,{x:.5*x,y:.5*m}),c=y.bounds.max.x+r,s.addBody(u,y),l=y,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;l=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LA&&(A+=e.length),_=Number.MAX_VALUE,A3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],s=i-1;s>=0;--s)S(n,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);return!r(f(t,e-1),f(t,e),f(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))r.ACTIVE&&c(this,t,e))},setCollidesNever:function(t){for(var e=0;e1)for(var h=i/a,l=n/a,u=0;u0?r:0,y=n<0?f:0,m=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var w=Math.floor((e+v)/f);if((l>0||u===w||w<0||w>=p)&&(w=-1),u>=0&&u1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,w,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+y,e=t.pos.x,a=0;break}}if(s){var b=s>0?o:0,T=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),_=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+b)/f);var A=Math.floor((i+b)/f);if((l>0||c===A||A<0||A>=g)&&(A=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,A));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-b+T;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],y=i+s+(g<0?o:0)-d,m=n+r+(p>0?a:0)-f;if(p*m-g*y>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),w=g/x,b=-p/x,T=y*w+m*b,S=w*T,_=b*T;return S*S+_*_>=s*s+r*r?v||p*(m-r)-g*(y-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-_,t.collision.slope={x:p,y:g,nx:w,ny:b},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(225),r=i(1123),o=i(224),a=i(1122),h=new n({initialize:function(t,e,i,n,r){void 0===n&&(n=16),void 0===r&&(r=n),this.world=t,this.gameObject=null,this.enabled=!0,this.parent,this.id=t.getNextID(),this.name="",this.size={x:n,y:r},this.offset={x:0,y:0},this.pos={x:e,y:i},this.last={x:e,y:i},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:t.defaults.maxVelocityX,y:t.defaults.maxVelocityY},this.standing=!1,this.gravityFactor=t.defaults.gravityFactor,this.bounciness=t.defaults.bounciness,this.minBounceVelocity=t.defaults.minBounceVelocity,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER,this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.updateCallback,this.slopeStanding={min:.767944870877505,max:2.3736477827122884}},reset:function(t,e){this.pos={x:t,y:e},this.last={x:t,y:e},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:100,y:100},this.standing=!1,this.gravityFactor=1,this.bounciness=0,this.minBounceVelocity=40,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=o.NONE,this.checkAgainst=o.NONE,this.collides=s.NEVER},update:function(t){var e=this.pos;this.last.x=e.x,this.last.y=e.y,this.vel.y+=this.world.gravity*t*this.gravityFactor,this.vel.x=r(t,this.vel.x,this.accel.x,this.friction.x,this.maxVel.x),this.vel.y=r(t,this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var i=this.vel.x*t,n=this.vel.y*t,s=this.world.collisionMap.trace(e.x,e.y,i,n,this.size.x,this.size.y);this.handleMovementTrace(s)&&a(this,s);var o=this.gameObject;o&&(o.x=e.x-this.offset.x+o.displayOriginX*o.scaleX,o.y=e.y-this.offset.y+o.displayOriginY*o.scaleY),this.updateCallback&&this.updateCallback(this)},drawDebug:function(t){var e=this.pos;if(this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.size.x,this.size.y)),this.debugShowVelocity){var i=e.x+this.size.x/2,n=e.y+this.size.y/2;t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.vel.x,n+this.vel.y)}},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},skipHash:function(){return!this.enabled||0===this.type&&0===this.checkAgainst&&0===this.collides},touches:function(t){return!(this.pos.x>=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},,function(t,e,i){t.exports={BitmapMaskPipeline:i(421),ForwardDiffuseLightPipeline:i(197),TextureTintPipeline:i(196)}},function(t,e,i){t.exports={Utils:i(10),WebGLPipeline:i(198),WebGLRenderer:i(423),Pipelines:i(1078),BYTE:0,SHORT:1,UNSIGNED_BYTE:2,UNSIGNED_SHORT:3,FLOAT:4}},function(t,e,i){t.exports={Canvas:i(425),WebGL:i(422)}},function(t,e,i){t.exports={CanvasRenderer:i(426),GetBlendModes:i(424),SetTransform:i(22)}},function(t,e,i){t.exports={Canvas:i(1081),Snapshot:i(1080),WebGL:i(1079)}},function(t,e,i){var n=i(501),s={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Engine.update",function(){s.Engine.update(this)})},Engine:{update:function(t){for(var e=t.world,i=n.Composite.allBodies(e),r=n.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y0)for(var a=s+1;a1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),y=f+t,m=p+e}},w=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":y=t.x,m=t.y;break;case"H":y=t.x;break;case"V":m=t.y}x(y,m,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i1?1:0;n0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e){t.exports=function(t,e,i,n){var s=e.pos.x+e.size.x-i.pos.x;if(n){var r=e===n?i:e;n.vel.x=-n.vel.x*n.bounciness+r.vel.x;var o=t.collisionMap.trace(n.pos.x,n.pos.y,n===e?-s:s,0,n.size.x,n.size.y);n.pos.x=o.pos.x}else{var a=(e.vel.x-i.vel.x)/2;e.vel.x=-a,i.vel.x=a;var h=t.collisionMap.trace(e.pos.x,e.pos.y,-s/2,0,e.size.x,e.size.y);e.pos.x=Math.floor(h.pos.x);var l=t.collisionMap.trace(i.pos.x,i.pos.y,s/2,0,i.size.x,i.size.y);i.pos.x=Math.ceil(l.pos.x)}}},function(t,e,i){var n=i(225),s=i(1106),r=i(1105);t.exports=function(t,e,i){var o=null;e.collides===n.LITE||i.collides===n.FIXED?o=e:i.collides!==n.LITE&&e.collides!==n.FIXED||(o=i),e.last.x+e.size.x>i.last.x&&e.last.xi.last.y&&e.last.y0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&o0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e,i){t.exports={Body:i(1076),COLLIDES:i(225),CollisionMap:i(1075),Factory:i(1074),Image:i(1072),ImpactBody:i(1073),ImpactPhysics:i(1108),Sprite:i(1071),TYPE:i(224),World:i(1070)}},function(t,e,i){t.exports={Arcade:i(528),Impact:i(1124),Matter:i(1104)}},function(t,e,i){(function(e){i(1058);var n=i(26),s=i(20),r={Actions:i(418),Animation:i(992),Cache:i(991),Cameras:i(990),Class:i(0),Create:i(947),Curves:i(941),Data:i(938),Display:i(936),DOM:i(907),Events:i(905),Game:i(903),GameObjects:i(875),Geom:i(275),Input:i(616),Loader:i(593),Math:i(570),Physics:i(1125),Plugins:i(498),Renderer:i(1082),Scene:i(329),Scenes:i(496),Sound:i(494),Structs:i(493),Textures:i(492),Tilemaps:i(490),Time:i(441),Tweens:i(439),Utils:i(435)};r=s(!1,r,n),t.exports=r,e.Phaser=r}).call(this,i(201))}])}); \ No newline at end of file diff --git a/package.json b/package.json index 89d08b08c..6f066db81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "phaser", - "version": "3.14.0-beta1", + "version": "3.14.0", "release": "Tachikoma", "description": "A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.", "author": "Richard Davey (http://www.photonstorm.com)", diff --git a/src/const.js b/src/const.js index dbc42f6b3..04c4273ad 100644 --- a/src/const.js +++ b/src/const.js @@ -20,7 +20,7 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.14.0-beta1', + VERSION: '3.14.0', BlendModes: require('./renderer/BlendModes'),